-
-
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
BigDecimal values via @JsonTypeInfo/@JsonSubTypes get rounded #965
Comments
I do not see anything immediately wrong about your handling so I assume you are observing a real bug, although can not say for sure why it occurs. However, I can speculate as to why Thank you for report -- I hope it is easy to fix. |
Ah. One thing likely to cause an issue: due to use of polymorphic type id of |
Ok yes. This becomes much trickier, as the underlying parser has no way of knowing whether a given floating-point number would require decimal representation for full accuracy. Because of this, |
Thanks for quick fix! We have a workaround until 2.6.3 is released. |
When using an
ObjectMapper
to serialize/deserialize a class with anObject
field annotated with a@JsonSubTypes.Type
that indicateBigDecimal
, it looks like the value is getting rounded to a double.I tried configuring
DeserializationFeature.USE_BIG_DECIMAL_FOR_FLOATS
, but that didn't seem to help.What I think is a valid repro is below, but let me know if I'm actually doing something wrong here.
Thanks!
The text was updated successfully, but these errors were encountered: