json2ts
json2ts copied to clipboard
Missing Optional Operator for Optional Key
I have a json below:
{
name: 'Ziu',
age: 18,
friends: [
{ name: 'Kobe', age: 19, isVip: true },
{ name: 'James', age: 20 }
]
}
convert it to Typescript Interface using json2ts
:
export interface Friend {
name: string;
age: number;
isVip: boolean; // isVip shoult be an Optional Key
}
export interface RootObject {
name: string;
age: number;
friends: Friend[];
}
the optional operator of key isVip
is missing