0
votes

Has anyone working with Spring-Boot figured out how to override the default Jackson ObjectMapper that is automatically configured? I have tried to instantiate both the ObjectMapper as a bean and within a MappingJackson2HttpMessageConverter also as a been. But with no success...

Any thoughts?

1

1 Answers

0
votes

Spring handles HTTP @ResponseBody using the HttpMessageConverter abstraction, so it's there that you would have to add customizations. Normally you would add a @Bean extending WebMvcConfigurerAdapter and override the configureMessageConverters() method.

Adding a @Bean of type ObjectMapper sounds like a neat way to do this for a Spring Boot application, so you could provide that feature in a pull request if you like.