I have an entity class with a password field:
class User {
private String password;
//setter, getter..
}
I want this field to be skipped during serialization. But it should still be able to deserialize. This is needed, so that the client can send me a new password, but is not able to read the current one.
How do I accomplish this with Jackson?
You can mark it as @JsonIgnore
.
With 1.9, you can add @JsonIgnore
for getter, @JsonProperty
for setter, to make it deserialize but not serialize.