Add kotlinx.serialization JSON support to Spring MVC
Closes gh-21188 Co-authored-by: Sebastien Deleuze <sdeleuze@vmware.com>
This commit is contained in:
committed by
Sébastien Deleuze
parent
b8c12a3aa1
commit
cd6085a310
@@ -383,10 +383,24 @@ class KotlinScriptConfiguration {
|
||||
}
|
||||
----
|
||||
|
||||
|
||||
See the https://github.com/sdeleuze/kotlin-script-templating[kotlin-script-templating] example
|
||||
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.
|
||||
|
||||
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
|
||||
<<web#mvc-config-message-converters, configure message converters>> to remove `MappingJackson2HttpMessageConverter` and add
|
||||
`KotlinSerializationJsonHttpMessageConverter`.
|
||||
|
||||
|
||||
== Coroutines
|
||||
|
||||
Kotlin https://kotlinlang.org/docs/reference/coroutines-overview.html[Coroutines] are Kotlin
|
||||
|
||||
Reference in New Issue
Block a user