Skip to content
Advertisement

Tag: jackson-annotations

Different @JsonProperty config for READ and WRITE on same field?

I have a class (which cannot be modified) like When deserializing I get data like: As I cannot modify the Standing class I have a mix-in like: As the received json does not have positionNumber and positionText fields I use the @JsonPropery annotations. With Access.READ_ONLY I simply ignore the positionNumber field. And with @JsonProperty(value = “position”, access = JsonProperty.Access.WRITE_ONLY) on

Advertisement