In my Spring Boot/Kotlin project, I am trying to get the JSON converter to ignore null values in my rest controller responses.
I've tried setting the following in my application.yml:
spring:
jackson:
default-property-inclusion: non_null
I've also tried providing a @Bean
of type Jackson2ObjectMapperBuilder
and @ObjectMapper
configured with .serializationInclusion(JsonInclude.Include.NON_NULL)
but it's still serializing all the null properties.
Using Spring Boot 2.3.0, Kotlin 1.3.72, AdoptOpenJDK 13