Created
August 25, 2014 15:44
-
-
Save mamund/7d95283027ef30797b49 to your computer and use it in GitHub Desktop.
cross-compatible "embed" for Cj. clients that support the "embedded" extension can ignore the links that are marked "render" : "embedded"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"collection": { | |
"href": "/characters.json", | |
"links" : [ | |
{"rel" : "collection", "href" : "/characters/the_doctor/actors.json", "render" : "embedded"} | |
], | |
"embedded": [ | |
{ | |
"collection": { | |
"href": "/characters/the_doctor/actors.json", | |
"items": [ | |
{ | |
"href": "/doctors/1.json", | |
"data": [ | |
{ | |
"name": "full-name", | |
"value": "William Hartnell" | |
} | |
] | |
}, | |
{ | |
"href": "/doctors/2.json", | |
"data": [ | |
{ | |
"name": "full-name", | |
"value": "Patrick Troughton" | |
} | |
] | |
}, | |
{ | |
"href": "/doctors/3.json", | |
"data": [ | |
{ | |
"name": "full-name", | |
"value": "Jon Pertwee" | |
} | |
] | |
}, | |
{ | |
"href": "/doctors/4.json", | |
"data": [ | |
{ | |
"name": "full-name", | |
"value": "Tom Baker" | |
} | |
] | |
} | |
] | |
} | |
} | |
], | |
"items": [ | |
{ | |
"href": "/characters/the_doctor.json", | |
"links": [ | |
{ | |
"href": "/characters/the_doctor/actors.json", | |
"rel": "actors", | |
"render": "link", | |
"prompt": "Actors" | |
} | |
] | |
} | |
] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment