Sometimes it is useful to parse '5' as long vs '5.0' as double, especially when parsing arbitrary data.
This would make the serialize/deserialize of numbers symetric (5.0 > "5.0" > 5.0, 5L > "5" > 5L)
I'd like to suggest a new builder param:
setNumberDererializationPolicy()
default will remain as is
however, user will be able to specify:
setNumberDererializationPolicy(NumberDererializationPolicy.LONG_SUPPORT)
I think this presents a good compromise between the spec being strictly double and the reality where double has precision issues and users need a way to store longs in arbitrary json.
We'd be happy to create a PR if this is acceptable
Sometimes it is useful to parse '5' as long vs '5.0' as double, especially when parsing arbitrary data.
This would make the serialize/deserialize of numbers symetric (5.0 > "5.0" > 5.0, 5L > "5" > 5L)
I'd like to suggest a new builder param:
setNumberDererializationPolicy()
default will remain as is
however, user will be able to specify:
setNumberDererializationPolicy(NumberDererializationPolicy.LONG_SUPPORT)
I think this presents a good compromise between the spec being strictly double and the reality where double has precision issues and users need a way to store longs in arbitrary json.
We'd be happy to create a PR if this is acceptable