Skip to content

top-level links object is related to the document in some cases#1753

Merged
dgeb merged 2 commits intogh-pagesfrom
clarify-top-level-links-relation-to-document
Aug 15, 2024
Merged

top-level links object is related to the document in some cases#1753
dgeb merged 2 commits intogh-pagesfrom
clarify-top-level-links-relation-to-document

Conversation

@jelhan
Copy link
Copy Markdown
Contributor

@jelhan jelhan commented Aug 15, 2024

The top-level links object is related to the whole document in 2 out of 4 cases: self and describedby links are related to the document. Not only to its primary data. Even more they are useful even if a document does not have primary data.

A document could not have primary data if 1) being an error response, 2) a response to a successful mutation, and 3) having an extension applied. Top-level links, especially self, are commonly used in those cases. And intended to be used.

This PR improves the wording of the specification to avoid confusion. It was motivated by this thread in the discussion forum: https://jsonapi.org/format/

TODO:

  • Backport to v1.1

jelhan added 2 commits August 15, 2024 13:54
The top-level `links` object is related to the whole document in 2 out of 4 cases: `self` and `describedby` links are related to the document. Not only to its primary data. Even more they are useful even if a document does not have primary data.

A document could not have primary data if 1) being an error response, 2) a response to a successful mutation, and 3) having an extension applied. Top-level links, especially `self`, are commonly used in those cases. And intended to be used.

This PR improves the wording of the specification to avoid confusion. It was motivated by this thread in the discussion forum: https://jsonapi.org/format/
@dgeb dgeb merged commit 77bc3cb into gh-pages Aug 15, 2024
@dgeb dgeb deleted the clarify-top-level-links-relation-to-document branch August 15, 2024 20:28
@dgeb
Copy link
Copy Markdown
Member

dgeb commented Aug 15, 2024

Looks like a solid correction. Thanks!

@Panman82
Copy link
Copy Markdown

Is this something that would be back-ported v1.1? Being more of a clarifying change than an actual change to the spec, seems appropriate. 🤷‍♂️

jelhan added a commit that referenced this pull request Aug 22, 2024
The clarification was merged to v1.2 (upcoming) in #1753. This backports the changes to v1.1.
@jelhan
Copy link
Copy Markdown
Contributor Author

jelhan commented Aug 22, 2024

Is this something that would be back-ported v1.1? Being more of a clarifying change than an actual change to the spec, seems appropriate. 🤷‍♂️

Thanks for the reminder. I created #1754 to do so.

dgeb pushed a commit that referenced this pull request Sep 17, 2024
The clarification was merged to v1.2 (upcoming) in #1753. This backports the changes to v1.1.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants