I am facing issue while calling the api. Can anyone help me the resolve the exception.
JSON FORMAT:
[
[
{“id”:”1”},
{“id”:”1”}
],[],[]
]
MODEL:
public List<Data> data;
Public class Data{
@SerializedName("id")
public String id;
}
CALLING:
Call <List<IndividualListModel>> indiList(@Header("Authorization") String token);
At the root element, the JSON that you receive doesn't have a List<Data>
. It has List<List<Data>>
since there are some arrays, nested inside another array:
[
[
{
"id": "1"
},
{
"id": "1"
}
],
[],
[]
]