I hope to enable WRITE_BIGDECIMAL_AS_PLAIN
feature in Spring MVC. How can I customise the serialization
for BigDecimal
?
Asked
Active
Viewed 3,607 times
1

Chao
- 865
- 8
- 21
-
Possible duplicate of [How to customise Jackson in Spring Boot 1.4](https://stackoverflow.com/questions/39263553/how-to-customise-jackson-in-spring-boot-1-4) – Sangam Belose Mar 23 '18 at 04:49
1 Answers
3
I found a solution:
@Bean
public Jackson2ObjectMapperBuilderCustomizer customizeObjectMapper() {
return jacksonObjectMapperBuilder -> jacksonObjectMapperBuilder.featuresToEnable(JsonGenerator.Feature.WRITE_BIGDECIMAL_AS_PLAIN);
}

Chao
- 865
- 8
- 21