Closed sergeol closed 4 years ago
Correct, field must be named something
to match methods isSomething()
or getSomething()
(and setSomething())
, otherwise it will not match (field is considered a property, getter/setter pair another one).
Field names are ALWAYS assumed to just match property name: if not, add @JsonProperty("something") (or,
@JsonIgnore`) on field.
In future, please use mailing list:
https://groups.google.com/forum/#!forum/jackson-user
or gitter chat
https://gitter.im/FasterXML/jackson-databind
for usage questions.
Sorry if I chose the wrong project, I'm not sure to understand what is where ...
Version information : I cannot find any fasterxml information in my pom, although I have some jackson libraries in maven dependancies (included in a package?):
I develop a spring boot API, using the @JsonIgnore annotation to hide some fields in the API response;
I tried to ignore a boolean field named 'isSomething', but as the field is modified to 'something' in the response (I'm not sure what does that either), and @JsonIgnore is set on a field named 'isSomething', the field is not ignored => I get the boolean 'something' in my response.
So I changed my boolean name from 'isSomething' to 'something', and the @JsonIgnore worked.
Hope this helps.