-
Notifications
You must be signed in to change notification settings - Fork 23
Closed
Labels
Milestone
Description
As far as I can tell, the library doesn't support root-level link templates, e.g.
{
"links": {
"posts.comments": {
"href": "/posts/{posts.id}/comments",
"type": "user"
}
},
"posts": [
{
"id": "100",
"name": "Post 1"
}, {
"id": "101",
"name": "Post 2"
}
]
}
Instead, link templates are included in each resource object, and the values are interpolated in, like so:
{
"posts": [
{
"id": "100",
"name": "Post 1",
"links": {
"comments": {
"href": "/posts/100/comments"
}
}
}, {
"id": "101",
"name": "Post 2",
"links": {
"comments": {
"href": "/posts/101/comments"
}
}
}
]
}
While there are probably use-cases for the latter, the former has the potential to save considerable amounts of bandwidth and processing time for large result-sets.