Disable Jackson XML support in RSocket codecs
Prior to this commit, having the `spring-boot-starter-rsocket` and the `jackson-dataformat-xml` dependencies on classpath would result in a `ClassCastException` when the RSocket auto-configuration tries to configure Jackson CBOR codecs for RSocket strategies. This commit disables the Jackson XML support for the CBOR codec in RSocket. Fixes gh-17425
This commit is contained in:
@@ -78,7 +78,7 @@ public class RSocketStrategiesAutoConfiguration {
|
||||
@ConditionalOnBean(Jackson2ObjectMapperBuilder.class)
|
||||
public RSocketStrategiesCustomizer jacksonCborRSocketStrategyCustomizer(Jackson2ObjectMapperBuilder builder) {
|
||||
return (strategy) -> {
|
||||
ObjectMapper objectMapper = builder.factory(new CBORFactory()).build();
|
||||
ObjectMapper objectMapper = builder.createXmlMapper(false).factory(new CBORFactory()).build();
|
||||
strategy.decoder(new Jackson2CborDecoder(objectMapper, SUPPORTED_TYPES));
|
||||
strategy.encoder(new Jackson2CborEncoder(objectMapper, SUPPORTED_TYPES));
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user