Sunday, July 15, 2012

Jackson: Ignore Unrecognized Fields

By default, Jackson will throw an exception when a field in the JSON is not declared as a member variable in the class it is mapped to. To ignore these fields, add the following annotation to the POJO class:
@JsonIgnoreProperties(ignoreUnknown=true)

No comments:

Post a Comment