mirror of
https://github.com/HangarMC/Hangar.git
synced 2024-11-21 01:21:54 +08:00
fix: make enums case-insensitive so that the hangar publish plugin can be used with groovy
This commit is contained in:
parent
0752ec5e05
commit
9698115aa9
@ -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();
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user