Skip to content
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

consider support for implementation-specific members #1680

Open
jelhan opened this issue Nov 22, 2022 · 2 comments
Open

consider support for implementation-specific members #1680

jelhan opened this issue Nov 22, 2022 · 2 comments

Comments

@jelhan
Copy link
Contributor

jelhan commented Nov 22, 2022

The JSON:API specification forbids implementation-specific members unless they are explicitly allowed:

Unless otherwise noted, objects defined by this specification or any applied extensions MUST NOT contain any additional members. Client and server implementations MUST ignore non-compliant members.

@lode proposed relaxing this statement to allow implementation-specific members of links object. Similar to implementation-specific query parameters we could allow implementation-specific members.

I feel we should discuss this not only with perspective on links object. Similar arguments could be made for implementation-specific members of relationship object, an error object, or even the document itself. I think we should discuss if we want to allow it in general.

Extensions allow adding extension-specific members:

An extension MAY define new members within the document structure defined by this specification.

All use cases for implementation-specific members are already covered by extension. Not requiring content negotiation would be the only advantage of implementation-specific members over members defined by extensions.

I feel requiring extensions and explicit content negotiation is more future proof. Especially as implementation-specific members could cause conflicts if implementations at client- and server-side are not compatible. Content negotiation for extensions prevents these.

On the other hand the same argument could be made regarding query parameters. And we decided to support implementation-specific query parameters.

Opening up this issue to gather feedback both from implementers as well as other editors of the spec.

@lode
Copy link
Contributor

lode commented Nov 23, 2022

Nice to discuss this @jelhan!

I'm not sure about opening up this to everywhere in the document, although I understand your reasoning.

My request for the links object also came from my thought (I admit, my confusion) that the links object had the same free rules as attributes, relationships and meta.

Also, to me it is logical that the links object contains user data (conceptually, not currently in the spec). Where as in the rest of the document I feel that need less, there the document describes structure / meaning.

@lindyhopchris
Copy link
Contributor

yeah agree, I think opening it up for the links object is ok, but relaxing it across the whole document feels potentially dangerous.

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

No branches or pull requests

3 participants