my goal is to configure the objectMapper in the way that it only serialises element which are annotated with @JsonProperty.
objectMapper
@JsonProperty
In order to do
In Spring Boot 2.2.x you need to configure it like this:
2.2.x
@Bean public ObjectMapper objectMapper(Jackson2ObjectMapperBuilder builder) { return builder.build() }
Kotlin:
@Bean fun objectMapper(builder: Jackson2ObjectMapperBuilder) = builder.build()