-
Notifications
You must be signed in to change notification settings - Fork 893
Clarify full linkage. #1035
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
Clarify full linkage. #1035
Conversation
Good catch. The present wording does seem to contain a loophole. The proposed normative text has a bug: the origin reference need not be a resource object (think primary data from a relationship URL). The simple change you made to the trailing note was a really good one. It now explains the whole thing so well that if the normative part can't achieve the same level of clarity, I would just promote the note to normative and build on that. Suggestion: Compound documents require "full linkage", meaning that every included resource MUST be referenced from the primary data either directly or via intermediate included resources. |
You are right, I didn't take into consideration the case of fetching relationships directly and including its data in I'm not satisfied with my current proposed wording because it feels quite redundant (this is because I chose to take the transitive closure of neighbors of primary resource identifiers, and because we somehow need to identify resource objects and resource identifier objects). How about the following:
Edit: concerning your suggestion, I find it great, as it conveys the intuition of what's meant to someone familiar with the spec, but I'm afraid it may be too vague for newcomers (though I'm aware being too formal won't help much either). |
Formally, what we are trying to say is:
|
Any wording suggestion on this one? |
I'd love to see this clarified too, I know that "full linkage" has been a point of discussion multiple times while working on https://www.drupal.org/project/jsonapi. |
This clarification seems to be highly needed. I think the proposed change points into the correct direction. But as pointed out by @bintoro it does not work if the primary data is resource identifier objects. I tried to improve the proposal to also consider that case.
|
@beauby Are you still motivated to push this forward? If not, I can fully understand after more than four years. I could take over in that case and provide a new pull request with my proposal based on your original one. |
Hey @jelhan, feel free to take over and I'll close this PR once yours is up! |
The current definition of full linkage formally allows full linkage to happen only between resources within
included
, whereas the intention is (I believe) to ensure every resource object withinincluded
is identified by at least one resource identifier object within the transitive closure of primary data by its relationships. Any input on better wording warmly welcome. (:TL;DR: Currently the spec could be interpreted to allow the following payload: