Skip to content

Commit 746639e

Browse files
committed
Content Negotiation: Remove detailed error requirement; use 415, 406
1 parent 12c91a0 commit 746639e

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

format/index.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,24 +31,19 @@ interpreted as described in RFC 2119
3131
Clients **MUST** send all JSON API data in request documents with the header
3232
`Content-Type: application/vnd.api+json`, without any media type parameters.
3333

34+
If a client violates this requirement, servers **MUST** respond with a
35+
`415 Unsupported Media Type` status code.
36+
3437
Clients that include the JSON API media type in their `Accept` header, **MUST**
3538
specify the media type there at least once without any media type parameters.
3639

37-
Servers **MUST** return a `400 Bad Request` status code if clients violate
38-
either of the requirements above. The server's response to such violations
39-
**MUST** contain a JSON API document with an [error object](#error-objects).
40-
The `"href"` member of that object **MUST** be
41-
`"http://jsonapi.org/errors/invalid-media-type-parameter"`.
40+
If a client violates this requirement, and its `Accept` header doesn't contain
41+
any other media types that the server can produce, the server **MUST** respond
42+
with a `406 Not Acceptable` status code.
4243

4344
Servers **MUST** send all JSON API data in response documents with the header
4445
`Content-Type: application/vnd.api+json`, without any media type parameters.
4546

46-
Clients **MUST** ignore any parameters for the `application/vnd.api+json`
47-
media type received in the `Content-Type` header of response documents.
48-
49-
> Note: These requirements exist to allow future versions of this specification
50-
to use media type parameters for extension negotiation and versioning.
51-
5247
Servers **MUST NOT** send responses with the `application/vnd.api+json` media
5348
type if the client has not indicated, using its `Accept` header, that it can
5449
understand this format.
@@ -60,6 +55,12 @@ considered to be sending "JSON API data" for the purposes of the requirement
6055
above, but rather simple JSON data, and the client cannot rely on any of the
6156
rules laid out in this specification.
6257

58+
Clients **MUST** ignore any parameters for the `application/vnd.api+json`
59+
media type received in the `Content-Type` header of response documents.
60+
61+
> Note: These requirements exist to allow future versions of this specification
62+
to use media type parameters for extension negotiation and versioning.
63+
6364
## Document Structure <a href="#document-structure" id="document-structure" class="headerlink"></a>
6465

6566
This section describes the structure of a JSON API document, which is identified

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy