summaryrefslogtreecommitdiff
path: root/sw-server/src/main/kotlin/org/luxons
diff options
context:
space:
mode:
authorjoffrey-bion <joffrey.bion@gmail.com>2021-02-08 18:36:37 +0100
committerjoffrey-bion <joffrey.bion@gmail.com>2021-02-08 19:54:05 +0100
commit4f315bd4963dd25c2c305a6413c0057425bcdbe7 (patch)
treed08c63480766d9ef356c425d0501b95cd7d80c81 /sw-server/src/main/kotlin/org/luxons
parentCleanup web socket config (diff)
downloadseven-wonders-4f315bd4963dd25c2c305a6413c0057425bcdbe7.tar.gz
seven-wonders-4f315bd4963dd25c2c305a6413c0057425bcdbe7.tar.bz2
seven-wonders-4f315bd4963dd25c2c305a6413c0057425bcdbe7.zip
Add Kotlinx Serialization converter for HTTP traffic
Resolves: https://github.com/joffrey-bion/seven-wonders/issues/87
Diffstat (limited to 'sw-server/src/main/kotlin/org/luxons')
-rw-r--r--sw-server/src/main/kotlin/org/luxons/sevenwonders/server/config/WebMvcConfig.kt15
1 files changed, 15 insertions, 0 deletions
diff --git a/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/config/WebMvcConfig.kt b/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/config/WebMvcConfig.kt
new file mode 100644
index 00000000..a30d9fa4
--- /dev/null
+++ b/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/config/WebMvcConfig.kt
@@ -0,0 +1,15 @@
+package org.luxons.sevenwonders.server.config
+
+import org.springframework.context.annotation.Configuration
+import org.springframework.http.converter.HttpMessageConverter
+import org.springframework.http.converter.json.KotlinSerializationJsonHttpMessageConverter
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport
+
+@Configuration
+class WebMvcConfig : WebMvcConfigurationSupport() {
+
+ override fun configureMessageConverters(converters: MutableList<HttpMessageConverter<*>?>) {
+ converters.add(KotlinSerializationJsonHttpMessageConverter())
+ addDefaultHttpMessageConverters(converters)
+ }
+}
bgstack15