Skip to content

Implement JsonParser.getNumberTypeFP() for binary backends #443

Closed
@cowtowncoder

Description

@cowtowncoder

Now that FasterXML/jackson-core#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:

  1. Always retaining accuracy between Decimal and Binary floating-point values, regardless of access patterns, but
  2. Using most efficient access in case of typed calls
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions