-
Notifications
You must be signed in to change notification settings - Fork 894
clarify meaning of empty include query param #1532
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
FWIW, I'm proceeding with the assumption that something like this is going to land at some point. |
_format/1.1/index.md
Outdated
(U+002E FULL-STOP, ".") list of [relationship][relationships] names. An empty | ||
value indicates that no related resource should be returned. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we wish to add this clarification.
(U+002E FULL-STOP, ".") list of [relationship][relationships] names. An empty | |
value indicates that no related resource should be returned. | |
(U+002E FULL-STOP, ".") list of [relationship][relationships] names. An empty | |
value (no characters) indicates that no related resource should be returned. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@prathe I'm not sure the clarification (no characters
) is needed, but I'm not opposed either. If we were to add this, it should also be added to the similar language around sparse field sets. Since it affects multiple areas, maybe a small separate PR would be best.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding this clarification. This seems good and is consistent with the language around sparse fieldsets. Just one minor nit to fix and then we can merge this.
Co-authored-by: Dan Gebhardt <dan@cerebris.com>
Thanks again @jelhan for the clarifying PR and also to @freddrake for raising the issue in #1530. |
The meaning of an empty value for the
include
query parameter was not clear yet. As @freddrake pointed out in #1530 a reader could interpret either as an empty list of relationship paths or as a single (invalid) relationship path.The meaning of an empty value for
fields
query parameter is explicitly specified:I think the same applies to the
include
query parameter even though it's not mentioned explicitly yet. Otherwise a client would not be able to tell a server to not include any related resources - even if that server includes some resources by default.I think this is not a breaking change. Let's have a look at several scenarios:
An existing implementation may consider an empty value as a single relationship path. An empty string is not a valid relationship path. The server would be unable to identify the relationship path and response with
400 Bad Request
.An existing implementation may silently ignore an
include
parameter if it's value is empty.include
parameter with an empty value is given, the implementation is not compliant with the specification even today. A server must not ignore a giveninclude
query parameter. It must response with a 400 if it does not support it.An existing implementation may already interpret an empty
ignore
parameter as an empty list of relationship paths and not include any related resources.The meaning of an empty value for a Sparse Fieldset was also not explicitly specified since a few months ago. It was added in #1500. This was also not considered a breaking change.
Closes #1530