Closed Denis-D-M closed 1 year ago
try adding @JsonIgnore
to getPrimary()
@Denis-D-M It is a feature, not bug: neither initial names nor override match, so they are considered to represent different property (properties are not required to relate to both Field and Method etc).
But depending on what exactly you are trying to achieve (as in, whether to serialize value of Field directly, or via getter) you need to change annotations. Either, like @pjfanning suggested, add @JsonIgnore
or, maybe more likely, more @JsonProperty
to get method (in which case private field is just ignored).
Hey guys, sorry to bother, but I came across with this strange behavior:
Code:
Result: