Skip to content

Add JsonGenerator.copyCurrentEventExact as alternative to copyCurrentEvent() #984

Description

@cowtowncoder

(note: this will replace #730 )

There is an existing problem with JsonGenerator.copyCurrentEvent() as explained on issue #730.
Unfortunately changing existing implementation has potential serious downsides for usage with binary backends when translating from textual format like JSON (with possible but not necessarily inexact double vs accurate BigDecimal) into binary format like CBOR, where latter may desire to just use double (or float) value.

Since we do want to offer a way for 100% accuracy-retaining method, it seems safer to introduce a new method as an alternative so caller can specify exactly what to optimize for -- existing method follows whatever JsonParser.getNumberType() claims is the optimal representation; new method will instead use JsonParser.getNumberValueExact().

NOTE: we may consider in near future possibly to add JsonGenerator.copyCurrentStructureExact(), but initial work is just for copyCurrentEventExact().

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions