Add kotlinx.serialization JSON support to Spring WebFlux
Flow decoding is not supported yet since it depends on kotlin/kotlinx.serialization#1073, but it will be enabled when this issue will be fixed. Closes gh-25771
This commit is contained in:
@@ -389,14 +389,14 @@ project for more details.
|
||||
=== Kotlin multiplatform serialization
|
||||
|
||||
As of Spring Framework 5.3, https://github.com/Kotlin/kotlinx.serialization[Kotlin multiplatform serialization] is
|
||||
supported in Spring MVC. The builtin support currently only targets JSON format.
|
||||
supported in Spring MVC and Spring WebFlux. The builtin support currently only targets JSON format.
|
||||
|
||||
To enable it, follow https://github.com/Kotlin/kotlinx.serialization#setup[those instructions] and make sure neither
|
||||
Jackson, GSON or JSONB are in the classpath.
|
||||
|
||||
NOTE: For a typical Spring Boot web application, that can be achieved by excluding `spring-boot-starter-json` dependency.
|
||||
|
||||
If you need Jackson, GSON or JSONB for other purposes, you can keep them on the classpath and
|
||||
In Spring MVC, if you need Jackson, GSON or JSONB for other purposes, you can keep them on the classpath and
|
||||
<<web#mvc-config-message-converters, configure message converters>> to remove `MappingJackson2HttpMessageConverter` and add
|
||||
`KotlinSerializationJsonHttpMessageConverter`.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user