I m trying to convert an API response to typescript class/interface.
Here the API returns a list of objects with some properties, but I need only few of the properties of the response object.
API Response Example:
[{
'Id' : 1,
'Name': 'test',
'Description: 'Test',
'PropertyX': 'x',
'PropertyY' : 'y'
},
...]
Typescript Class
Class Response {
Id: string;
Name: string;
}
Can you please suggest me what will be the best approach for converting the JSON object to a typescript object.