-
Notifications
You must be signed in to change notification settings - Fork 890
Clarify relationship formatting #480
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
Conversation
Remove trailing spaces; note that the example is an example.
Nice job @ethanresnick!
Whether we want relationship URLs to return the extra layer provided by link objects is one discussion, but in any case I would like to reuse the concept of linkage in that section, too. Makes no sense to talk about "arrays of objects with Of course, linkage objects might gain further members that are not applicable to create/update operations, but I don't see a problem with just excluding them as they're defined. |
Hey guys, I've updated my original post to describe exactly what this PR now does. I think there's only one thing left to discuss here... Right now, we only allow the user to set relationship values by providing linkage, rather than, e.g. a If we do want to preserve ourselves that option, I think it's as easy as replacing language like "the value MUST be a link object which MUST contain a |
If the resource object being sent contains any relationships in its `"links"` | ||
key, those relationships **MUST** each have a `"linkage"` key that includes the | ||
linkage the new resource is to have. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This phrasing seems awkward. How about keeping it similar to the note below for PATCH:
If a relationship is provided in the
links
section of a resource object, its value MUST be a link object with alinkage
member.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated!
I am totally fine with linkage objects and have no special feelings for relationship tuples, but I have a small reservation. If one compares linkage object with link object, then the latter is what is keyed by Also, I would suggest to extract definition of linkage object into a separate paragraph, not introduce it "on the run":
|
I completely agree with this in principle. I only introduced the definition in line for consistency with how the spec currently introduces many of its smaller definitions (e.g. "link object" and "relationship urls" are both defined in parentheticals). That said, I think the spec would really benefit from having a glossary of terms at the bottom, with every usage of a defined term in the body text linked to its entry in the glossary. If others are onboard with having such a glossary, we could define "linkage object" there.
I'll let others chime in about this, but it doesn't particularly bother me. |
Agreed. Defining the thing as we're explaining to-one relationships doesn't seem right. I would also like to add a tiny definition for it, similar to what I'm trying to do to linkage here: https://github.com/json-api/json-api/pull/498/files#diff-26e38355b69056b0db1c2b1c612241b2R301 Something like
|
Ok! I've updated the PR to include the "linkage object" definition in its own paragraph, along the lines @bintoro suggested. |
👍
Sure, but I'm not crazy about the idea of actually removing definitions from their main context and stashing them only in some appendix. As I've said elsewhere, I'm planning a big PR that would improve the formatting of primary definitions and add a ton of intra-document links. I just haven't been able to submit it because of the current backlog of conflicting PRs. Let's re-evaluate the need for an index/glossary after the intra-doc links are in place. As long as stuff is defined in the body text, I view a full glossary as overkill. At most an alphabetical index linking to the primary definitions might be useful. |
@bintoro sounds good :) |
Thanks @ethanresnick et al - merging now. I believe that this removes the last remaining asymmetry in request / response documents. As a bonus, it tightens up the terminology used in the spec with the definition of "linkage object". |
Great! Thanks @dgeb! |
Update I've edited this description to capture the current state of the PR. It does three things:
links
key with a proper link object.)related
urls.