You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We recently updated our gson version from 2.7 to 2.8.6 and noticed some serialization test failures. The reason for this is that we have a data structure that makes extensive use of generics. On certain scenario fails were ObjectTypeAdaper always serializes NUMBER as Double.
Here is a unit test that passes with 2.7 and fails with 2.8.6
Sounds similar to #1731. This might be the same bug which has the pull request #1391 fixing it.
Also note that Gson currently has no built-in type adapter for java.util.Optional so unless you are providing your own custom one you are relying on implementation details of the JDK.
Note however that I am not a maintainer and therefore do not know when that pull request will be merged.
It looks like at least the specific test case you have given works fine in Gson 2.9.1; therefore I am closing this issue. Please create a new issue in case you still experience a similar problem.
We recently updated our gson version from 2.7 to 2.8.6 and noticed some serialization test failures. The reason for this is that we have a data structure that makes extensive use of generics. On certain scenario fails were ObjectTypeAdaper always serializes NUMBER as Double.
Here is a unit test that passes with 2.7 and fails with 2.8.6
The text was updated successfully, but these errors were encountered: