micronaut-serialization
micronaut-serialization copied to clipboard
Fix JsonNumber bson serialization
trafficstars
- Always use the right number type when serializing, so formats that support the type info can deserialize to the correct type. Currently, if you serialize an
int JsonNumber, when deserializing you get along JsonNumber. - Fix fallback deserialization of custom
Numberimplementations. The bson decoder advances whengetBigDecimalis called - so, in the second call you either get an exception or one of the fields is swallowed. - Fix element index increment when serializing
BigInteger. Increment is already done byencodeBigDecimal.
Thanks for the PR. I have corrected the new method.