From 8ccccfe4e44ff69b3a68a40406a472cd3567838c Mon Sep 17 00:00:00 2001 From: joffrey-bion Date: Mon, 8 Feb 2021 20:56:34 +0100 Subject: Add Kotlinx Serialization converter for HTTP traffic (correctly) Resolves: https://github.com/joffrey-bion/seven-wonders/issues/87 --- .../kotlin/org/luxons/sevenwonders/server/SevenWonders.kt | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'sw-server/src/main/kotlin/org') diff --git a/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/SevenWonders.kt b/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/SevenWonders.kt index 8496fafd..2485a28f 100644 --- a/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/SevenWonders.kt +++ b/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/SevenWonders.kt @@ -1,10 +1,19 @@ package org.luxons.sevenwonders.server import org.springframework.boot.autoconfigure.SpringBootApplication +import org.springframework.boot.autoconfigure.http.HttpMessageConverters import org.springframework.boot.runApplication +import org.springframework.context.annotation.Bean +import org.springframework.http.converter.json.KotlinSerializationJsonHttpMessageConverter @SpringBootApplication -class SevenWonders +class SevenWonders { + + @Bean + fun additionalConverters(): HttpMessageConverters? { + return HttpMessageConverters(KotlinSerializationJsonHttpMessageConverter()) + } +} fun main(args: Array) { runApplication(*args) -- cgit