Details
-
Improvement
-
Status: Closed
-
Normal
-
Resolution: Fixed
-
None
-
None
-
None
Description
When a document bean has a reference to another document bean, the referenced beans is always serialized as nested property object of the first bean by Jackson by default.
So, for example, if there's a reference chain like A -> B -> C documents, the content section in the json api output looks like the following:
{ // SNIP "content": { "u001": { // content of A "refOfB": { // content of B "refOfC": { // content of C } } } } }
See the following screenshot and example json output as-is:
international_atomic_time.html.json
I think it would much nicer and more intuitive if it should always look like this instead:
{ // SNIP "content": { "u001": { // content of A "refOfB": { "$ref": "/content/u002" } }, "u002": { // content of B "refOfC": { "$ref": "/content/u003" } }, "u003": { // content of C } } }
Not sure how it would be difficult to change the behavior with Jackson though yet...