With @JsonIdentityInfo we can do things like :
{
"@id" : 1,
"value" : 13,
"next" : {
"@id" : 2,
"value" : 42,
"next" : 1
}
}
The reference is a primitive type. It it possible to have the reference be serialized as an object ? example :
{
"@id" : 1,
"value" : 13,
"next" : {
"@id" : 2,
"value" : 42,
"next" : {"$ref":1}
}
}
EDIT
Usefull links