Skip to content
Advertisement

Is there a global Jackson setting for @JsonIgnoreProperties(unknown=true)?

Is there a global Jackson setting/configuration so that I do not have to annotate every class with @JsonIgnoreProperties(unknown=true)?

Advertisement

Answer

This should do the job:

objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);

See the APIs for ObjectMapper and DeserializationFeature for more information.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement