Using the config overrides described in #1911
Reproduction pseudocode:
class Foo {
public BigDecimal value;
public List<Object> values:
}
Foo foo = new Foo();
foo.value = new BigDecimal("1.23");
foo.values = ImmutableList.of(new BigDecimal("2.34"));
ObjectMapper mapper = new ObjectMapper();
mapper.configOverrides(BigDecimal.class). .setFormat(JsonFormat.Value.forShape(JsonFormat.Shape.STRING));
mapper.writeValueAsString(foo);
Expected:
Both BigDecimals to be JSON Strings
Actual:
Only value is JSON String
Version: 2.9.6