-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Type id not provided on Double.NaN
, Infinity
with @JsonTypeInfo
#2236
Comments
Interesting edge case. Yes, that would indeed make sense. My main concern (without looking at code yet) is whether output as String is handled by serializer (if so, easy), or low-level |
Double.NaN
, Infinity
with @JsonTypeInfo
Hi @cowtowncoder , is-it possible to have the same fix related to Float? Or is-it already working? Thank you! |
Oh, I can see that this is already fixed for float, I believe.
and Float.NaN gets serialized as: |
When using polymorphic serialisation with @JsonTypeInfo, e.g. on a Collection of Objects, the type information is sent with the values to ensure correct deserialisation. Doubles (and others like Strings) don't get their types included given they are considered the default deserialisation type. This causes problems for Double.NaN, Double.POSITIVE_INFINITY and Double.NEGATIVE_INFINITY as they get deserialised into strings rather than Double.
Would it make sense to include the type for these three Double values to ensure they can also be correctly deserialised (I tested that the deserialisation works correctly if the type is included in the data)?
(Using 2.9.8)
Thanks!
CBB
The text was updated successfully, but these errors were encountered: