-
-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
While testing localhost:3000/articles/1?include=author.votes
The included author in that same response, should also have the votes relationshipObjects in its "relationships" property:
{
"data": {
"id": 1,
"type": "article",
"attributes": {
"body": "this is test 1",
"voteCount": 2
},
"relationships": {
"author": {
"data": {
"id": 1,
"type": "user"
}
},
"votes": {
"data": [
{
"id": 1,
"type": "vote"
},
{
"id": 2,
"type": "vote"
}
]
}
}
},
"included": [
{
"id": 1,
"type": "user",
"attributes": {
"username": "me",
"email": "me@me.com",
"createdAt": null,
"updatedAt": null
},
"relationships": {
// HERE THE VOTES RELATIONSHIP OBJECTS SHOULD ALSO APPEAR!
// JUST LIKE IN THE ARTICLE (id & type)
}
},
{
"id": 1,
"type": "vote",
"attributes": { ... },
"relationships": {
"user": {
"data": {
"id": 1,
"type": "user"
}
},
"article": {
"data": {
"id": 1,
"type": "article"
}
}
}
},
{
"id": 2,
"type": "vote",
"attributes": {... },
"relationships": {
"user": {
"data": {
"id": 1,
"type": "user"
}
},
"article": {
"data": {
"id": 1,
"type": "article"
}
}
}
}
]
}Originally posted by @spersico in #227 (comment)
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
⌛ Waiting