-
Notifications
You must be signed in to change notification settings - Fork 889
spec is agnostic about keys starting with @ in object used as attribue values #1631
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
Conversation
I don't think this extra clarification is necessary given this statement in the same section:
|
I just closed #1367 with the comment:
I think that explicitly focusing on the contents of attribute values doesn't really help clarify this central point. But I am open to broader clarifications. |
It's see your point. Treating @-Members as implementation specific resolves my confusion. I think it also addresses the question raised by @freddrake in #1584. However I'm not eure if current specification expresses that intent well.
This statement does not express that it's up to the implementation how to handle @-Members. Instead it seems to forbid depending on them at all. It includes an example to clarify what ignore means:
That example confuses me even more to be honest. The term "JSON:API data" does not seem to be defined. Is the data represented as a JSON:API resource part of that JSON:API data? Also what is meant by a "JSON:API processor" does not seem to be defined well. What part of processing the request/response and the data encoded in it is done by "JSON:API processor"? Which part is done by domain-specific processors? This leads to a couple of specific questions:
I think you are right. It's not that much about adding a special note for objects used as attribute values. Maybe it's more about clarifying that paragraph. |
In particular, "JSON:API processor" is not defined in the specification. I suspect the intent is that the parts of an application that deal with JSON:API structures specifically should ignore the @-members, but other aspects of the application (JSON-LD processors?) can handle them as they see fit. This statement that JSON:API processors must completely ignore @-members needs to be rewritten to avoid the undefined term, either by defining the term clearly somewhere, or by stating @-members are allowed in JSON:API-defined structures, but have no impact on JSON:API-defined interpretation of the structures. |
@jelhan @freddrake I agree that there is a lot to be improved with this section about @ members. The wording around "JSON:API processors" is unclear. The intention is basically "servers and clients interpreting this specification". Now of course, these same servers and clients should interpret these @ members in another context, such as through JSON-LD.
These questions are not the domain of this specification, but rather the specific implementation (which may provide instructions via a profile). JSON:API can't answer these questions any more than it can provide instructions about interpreting I will attempt to clarify this whole section in a separate PR. |
Clarify that JSON:API specification does not put any constraints on attribute values. Especially it leaves it up to implementation how to treat keys starting with
@
in objects used as attribute values.Assuming the following JSON:API document, an implementation would be allowed to ignore or process the
@comment
key.I see this as a clarification not as a breaking change. However without that note it was not fully clear how to handle that case. This issue was raised in #1584.
I hope that this clarification together with dropping any other constraints on attribute values (#1630) is enough to avoid further confusion.
Closes #1584