I have a weird JSON which looks like this
[
[
{
"id": "1",
"clientId": "user"
},
{
"id": "2",
"clientId": "user"
}
],
[
{
"Status": "NotCompleted",
"StatusId": 0
},
{
"Status": "Importing",
"StatusId": 10
}
]
]
I am trying to parse it with Gson or JsonParser.
Classes look like this
public class Event {
public String id;
public String clientId;
}
public class Status {
public String Status;
public String StatusId;
}
public class AllEvents {
public Event[] events;
public Status[] statuses;
}
But when I am trying to parse it with Gson (e.g)
AllEvents[] r = new Gson().fromJson(response, AllEvents[].class);
java.lang.IllegalStateException: Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 1 column 6 path $[0]
Could you please help me out with parsing this kind of model? Cannot find what I am doing wrong in this case.
Thanks in advance