-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Closed
Labels
in: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)type: regressionA bug that is also a regressionA bug that is also a regression
Milestone
Description
Before v5.3.3, when configuring a custom jackson object mapper in WebClient with:
ObjectMapper mapper = instantiateAndConfigureMyCustomObjectMapper();
WebClient client = WebClient.builder().clientConnector(clientConnector)
// ...
.exchangeStrategies(ExchangeStrategies.builder().codecs(configurer -> {
configurer.defaultCodecs().jackson2JsonDecoder(new Jackson2JsonDecoder(mapper,
MediaType.APPLICATION_JSON, new MediaType("application", "*+json")));
configurer.defaultCodecs().jackson2JsonEncoder(new Jackson2JsonEncoder(mapper,
MediaType.APPLICATION_JSON, new MediaType("application", "*+json")));
}).build())
// ...
.build();when multipart message is being encoded and contains a part with an object subject to be encoded by jackson, the custom mapper was used.
From v5.3.3 onwards, an empty default unconfigured ObjectMapper is used instead, causing several regressions to existing code that expects JSON configuration to be followed.
Most likely changes in spring-web/src/main/java/org/springframework/http/codec/support/BaseDefaultCodecs.java are related to this, as it seems now initialization of readers and writer is done eagerly just once instead of on-demand
Metadata
Metadata
Assignees
Labels
in: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)type: regressionA bug that is also a regressionA bug that is also a regression