io.github.lyc8503.spring.starter.incantation.config.JacksonMapperConfig Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of opening-incantation-spring-boot-starter Show documentation
Show all versions of opening-incantation-spring-boot-starter Show documentation
Some magic incantation for Spring Boot
The newest version!
package io.github.lyc8503.spring.starter.incantation.config;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.PropertyNamingStrategies;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder;
@Configuration
public class JacksonMapperConfig {
@Bean
Jackson2ObjectMapperBuilder objectMapperBuilder() {
Jackson2ObjectMapperBuilder builder = new Jackson2ObjectMapperBuilder();
builder.serializationInclusion(JsonInclude.Include.NON_NULL);
builder.propertyNamingStrategy(PropertyNamingStrategies.SNAKE_CASE);
return builder;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy