-
Notifications
You must be signed in to change notification settings - Fork 41.7k
Open
Labels
type: regressionA regression from a previous releaseA regression from a previous release
Milestone
Description
As of spring boot 4.0.0, I was able to add the following:
@Bean
ServerHttpMessageConvertersCustomizer jacksonCustomizer(JsonMapper jsonMapper) {
return builder -> builder.withJsonConverter(
new JacksonJsonHttpMessageConverter(jsonMapper.rebuild()
.addModule(<some module with custom serializers>)
.build())
);
}
to customize the object mapper used to serialize our api responses, while not applying those custom serializers to the RestClients used in our application.
However, with 4.0.1, this customizer no longer works since it's now competing with the one added in 50f64f9 and since these customizers are modifying a builder, the last one wins, and the order of that new one is defaulting to LOWEST_PRECEDENCE, meaning it'll always win.
I've been able to work around it by adding:
spring:
http:
converters:
preferred-json-mapper: none
to my application.yml and supplying a ClientHttpMessageConvertersCustomizer that uses an object mapper without those additional serializers, but that seems rather clunky.
Metadata
Metadata
Assignees
Labels
type: regressionA regression from a previous releaseA regression from a previous release