-
Notifications
You must be signed in to change notification settings - Fork 889
Content negotiation redux #703
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
…nces of violating them See rationale in #673. Also consolidates all the rules into the content negotiation section.
👍 |
Thanks for working on these refinements, @dgeb! I'm excited to get this text in too! 👍 On dividing client and server responsibilities, and on some of your rewordings, which made things far less awkward. 👎 On the sentence "Servers MUST respond with a 👎 On removing the non-normative note about serving JSON API as JSON. I added that because a good server should support this, to make it easier for developers to make requests using generic clients (like curl) without having to go to the (totally unnecessary) trouble of setting a custom Of course, you guys have the final call on all this, but that's my .02 |
Okay, the curl example has convinced me. I think you're right RE: fallbacks @ethanresnick. |
If we remove this statement: "Servers MUST respond with a 406 Not Acceptable status code if a request's Accept header doesn't contain any media types that the server can produce." Then we remove the ability for clients / servers to negotiate based on media type parameters in the future. |
This is why I specifically called out the |
This is awkwardly worded, but provides the allowance we need while (I think) respecting @ethanresnick's concerns about overstepping ourbounds:
|
@dgeb Your reworded clause works for me! Also, sorry, I should've been clearer originally. I was imagining that, if we removed the sentence, extension negotiation would still work because the client would check the The theoretical advantage of this would have been that it preserves the flexibility that HTTP allows for responding to a request like: GET /articles
Accept: text/plain With: 200 OK
Content-Type: application/json
{
"data": { //... }
} Rather than a 406. Also, my thinking was that clients would have to inspect That said, if we can give status code indicators, I think we should, and your new clause seems to let us do that while keeping all of HTTP's allowed wiggle room |
fd09819
to
f39ebdd
Compare
@ethanresnick thanks for confirming! I've pushed the reworded clause. Let's try to get something non-normative in tomorrow that will scratch your itch regarding working with generic clients. |
request. Servers **MUST** ignore all other parameters for the | ||
`application/vnd.api+json` media type in `Accept` and `Content-Type` | ||
headers. | ||
Servers **MUST** respond with a `406 Not Acceptable` status code if a |
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.
How about
Servers MUST respond with a
406 Not Acceptable
status code when a request'sAccept
header contains the JSON API media type and all instances of that media type are modified with media type parameters.
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.
👍
f39ebdd
to
0b658e1
Compare
Thanks for re-working this @dgeb. I'm 👍 to merge with that minor change. |
Thanks for the careful review @ethanresnick and @tkellen! |
@dgeb Absolutely! Btw, as far as adding the non-normative note about serving |
@ethanresnick Thanks - I'll definitely review your non-normative note again now that the normative changes have been merged. |
This is a refinement of @ethanresnick's work in #673. It separates the client and server responsibilities for clarity and corrects a few aspects.
I won't attempt to summarize the tweaks. It's important to review the full text carefully.