In Spring Boot 1.2.3, we can configure Jackson ObjectMapper through the properties file. But I did not find an attribute that could set Jackson to ignore a null value when serializing the Object to JSON string.
spring.jackson.deserialization.*= # see Jackson DeserializationFeature spring.jackson.generator.*= # see Jackson JsonGenerator.Feature spring.jackson.mapper.*= # see Jackson MapperFeature spring.jackson.parser.*= # see Jackson JsonParser.Feature spring.jackson.serialization.*=
I want to archive the same code as
ObjectMapper mapper = new ObjectMapper(); mapper.setSerializationInclusion(Include.NON_NULL);
spring jackson spring-boot
crisli
source share