-
Notifications
You must be signed in to change notification settings - Fork 66
Links in Schema #119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Don't know if this is related, but there is a need to be able to reconstruct links from the parameters that were received from the client. As an example, for pagination the links returned in the document level for pagination may need to include the filtering parameters because the client might be paging over filtered resources. I've got a Don't know what you think about adding to your package the ability to reconstruct links? |
@lindyhopchris that's my solution for links reconstruction. Currently it works with Btw have a look at new limoncello-shot |
I've spotted and fixed lib design issue while working on this. In Schema relationship it was possible to set links which would appear in json api document (example below) {
"data" : {
"type" : "posts",
"id" : "1",
"attributes" : {
"title" : "...",
"body" : "..."
},
"relationships" : {
"comments" : {
"links" : { "boo" : "http://example.com/posts/1/another/link" }
}
}
}
} The problem was that I got rid of it. However for some cases (I believe it's rarely used) it will cause incompatibility. Solution is simple. Instead of 'boo' => new Link('another/link'), link should be defined in 'boo' => new Link($this->getSelfSubUrl($post) . '/another/link'), |
It would be nice to have an ability to create
related
relationship links fromSchema
. It could be used for pagination in relationships. Also the code could be reused fromEncoder
which has similar methodswithRelationshipRelatedLink
andwithRelationshipSelfLink
.The text was updated successfully, but these errors were encountered: