-
Notifications
You must be signed in to change notification settings - Fork 890
Remove relationship url option #453
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
Remove relationship url option #453
Conversation
I support this. Another argument in favor: there are several ways to specify relationships, why is one of them effectively preferred in a sense that the spec provides a shortcut for it? Removing the shortcut will also make top-level Suggestion in #478 (actually inspired by this PR) can be viewed as a further improvement to it in terms of "readability at the first glance". @lsylvester, BTW, the paragraph containing "The URL can therefore be specified directly as the attribute value" and the example which it describes should also be updated as part of this PR. |
…\n\nIt can be defiend by a link option with a related url to achieve the same effect
35de1d5
to
b4d640d
Compare
@hhware Thanks. I have updated to remove the comments from the example as it added no further value of the author example. |
+1! I was also going to suggest this. It's a further move toward consistency over concision. Not only are the responses containing links now more uniform but, pending #482, there'll be more uniformity between link input and output formats as well! Finally, I agree with @hhware that it seems odd to privilege the hypermedia format here when it sits on equal footing with linkage everywhere else in the spec. I'm curious about what @dgeb thinks of this, though, since he did a pretty thorough revision of the spec and this exception survived. |
I support this change on the grounds that providing a related resource URL as a direct attribute value causes a mismatch between the JSON structure and the recommended URL structure:
I think it's a good rule that if there's a URL path that corresponds to a member in the JSON representation, the two should have similar semantics. |
Something to think about is if the definition of related resource URL is just too long to sit comfortably in the middle of the bulleted list. Here's an alternative version where both remaining definitions (relationship URL and related resource URL) are moved to their own paragraphs, just like linkage: |
Another consideration I just realized: if we remove the url-only format, then the format for the resource-level
Maybe that's not awful, but it is worth noting. |
@ethanresnick |
@bintoro I guess...but do we really want implementations to have to have one rule for parsing the |
Hmm. My first impression is that this is totally a non-issue, but let's see what others have to say. Think of it this way: a If we really want consistency among links object members, then let's do what I've been saying for a long time and place |
I don't consider it much of a burden to parse strings vs. objects. It adds a little bit of complexity but also offers benefits. The string option for link values provides a clean and simple approach to include fetch-only related resource URLs. It allows deeply nested related resource URLs, such as |
Agreed. For me this issue is mostly about the incongruity between So, there are in fact two reasons why one might expect the value to be a relationship URL instead of the related resource URL.
Hmm, I don't see why deep associations should need a string value any more than direct relations... |
That last sentence doesn't stand well on its own. My emphasis on "clean and simple" from the previous sentence applies to the last one:
Anyway, your prior argument is fairly compelling:
I will milestone this for consideration, but I should say that we are very reluctant to make even minor breaking changes at this point. |
From an implementors standpoint this is six of this half a dozen of the other to me. |
I'm going to close this having spoken with several implementors who consider it rather trivial to implement the alternative string representation. Thanks for the good discussion. |
The option for a url for a relationship is equivalent to a "link object" with a "related" member.
There is no need to have both options as it just increased the complexity of implementation.