All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.github.lyc8503.spring.starter.incantation.config.JacksonMapperConfig Maven / Gradle / Ivy

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