-
Notifications
You must be signed in to change notification settings - Fork 76
Open
Description
Hi! I am quite new to jsonapi so forgive me if I got something wrong (or asking for something wrong) but looking at the spec examples I see this:
{
"data": [{
"type": "comments",
"id": "1",
"attributes": {
"text": "HATEOS are the thing!"
},
"links": {
"self": "/comments/1"
},
"relationships": {
"author": {
"links": {
"self": "/comments/1/relationships/author",
"related": "/comments/1/author"
}
},
"articles": {
"links": {
"self": "/comments/1/relationships/articles",
"related": "/comments/1/articles"
}
}
}
}],
"links": {
"self": "/comments"
}
}
Few things I noticed when tried to implement similar relationships:
relatedlink generator unaware of the parent so this lib would generate just/articlesinstead of/comments/1/articles.url_foron the child view gets just the collection and the conn. But anyway I think it makes more sense to do it on the parent view level similar tourl_for_relbut forrelatedlinks.- There currently no way to generate links without preloading whole association? Looking at the code it seems to skip whole thing if association not preloaded. With this spec example in mind - wouldn't it make more sense to just omit
datasection then but still generate the links?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels