diff --git a/src/main/kotlin/com/mjucow/eatda/common/config/JacksonConfiguration.kt b/src/main/kotlin/com/mjucow/eatda/common/config/JacksonConfiguration.kt index 30d816f..4e9d9f6 100644 --- a/src/main/kotlin/com/mjucow/eatda/common/config/JacksonConfiguration.kt +++ b/src/main/kotlin/com/mjucow/eatda/common/config/JacksonConfiguration.kt @@ -1,10 +1,12 @@ package com.mjucow.eatda.common.config import com.fasterxml.jackson.databind.DeserializationFeature +import com.fasterxml.jackson.databind.MapperFeature import com.fasterxml.jackson.databind.ObjectMapper import com.fasterxml.jackson.databind.PropertyNamingStrategies import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule -import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper +import com.fasterxml.jackson.module.kotlin.jsonMapper +import com.fasterxml.jackson.module.kotlin.kotlinModule import org.springframework.context.annotation.Bean import org.springframework.context.annotation.Configuration @@ -15,9 +17,12 @@ class JacksonConfiguration { */ @Bean fun objectMapper(): ObjectMapper { - return jacksonObjectMapper() - .registerModule(JavaTimeModule()) - .setPropertyNamingStrategy(PropertyNamingStrategies.LOWER_CAMEL_CASE) - .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false) + return jsonMapper { + addModule(kotlinModule()) + addModule(JavaTimeModule()) + configure(MapperFeature.ACCEPT_CASE_INSENSITIVE_PROPERTIES, true) + configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false) + propertyNamingStrategy(PropertyNamingStrategies.LOWER_CAMEL_CASE) + } } }