-
-
Notifications
You must be signed in to change notification settings - Fork 818
Description
There are a few databind issues:
- Incorrect deserialization for
BigDecimalnumbers jackson-databind#1770 BigDecimalprecision not retained for polymorphic deserialization jackson-databind#2644- Trailing zeros are stripped when deserializing BigDecimal values inside a @JsonUnwrapped property jackson-databind#2784
that seem to be caused by buffering code that reads floating-point values as Doubles, leading to loss of precision for JSON (and other textual formats), and possibly issues with NaN values as well.
But it seems like there might be a simple fix: if, in case of buffering, there was a method similar to getNumberValue() but that would use BigDecimal in case of floating-point values (to preserve exact value and precision, since that is 10-based), that would solve the problem.
Conversely formats (mostly binary formats) that have concrete/physical representations of 2-based floating-point values could and should still return double / float values as appropriate: change would only occur in cases where precision loss is possible.