If you're using Spring Boot 1.3, you can configure serialisation inclusion via application.properties:


Following changes in Jackson 2.7, Spring Boot 1.4 uses a property named spring.jackson.default-property-inclusion instead:


See "Customize the Jackson ObjectMapper" section in Spring Boot documentation.

If you're using an earlier version of Spring Boot, the easiest way to configure serialisation inclusion in Spring Boot is to declare your own, appropriately configured Jackson2ObjectMapperBuilder bean. For example:

public Jackson2ObjectMapperBuilder objectMapperBuilder() {
    Jackson2ObjectMapperBuilder builder = new Jackson2ObjectMapperBuilder();
    return builder;