Request to improve KotlinSerializationJsonHttpMessageConverter logic in RestTemplate #29008
Labels
in: web
Issues in web modules (web, webmvc, webflux, websocket)
theme: kotlin
An issue related to Kotlin support
type: bug
A general bug
Milestone
Affects: 5.3.22 (below 5.3.22)
Hello,
I was using the Kotlinx.serialization module well because of Spring registered
KotlinSerializationJsonHttpMessageConverter
throughWebMvcConfigurationSupport.addDefaultHttpMessageConverters
However, even though I added the Kotlinx.Serialization module, it was not available in RestTemplate.
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.4.0")
After analyzing why, only Jackson, which is the default serialization, was registered due to the
if-else if
logic as shown below, so Kotlinx.Serialization could not be used.I can temporarily solve it like the configuration below.
I solved it, but I think it is very inconvenient to have to add KotlinSerializationJsonHttpMessageConverter to use kotlinx.serialization.
I as with WebMvcConfigurationSupport.addDefaultHttpMessageConverters, when the Kotlinx.Serialization module does not exist, it is hoped that Jackson2 Serialization will be used by default.
I'm going to post a PR on this issue.
please check.
thank you
The text was updated successfully, but these errors were encountered: