Search code examples
javajsonjerseyjackson

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)?


Solution

  • This should do the job:

    objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
    

    See the APIs for ObjectMapper and DeserializationFeature for more information.