Jackson provides an annotation that can be used on class level (JsonIgnoreProperties).
Add the following to the top of your class (not to individual methods):
@JsonIgnoreProperties(ignoreUnknown = true)
public class Foo {
...
}
Depending on the jackson version you are using you would have to use a different import in the current version it is:
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
in older versions it has been:
import org.codehaus.jackson.annotate.JsonIgnoreProperties;
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…