What is the difference between a property with @JsonIgnore and one with no annotation? What is the difference between a property with @JsonIgnore and one with no annotation? json json

What is the difference between a property with @JsonIgnore and one with no annotation?


The @JsonIgnore annotated properties/methods will not be serialized/deserialized by Jackson. While the not annotated will be.

The problem here is that Jackson usually looks for the getters, and you didn't specified any getters. So that's why it's only serialized the @JsonProperty annotated property.

If you implement the 3 getters for the 3 properties, your json will look like this:

{  "id":"ID",  "noAnnotation":"NO_ANNOTATION"}