-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Gson deserialize Object array problem #1580
Comments
There is no other way of doing this unless you specify concrete types in your mappings (no |
@lyubomyr-shaydariv Thanks for your reply.
By this, I can get the type when deserialize . |
When deserialize with type of object[], gson cannot get the right type.
Code like :
The test result is :
Gson#toJson result :{"id":1,"name":"outer-instance1","objects":[100,{"id":1}]}
Gson#fromJson result : Outer{id=1, name='outer-instance1', objects=[100.0, {id=1.0}]}
class java.lang.Double
class com.google.gson.internal.LinkedTreeMap
Is there any way to handle this?
The text was updated successfully, but these errors were encountered: