You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There has been many confusion about the intent of the links member. People tried using it for links not pointing to other JSON:API documents. Such as related files, related resources represented in different formats or other representations of the same resource in other formats. This PR tries to clarify the intent of links member and pointing readers to alternative ways solving their use case.
@jelhan someone raised a good point in my Laravel JSON:API repo - can links be modified via profiles? Assuming that's not the intent, based on what's drafted in this PR.
FYI I'm in support of this clarification - I've always found it confusing as to whether you're allowed to customise the links member. So it's good to get this clarified.
@jelhan someone raised a good point in my Laravel JSON:API repo - can links be modified via profiles? Assuming that's not the intent, based on what's drafted in this PR.
No. Profiles can only define document members and processing rules that are reserved for implementors. The links object is not reserved for implementors. The JSON:API specification defines an infinite set of members, which are allowed within the links object depending on the context.
An extension can define additional members for the links object and define processing rules for them. As every extension-defined member, such a member must be namespaced. This change would not limit an extension to define additional members for the links object. But it would clarify, which extension-specific members should be added to the links object and for which use cases an extension should define another document member.
The reason will be displayed to describe this comment to others. Learn more.
IMHO it could be back ported in v1.1
jelhan
changed the title
clarify intent of links member
Clarify intent of links member
Nov 7, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There has been many confusion about the intent of the links member. People tried using it for links not pointing to other JSON:API documents. Such as related files, related resources represented in different formats or other representations of the same resource in other formats. This PR tries to clarify the intent of
linksmember and pointing readers to alternative ways solving their use case.Open questions:
Closes #1684 #1678