Derek Ellis
07/19/2021, 5:18 PM@Serializable
and primitive collections before forwarding everything to Jackson. I've run into an issue where I want to serialize a List
(I believe the implementation is just a regular ArrayList
) of a serializable class that has some @SerialName
annotations on the properties, but it looks like it's being forwarded to Jackson and the @SerialName
names are being ignored.
Is this functionality supported, and how would I update the configuration of my WebFlux project to use kotlinx serialization for this?Yevgeni Liskovich
07/20/2021, 10:19 AM@Configuration
class KotlinxSerializationConfig : WebFluxConfigurer {
override fun extendMessageConverters(converters: MutableList<HttpMessageConverter<*>>) {
// here you can check converters list
}
}
Sourabh Rawat
07/22/2021, 10:43 PMDerek Ellis
07/23/2021, 8:36 PMDerek Ellis
07/23/2021, 8:36 PMRichard Gomez
07/31/2021, 11:11 PMspring-boot-starter-json
.
Gradle
implementation("org.springframework.boot:spring-boot-starter-web") {
exclude(module = "spring-boot-starter-json")
}
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.0.0")
Maven
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-webflux</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-json</artifactId>
</exclusion>
</exclusions>
</dependency>
Richard Gomez
07/31/2021, 11:22 PM@RestController
annotated methods but not the router DSL? The latter throws an exception (posted in thread).Richard Gomez
07/31/2021, 11:23 PMSourabh Rawat
08/01/2021, 12:16 PMRichard Gomez
08/01/2021, 4:42 PM@Serializable
in the actual code. The strange part is that it's getting serialized by kotlinx.serialization
when using @RestControler
, but not when using the router DSL.