Skip to content

Clarify intent of links member#1691

Open
jelhan wants to merge 2 commits into
gh-pagesfrom
clarify-links-member-usage
Open

Clarify intent of links member#1691
jelhan wants to merge 2 commits into
gh-pagesfrom
clarify-links-member-usage

Conversation

@jelhan

@jelhan jelhan commented Apr 21, 2023

Copy link
Copy Markdown
Contributor

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.

Open questions:

  • Should we backport this to v1.1?

Closes #1684 #1678

@auvipy auvipy left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks better

@lindyhopchris

Copy link
Copy Markdown
Contributor

@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

jelhan commented Apr 24, 2023

Copy link
Copy Markdown
Contributor Author

@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.

@lindyhopchris

Copy link
Copy Markdown
Contributor

Ah yes, sorry I think I meant profiles or extensions.

Agree with what you've written.

@auvipy auvipy left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO it could be back ported in v1.1

@jelhan jelhan changed the title clarify intent of links member Clarify intent of links member Nov 7, 2024
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.

Clarify intent of links member

3 participants