-
Notifications
You must be signed in to change notification settings - Fork 66
Closed
Description
Relationship could be represented by all resource identities (type and id) in the relationship, or a link, or a combination of data, link and meta (real world example - paging (20 identities, links for more data and some meta with paging info)).
The lib currently supports all these combinations. Which is good. But I want moar 😄 I want to be able to
- include some resources + links + paging meta when resource is main
- keep only link to relationship data when resource is within
included
something like this
{
"data" : {
"type" : "posts",
"id" : "1",
"attributes" : {
"..."
},
"relationships" : {
"comments" : {
"data" : [
{ "type":"comments", "id":"5" }
],
"links" : [
"<paging links for the rest of data here>"
],
"meta" : {
"total-pages": "...",
"page-size": "..."
}
}
}
},
"included" : [{
"type" : "comments",
"id" : "5",
"attributes" : {
"..."
},
"relationships" : {
"replies" : {
"links" : {
"self" : "<only link here, no identities when resource is included>"
}
}
}
}]
}