I want to add @JsonIgnore of Jackson On the Password property of User domain such that I must be able to send the Json With password and It saves my data in Database but in response I don't want to show the password.
How can I acheive this please help me.
I tried to use it at the Domain level of the User where the properties are defined but it Totally Ignore the property in the getter and setter methods.
I have tried this
private String password;
@JsonIgnore
public String getPassword() {
return this.password;
}
You can do it this way too if you don't want to manually create the getters/setters (eg. when using lombok's @Data)
@JsonProperty(access = Access.WRITE_ONLY)
private String password;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With