fix: contextの配列にオブジェクトが混ざった際にパースできるように

This commit is contained in:
usbharu 2023-03-30 19:22:44 +09:00
parent e5922cd5f9
commit 707c973c00
Signed by: usbharu
GPG Key ID: 6556747BF94EEBC8
1 changed files with 2 additions and 1 deletions

View File

@ -1,6 +1,7 @@
package dev.usbharu.hideout
import com.fasterxml.jackson.annotation.JsonInclude
import com.fasterxml.jackson.core.JsonGenerator
import com.fasterxml.jackson.databind.DeserializationFeature
import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper
import dev.usbharu.hideout.config.Config
@ -38,7 +39,7 @@ fun Application.module() {
url = environment.config.propertyOrNull("hideout.url")?.getString()
?: environment.config.property("hideout.hostname").getString(),
objectMapper = jacksonObjectMapper().enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
.setSerializationInclusion(JsonInclude.Include.NON_EMPTY)
.setSerializationInclusion(JsonInclude.Include.NON_EMPTY).configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES,false)
)
}
single<HttpClient> { HttpClient(CIO) }