Field Level:
public class User {
private String name;
private int age;
@JsonIgnore
private int securityCode;
// getters and setters
}
Class Level:
@JsonIgnoreProperties(value = { "securityCode" })
public class User {
private String name;
private int age;
private int securityCode;
}
shareimprove this answer