Consider adding JsonNodeFeature
to allow overriding DeserializationFeature.USE_BIG_DECIMAL_FOR_FLOATS
#4801
Labels
2.19
Issues planned at 2.19 or later
Describe your Issue
Due to eager binding of number type when reading
JsonNode
-- basically, decision must be made between reading:Double
vsBigDecimal
(to get either
DoubleNode
orBigDecimalNode
)there are cases where common buffering use cases expose unexpected precision loss -- particular since by default
Double
is used. See, for example:FasterXML/jackson-modules-java8#326
This behavior can be changed via
DeserializationFeature.USE_BIG_DECIMAL_FOR_FLOATS
, but that is global setting. Instead, it would perhaps make sense to add aJsonNodeFeature
which would only affectJsonNode
reading, but would have precedence overDeserializationFeature
.I haven't thought this fully through wrt implementation but this seems like potentially useful thing to have.
The text was updated successfully, but these errors were encountered: