Add test to verify that deserialization of sub type doesn't wrongly use BigDecimal #4138
Closed
1 task done
Labels
2.16
Issues planned for 2.16
Search before asking
Describe the bug
New issue created from comment in #3251 (which seems related).
Deserializing JSON with floating point numbers will incorrectly use
BigDecimal
instead ofDouble
when using sub types (even thoughDeserializationFeature.USE_BIG_DECIMAL_FOR_FLOATS
isfalse
).This bug is fixed in
2.15.2
but is present in the mentioned version (2.14.3
) but a test should be added to prevent future regression if this fix was not deliberate.I can also confirm the value of
@JsonTypeInfo#include
does not affect this behaviour.Version Information
2.14.3
Reproduction
Subtype class definition
JSON string to deserialize
Result
Hydrated
ValueTest
instance will haveBigDecimal
objects in theallowedValues
property.Expected behavior
Hydrated
ValueTest
instance should containDouble
objects unlessDeserializationFeature.USE_BIG_DECIMAL_FOR_FLOATS
istrue
Additional context
No response
The text was updated successfully, but these errors were encountered: