diff --git a/application/aam-backend-service/src/main/kotlin/com/aamdigital/aambackendservice/rest/ObjectMapperConfiguration.kt b/application/aam-backend-service/src/main/kotlin/com/aamdigital/aambackendservice/rest/ObjectMapperConfiguration.kt index 37e4ee0..15342d8 100644 --- a/application/aam-backend-service/src/main/kotlin/com/aamdigital/aambackendservice/rest/ObjectMapperConfiguration.kt +++ b/application/aam-backend-service/src/main/kotlin/com/aamdigital/aambackendservice/rest/ObjectMapperConfiguration.kt @@ -2,7 +2,6 @@ package com.aamdigital.aambackendservice.rest import com.fasterxml.jackson.databind.DeserializationFeature import com.fasterxml.jackson.databind.ObjectMapper -import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer import org.springframework.context.annotation.Bean import org.springframework.context.annotation.Configuration import org.springframework.context.annotation.Primary @@ -10,22 +9,15 @@ import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder @Configuration class ObjectMapperConfiguration { - - @Bean - fun jsonCustomizer(): Jackson2ObjectMapperBuilderCustomizer { - return Jackson2ObjectMapperBuilderCustomizer { builder: Jackson2ObjectMapperBuilder -> - builder.featuresToEnable( - DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT, - DeserializationFeature.READ_UNKNOWN_ENUM_VALUES_USING_DEFAULT_VALUE, - ) - } - } - + @Bean @Primary - fun objectMapper(jsonCustomizer: Jackson2ObjectMapperBuilderCustomizer): ObjectMapper { - val builder = Jackson2ObjectMapperBuilder() - jsonCustomizer.customize(builder) - return builder.build() + fun objectMapper(): ObjectMapper { + val mapper = Jackson2ObjectMapperBuilder() + mapper.featuresToEnable( + DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT, + DeserializationFeature.READ_UNKNOWN_ENUM_VALUES_USING_DEFAULT_VALUE + ) + return mapper.build() } } diff --git a/application/aam-backend-service/src/main/resources/application.yaml b/application/aam-backend-service/src/main/resources/application.yaml index d245ac3..1721521 100644 --- a/application/aam-backend-service/src/main/resources/application.yaml +++ b/application/aam-backend-service/src/main/resources/application.yaml @@ -3,6 +3,7 @@ spring: name: aam-backend-service main: banner-mode: off + allow-bean-definition-overriding: true rabbitmq: listener: simple: @@ -20,6 +21,7 @@ spring: multipart: max-file-size: 5MB + server: servlet: context-path: /api diff --git a/application/aam-backend-service/src/test/resources/application-e2e.yaml b/application/aam-backend-service/src/test/resources/application-e2e.yaml index 2b18c1f..6ec8591 100644 --- a/application/aam-backend-service/src/test/resources/application-e2e.yaml +++ b/application/aam-backend-service/src/test/resources/application-e2e.yaml @@ -3,6 +3,7 @@ spring: name: aam-backend-service main: banner-mode: off + allow-bean-definition-overriding: true rabbitmq: listener: simple: