From 4f315bd4963dd25c2c305a6413c0057425bcdbe7 Mon Sep 17 00:00:00 2001 From: joffrey-bion Date: Mon, 8 Feb 2021 18:36:37 +0100 Subject: Add Kotlinx Serialization converter for HTTP traffic Resolves: https://github.com/joffrey-bion/seven-wonders/issues/87 --- .../org/luxons/sevenwonders/server/config/WebMvcConfig.kt | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 sw-server/src/main/kotlin/org/luxons/sevenwonders/server/config/WebMvcConfig.kt (limited to 'sw-server') 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?>) { + converters.add(KotlinSerializationJsonHttpMessageConverter()) + addDefaultHttpMessageConverters(converters) + } +} -- cgit