-
Notifications
You must be signed in to change notification settings - Fork 890
Associate "relationship object" with everything else #946
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -240,13 +240,14 @@ alongside other information to be represented in a resource object, these keys | |
#### <a href="#document-resource-object-relationships" id="document-resource-object-relationships" class="headerlink"></a> Relationships | ||
|
||
The value of the `relationships` key **MUST** be an object (a "relationships | ||
object"). Members of the relationships object ("relationships") represent | ||
references from the [resource object][resource objects] in which it's defined to other resource | ||
objects. | ||
object"). Members of the relationships object represent "relationships", i.e., | ||
references from the [resource object][resource objects] in which they are defined | ||
to other resource objects. | ||
|
||
Relationships may be to-one or to-many. | ||
|
||
A "relationship object" **MUST** contain at least one of the following: | ||
Each relationship **MUST** be represented by an object (a "relationship object") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So, if we're being nitpicky/precise, my mental model has always been that each relationship has two parts: its name and its contents (the linkage, not the related). So maybe we should say "Each relationship's contents....", or use the prior wording, or make the name + contents division more explicit? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, "each relationship's contents" would seem to make sense. The prior wording didn't associate relationship objects with any of the other definitions, which prompted the patch in the first place. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. One potential problem with "each relationship's contents" is that the relationship object also includes links, and I'm not sure if those are part of the contents??? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. One way to sidestep the entire issue is to specify that each member of a relationships object must be a relationship object. It's already mentioned that members of a relationships object represent relationships, so a relationship object's purpose could be defined in terms of either. |
||
containing at least one of the following: | ||
|
||
* `links`: a [links object][links] containing at least one of the following: | ||
* `self`: a link for the relationship itself (a "relationship link"). This | ||
|
@@ -268,7 +269,7 @@ A relationship object that represents a to-many relationship **MAY** also contai | |
|
||
#### <a href="#document-resource-object-related-resource-links" id="document-resource-object-related-resource-links" class="headerlink"></a> Related Resource Links | ||
|
||
A "related resource link" provides access to [resource objects] [linked][links] | ||
A "related resource link" provides access to [resource objects][] [linked][links] | ||
in a [relationship][relationships]. When fetched, the related resource object(s) | ||
are returned as the response's primary data. | ||
|
||
|
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.
While we're here:
...references from the resource objects in which they are defined...
Also, this needs to be updated here too:
https://github.com/json-api/json-api/blob/gh-pages/_format/1.1/index.md
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.
I wondered about that too. The "it" refers to the relationships object, which is singular. But yes, I agree that it would sound more correct if we referred to the relationships themselves.