Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement JsonParser.getNumberTypeFP() for binary backends #443

Closed
cowtowncoder opened this issue Jan 6, 2024 · 1 comment
Closed

Implement JsonParser.getNumberTypeFP() for binary backends #443

cowtowncoder opened this issue Jan 6, 2024 · 1 comment
Labels
Milestone

Comments

@cowtowncoder
Copy link
Member

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.

cowtowncoder added a commit that referenced this issue Jan 6, 2024
cowtowncoder added a commit that referenced this issue Jan 6, 2024
cowtowncoder added a commit that referenced this issue Jan 6, 2024
cowtowncoder added a commit that referenced this issue Jan 6, 2024
cowtowncoder added a commit that referenced this issue Jan 7, 2024
cowtowncoder added a commit that referenced this issue Jan 7, 2024
cowtowncoder added a commit that referenced this issue Jan 7, 2024
@cowtowncoder cowtowncoder added this to the 2.17.0 milestone Jan 7, 2024
@cowtowncoder
Copy link
Member Author

Completed, merged to master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant