Refine Kotlin serialization converters/codecs conditions

This commit is a follow-up of 34410 to refine the activation conditions
of Kotlin serialization converters/codecs.

Closes gh-34438
This commit is contained in:
Sébastien Deleuze
2025-02-17 18:39:32 +01:00
parent eae09637a1
commit b8d9dee7be
7 changed files with 22 additions and 25 deletions

View File

@@ -891,9 +891,6 @@ public class WebMvcConfigurationSupport implements ApplicationContextAware, Serv
messageConverters.add(new Jaxb2RootElementHttpMessageConverter());
}
if (kotlinSerializationCborPresent) {
messageConverters.add(new KotlinSerializationCborHttpMessageConverter());
}
if (kotlinSerializationProtobufPresent) {
messageConverters.add(new KotlinSerializationProtobufHttpMessageConverter());
}
@@ -929,6 +926,9 @@ public class WebMvcConfigurationSupport implements ApplicationContextAware, Serv
}
messageConverters.add(new MappingJackson2CborHttpMessageConverter(builder.build()));
}
else if (kotlinSerializationCborPresent) {
messageConverters.add(new KotlinSerializationCborHttpMessageConverter());
}
if (jackson2YamlPresent) {
Jackson2ObjectMapperBuilder builder = Jackson2ObjectMapperBuilder.yaml();
if (this.applicationContext != null) {