Skip to content

Commit 879dd3b

Browse files
committed
Remove profile query parameters and make Accept the sole negotiation mechanism.
1 parent 495ace8 commit 879dd3b

File tree

1 file changed

+1
-58
lines changed

1 file changed

+1
-58
lines changed

_format/1.1/index.md

Lines changed: 1 addition & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1942,7 +1942,7 @@ has been applied **MUST** ignore any document members that it does not understan
19421942

19431943
Clients and servers **MUST** include the `profile` media type parameter in
19441944
conjunction with the JSON:API media type in a `Content-Type` header to indicate
1945-
that they have applied one or more profiles to a JSON:API document.
1945+
that they have applied one or more profiles to a JSON:API message.
19461946

19471947
Likewise, clients and servers applying profiles to a JSON:API document **MUST**
19481948
include a [top-level][top level] [`links` object][links] with a `profile` key,
@@ -1963,22 +1963,6 @@ apply profiles in subsequent interactions with the same API.
19631963
support JSON:API at all or that the client has failed to provide a required
19641964
profile.
19651965

1966-
### <a href="#profile-query-parameter" id="profile-query-parameter" class="headerlink"></a> `profile` Query Parameter
1967-
1968-
A client **MAY** use the `profile` query parameter to _require_ the server to
1969-
apply one or more profiles when processing the request. The value of the `profile`
1970-
query parameter **MUST** equal a URI-encoded whitespace-separated list of profile URIs.
1971-
1972-
If a server receives a request requiring the application of a profile or
1973-
combination of profiles that it can not apply, it **MUST** respond with a `400
1974-
Bad Request` status code. The response **MUST** contain an [error object] that
1975-
identifies the `profile` query parameter as the `source` and has the following
1976-
URI as (one of) its `type`s:
1977-
1978-
```
1979-
https://jsonapi.org/errors/profile-not-supported
1980-
```
1981-
19821966
> Note: When a client lists a profile in the `Accept` header, it's asking the
19831967
> server to compute its response as normal, but then send the response document
19841968
> with some extra information, as described in the requested profile. By
@@ -1987,47 +1971,6 @@ https://jsonapi.org/errors/profile-not-supported
19871971
> rules of the profile. This can fundamentally change the meaning of the
19881972
> server's response.
19891973
1990-
#### <a href="#profile-query-parameter-omitting" id="profile-query-parameter" class="headerlink"></a> Omitting the `profile` Query Parameter
1991-
1992-
Requiring the client to specify the `profile` query parameter would be
1993-
cumbersome. Accordingly, JSON:API defines a way that server's may infer its
1994-
value in many cases.
1995-
1996-
To do so, a server **MAY** define an internal mapping from query parameter names
1997-
to profile URIs. The profile URI for a query parameter name in this mapping
1998-
**MUST NOT** change over time.
1999-
2000-
> Note: the server may choose to map all query parameter names from the same
2001-
> [family][query parameter family] to one profile URI. Or, it may choose to map
2002-
> only specific query parameter names.
2003-
2004-
If a requested URL does not contain the `profile` query parameter and does
2005-
contain one or more query parameters in the server's internal mapping, the
2006-
server may act as though the request URL contained a `profile` query parameter
2007-
whose value was the URI-encoded space-separated list of each unique profile URI
2008-
found in the server's internal mapping for the query parameters in use on the
2009-
request.
2010-
2011-
For example, the server might support a profile that defines a meaning for the
2012-
values of the `page[cursor]` query parameter. Then, it could define its internal
2013-
param name to profile URI mapping like so:
2014-
2015-
```json
2016-
{ "page[cursor]": "https://example.com/pagination-profile" }
2017-
```
2018-
2019-
Accordingly, a request for:
2020-
2021-
```
2022-
https://example.com/?page[cursor]=xyz
2023-
```
2024-
2025-
would be interpreted by the server as:
2026-
2027-
```
2028-
https://example.com/?page[cursor]=xyz&profile=https://example.com/pagination-profile
2029-
```
2030-
20311974

20321975
### <a href="#profile-keywords" id="profile-keywords" class="headerlink"></a> Profile Keywords
20331976

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