As a newcomer to this area, please excuse any inaccuracies in my language. Don't hesitate to ask for more details if needed.
I currently have some TypeScript interfaces:
export interface Item {
id: string
type: string
state: string
}
export interface ItemResponse {
someData1: string
someData2: string
itemListResponse: Array<Item> // essentially a JSON string containing serialized Items in an array
}
The ItemResponse is being populated through a fairly successful call to an external service:
The outcome is a series of ItemResponses. For now, let's assume the size of the ItemResponse array is 1, although there are multiple Items within the itemListResponse array.
The itemListResponse is essentially just a JSON string:
"[{"id":"blah", "type":"blah", ...}, {"id":"blah2",.... },...]"
How can I convert this into an array of Items?
I believe I understand how to parse from JSON to a single object, but I'm uncertain about managing arrays.