I have an API that gives a response like this :
{
responseTime: "12 mls",
totalCount : "1000",
offset:"0",
limit:"1000",
... // other json properties
items: [
{entity1.Property1 = value1, entity1.Property2 = Value 2, ...},
{entity2.Property1 = value1, entity2.Property2 = Value 2, ...},
.... // 1000 enities
]
}
The entity inside the array is very big and the whole response json can go over 200 MB easily. I am wondering how may I consume the array inside the API response as an iterator, each element one by one.
I found an aswer on how I can iterate through an api response that has only an array of elements: {results: [{},{}, ...]} (asnwer here) , but I am not sure how to apply that on a response that has other properties other than the array itself.
Clarification: I want to firstly read the properties of the json (totalCount,limit and offset ) and then read one entity object from the stream at a time and deserialize it to MyEntityModel.
Any idea is welcomed!