Jackson is ignoring spring.jackson.property-naming-strategy=SNAKE_CASE. I am using springBootVersion 1.4.2.RELEASE. In my application.properties file, I have added
MappingJackson2HttpMessageConverter class uses the default instance created by Jackson2ObjectMapperBuilder.json() method. In order to use application conext's ObjectMapper, you can register a custom WebMvcConfigurerAdapter.
@Configuration
public class WebMvcDefaultObjectMapperConfigurerAdapter extends WebMvcConfigurerAdapter {
private ObjectMapper mapper;
@Autowired
public WebMvcDefaultObjectMapperConfigurerAdapter(ObjectMapper mapper) {
// default mapper configured with spring.*
this.mapper = mapper;
}
@Override
public void extendMessageConverters(List> converters) {
for (HttpMessageConverter> httpConverter : converters) {
if (httpConverter instanceof MappingJackson2HttpMessageConverter) {
// register the configured object mapper to HttpMessageconter
((MappingJackson2HttpMessageConverter) httpConverter).setObjectMapper(mapper);
}
}
}
}