jackson-databind icon indicating copy to clipboard operation
jackson-databind copied to clipboard

@JsonIncludeProperties does not work together with @JsonIdentityInfo

Open chtinnes opened this issue 4 years ago • 0 comments

In version 2.12.3, using @JsonIncludeProperties in combination with @JsonIdentityInfo at the nested class returns only the identity field instead of the selected properties that should be included.

@JsonIdentityInfo(generator= ObjectIdGenerators.PropertyGenerator.class, property="deviceId")
public class Device{
    private UUID deviceId;

    private String name;
}

public class Config {
    @JsonIncludeProperties({"name"})
    private Device device;
}

returns, for example,

{"device": "b16c3254-ee2e-11e7-8c3f-fa085a82f01f"}

chtinnes avatar Jun 02 '21 14:06 chtinnes