diff --git a/backend/src/main/java/io/papermc/hangar/config/jackson/JacksonConfig.java b/backend/src/main/java/io/papermc/hangar/config/jackson/JacksonConfig.java new file mode 100644 index 00000000..bf5811d0 --- /dev/null +++ b/backend/src/main/java/io/papermc/hangar/config/jackson/JacksonConfig.java @@ -0,0 +1,21 @@ +package io.papermc.hangar.config.jackson; + +import com.fasterxml.jackson.databind.MapperFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Primary; +import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder; + +@Configuration +public class JacksonConfig { + + @Bean + @Primary + ObjectMapper jacksonObjectMapper(final Jackson2ObjectMapperBuilder builder) { + return builder + .createXmlMapper(false) + .featuresToEnable(MapperFeature.ACCEPT_CASE_INSENSITIVE_ENUMS) + .build(); + } +}