-
-
Notifications
You must be signed in to change notification settings - Fork 18
Closed
Labels
Description
In JSON:API docs the "Fetching Relationships" section says:
The top-level links object MAY contain self and related links, as described above for relationship objects.
And it gives the example response:
{
"links": {
"self": "/articles/1/relationships/author",
"related": "/articles/1/author"
},
"data": {
"type": "people",
"id": "12"
}
}
However, it seems like this library does not allow to generate such document. Here's my attempt:
new JsonApi\DataDocument(
new JsonApi\ResourceIdentifier("people", "12"),
new JsonApi\Link\SelfLink("/articles/1/relationships/author")
);
It gives:
{
"data": {
"type": "people",
"id": "12"
},
"links": {
"self": "/articles/1/relationships/author"
}
}
But the related
link can't be added because DataDocument
constructor does not accept RelatedLink
objects.