I\'m trying to use Jackson annotations to re-name some of the json labels produced during serialization. The annotations all compile fine, and when I run, the Jackson seria
Just in case that somebody hits a similiar problem where only @JsonFormat gets ignored:
Consider that in Spring Boot + Java 8 context the processing of LocalDateTime may experience troubles. Instead of following dependency:
compile group: 'com.fasterxml.jackson.datatype', name: 'jackson-datatype-jdk8'
You should use:
compile group: 'com.fasterxml.jackson.datatype', name: 'jackson-datatype-jsr310'
Furthermore, when you create your Jackson ObjectMapper you need to register the implementation which treats LocalDateTime correctly:
json = new ObjectMapper().findAndRegisterModules().writeValueAsString(entity);
new ObjectMapper().findAndRegisterModules().readValue(json, entity.getClass());