Skip to content

Instantly share code, notes, and snippets.

@mamund
Last active December 15, 2015 14:08
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mamund/5271749 to your computer and use it in GitHub Desktop.
Save mamund/5271749 to your computer and use it in GitHub Desktop.
heterogeneous collection in a single Cj response
{
"collection" : {
"href" : "...",
"items" : [
{
"href" : "/orders/1",
"data" : [...],
"links" : [
{"rel" : "type", "href" : "http://example.org/rels#order"}
]
},
{
"href" : "/orders/1/line/0",
"data" : [...],
"links" : [
{"rel" : "type", "href" : "http://example.org/rels#line"},
{"rel" : "collection", "href" : "/orders/1"}
]
},
{
"href" : "/orders/1/line/1",
"data" : [...],
"links" : [
{"rel" : "type", "href" : "http://example.org/rels#line"},
{"rel" : "collection", "href" : "/orders/1"}
]
},
{
"href" : "/orders/1/line/2",
"data" : [...],
"links" : [
{"rel" : "type", "href" : "http://example.org/rels#line"},
{"rel" : "collection", "href" : "/orders/1"}
]
}
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment