CleverModels
CleverModels copied to clipboard
JSON starting with array vs Object , no change in the pojo generated?
case1:
[ { "rollno": "001553244373", "app_dob": "1992-10-25", "result": "Contains no info" } ]
case2:
{
"certno": "001439924373",
"app_dob": "1992-10-25",
"result": "Contains no information"
}
How come for both case1,2 returned same POJO's ? case one starts with JSON array , case2 starts with Json object!!
YourClass yourClass = gson.fromJson(json, case2.class); //success
YourClass yourClass = gson.fromJson(json, case1.class); //fails
Thanks for reporting this.
Can you show me the case1 generated class ?
But, by the way, i currently have little time to maintain this. But, if you provide a fix, send me a pull request and i'll update it.