msgpack / msgpack-java

MessagePack serializer implementation for Java / msgpack.org[Java]
http://msgpack.org/
Apache License 2.0
1.41k stars 321 forks source link

Add `MessagePackMapper#handleBigDecimalAsString` #745

Closed komamitsu closed 1 year ago

komamitsu commented 1 year ago

Context

We've received some issues that jackson-dataformat-msgpack fails to serialize large BigDecimal values. It's because the default internal type double can't store large BigDecimal values. We've found a workaround, but the same issue has been reported.

Changes

This PR introduces MessagePackMapper#handleBigDecimalAsString with which users can easily use the workaround, and recommends to use the new method in README

xerial commented 11 months ago

@komamitsu It seems a similar type escalation mechanism is necessary for BigInteger as well

komamitsu commented 11 months ago

Handled BigInteger in https://github.com/msgpack/msgpack-java/pull/768