Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSON starting with array vs Object , no change in the pojo generated? #3

Open
LOG-TAG opened this issue Apr 14, 2014 · 1 comment
Open

Comments

@LOG-TAG
Copy link

LOG-TAG commented Apr 14, 2014

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

@ehanoc
Copy link
Owner

ehanoc commented Apr 14, 2014

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.

Repository owner deleted a comment from rnoh96 Mar 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants