Reputation: 13101
When the JSON is:
{
"result":200,
"data", "my data"
}
The definition of the class can be:
class HttpResult
{
@Key
public int result;
@Key
public String data;
}
When the JSON root is a array and has no Key:
[
{
"result:200",
"data":"data1"
},
{
"result":404,
"data":"data2"
}
]
Then the definition of the class is?
Upvotes: 0
Views: 206
Reputation: 65351
Same class definition, it's just a Collection
of them instead of one.
Upvotes: 1