Open mhalbritter opened 1 year ago
Since ObjectMapper is quite heavy, if at least there is a known way, per technology, to know how to override the ObjectMapper it could be nice. Like using the default, by default, but if needed have a sort of bean to override that default, like you have proposed for the elasticsearch case;
@Configuration(proxyBeanMethods = false)
class JacksonJsonpMapperConfiguration {
@Bean
JacksonJsonpMapper jacksonJsonpMapper() {
return new JacksonJsonpMapper();
}
}
Yes, maybe we come to the conclusion that the drawbacks are not worth it and we stick to one ObjectMapper. In that case we should at least document the ramifications of that.
Currently we use a global
ObjectMapper
at least for WebMVC and for the Elasticsearch client (see https://github.com/spring-projects/spring-boot/issues/33426).We should think about separating these
ObjectMapper
s, because right now if you change for example the date time format for WebMVC, this changes also the serialization format used for ElasticSearch.There may be other places which share the same object mapper.