Now that https://github.com/FasterXML/jackson-core/issues/1149 has been implemented and there is base implementation of getNumberTypeFP() in JsonParser (which basically just returns "unknown" in all cases), it is necessary to override this for binary formats that have specific types (Avro, CBOR, Ion, Protobuf, Smile all do, I think) to report true underlying type.
This will allow achieving good balance between somewhat clashing goals of:
Always retaining accuracy between Decimal and Binary floating-point values, regardless of access patterns, but
Using most efficient access in case of typed calls
Unless overridden by configuration, use actual encoded values (related to efficient access), that is, avoid conversions where not requested (Object, JsonNode, Number target types)
To do that, binary backends should expose true types.
Now that https://github.com/FasterXML/jackson-core/issues/1149 has been implemented and there is base implementation of
getNumberTypeFP()
inJsonParser
(which basically just returns "unknown" in all cases), it is necessary to override this for binary formats that have specific types (Avro, CBOR, Ion, Protobuf, Smile all do, I think) to report true underlying type. This will allow achieving good balance between somewhat clashing goals of:Object
,JsonNode
,Number
target types)To do that, binary backends should expose true types.