I working with API in which an object can an be array or it can be any object and I don't know in which scenario it will be object or array so i can't use different object base on some condition.
Unfortunately I've no access to API code so I can't do any changes there. Any trick that I've to do will be on client side.
So what is the best way to handle that scenario.
Edit : Response Example
.
.
"ecf":"0",
"place":{ },
"mn":"1st Test",
"teams":[ ],
"past_ings":[
{
"s":{ },
"d":{
"a":{
"t":{
"i":"5221",
"a":"3",
"c":"not out",
"dt":null,
"fd":"0",
"bd":"0",
"cb":"no",
"b":"1",
"r":"0",
"sr":"0",
"four":"0",
"six":"0",
"name":"Umesh Yadav"
}
}
}
}
.
.
The object t can be array or it can be object.
Note : I'm using Gson for parsing and using Retrofit in my network layer.