Is it possible to assign the jsog's @id value to an member variable in a POJO class?
For example I have a json:
"user": {
"@id": "1",
"name": "John Doe"
}
And Java class
@JsonIdentityInfo(generator=JSOGGenerator.class)
public class User {
private String id; // this is null
private String name;
// getters and setters ...
}
I tried @JsonProperty("@id")
but it my id
still is null
. Does anyone have an experience with this? I don't want to add another id
field into my JSON as it makes it ugly.
Thank you in advance.