is it possible to make use of the concept of shared references with JSON as output mode? I read this article http://blog.bdoughan.com/2010/10/jaxb-and-shared-references-xmlid-and.html), but changing the @Produces on my JAX-RS to JSON forces an endless loop. Basically i want to reduce an object to it`s id:
public class Foo {
private long id;
private String someText;
private Bar bar;
}
I want this to bind instances of this like so:
{
"id": 1234,
"someText": "lorem",
"bar_id": 9876
}
This is what i want to avoid:
{
"id": 1234,
"someText": "lorem",
"bar": {
"id": 9876,
"anotherText": "ipsum"
}
}