Open v1somaki opened 2 years ago
Hmmh. You are probably right, wrt expected default mapping. Not sure if this is related to deduction-based polymorphic handling (could be same for other polymorphic methods).
As a work-around it probably makes sense to cast value as Number
(if known it should be), call Number.asDouble()
.
NOTE: almost certainly related to buffering of tokens, needed often with polymorphic deserialization.
Interesting that result is BigDecimal
, nonetheless; should produce Double
unless ObjectMapper configured with DeserializationFeature.USE_BIG_DECIMAL_FOR_FLOATS
Describe the bug If deduction-based polymorphism is used, Jackson will deserialize all decimal values as BigDecimal if they are mapped to
java.lang.Object
.Version information 2.13.3
To Reproduce
This can be reproduced by running the following tests:
Prints out:
I believe the first one should be deserialized as
java.lang.Double
instead ofjava.math.BigDecimal
?