Open rlubke opened 6 years ago
This is a bug, it should have been serialized as a string in order to not loose precision. Would you mind opening a PR? The fix is basically to write the value as a string here. Same goes for big decimals.
Yes, will do. Just going through legal approvals on this end.
Consider the following code:
This results in the following JSON:
However, due to how Genson parses numerics, the BigInteger value is converted to a double prior to invoking the converter resulting in the following error:
See: https://tools.ietf.org/html/rfc7159#section-6
Specifically:
Given this, it seems that Big{Integer,Decimal} should be serialized as objects to avoid loss of precision vs trying to fit them into a double.
Thoughts?