wanglingsong / JsonSurfer

A streaming JsonPath processor in Java
MIT License
292 stars 55 forks source link

The underlying Jackson parser doesn't support BigInteger #73

Closed effiban closed 2 years ago

effiban commented 2 years ago

Hi, In our project we need to deserialize Json objects containing very large integers (greater than max of long). I would expect the parser to be able to handle such an integer and produce a BigInteger, however instead we get an exception:

com.fasterxml.jackson.core.JsonParseException: Numeric value (13744120747940549538) out of range of long
 at [Source: UNKNOWN; line: 1, column: 58197]

It appears that a custom deserializer is needed, but there doesn't seem to be any way to define it, or else I couldn't find the documentation.

(NOTE - we are actually using Alpakka's JSON support which uses JSurfer internally, so this might require a corresponding change on their end as well).

Any thoughts? Thanks

effiban commented 2 years ago

@yuliarotenshtein - FYI

wanglingsong commented 2 years ago

this pull request #38 might help but it's not merged yet. I will evaluate it again since many people request this feature

wanglingsong commented 2 years ago

@effiban the code is merged. It will be available in version 1.6.3

effiban commented 2 years ago

@wanglingsong - that's great, thanks!