@@ -1942,7 +1942,7 @@ has been applied **MUST** ignore any document members that it does not understan
1942
1942
1943
1943
Clients and servers ** MUST** include the ` profile ` media type parameter in
1944
1944
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 .
1946
1946
1947
1947
Likewise, clients and servers applying profiles to a JSON: API document ** MUST**
1948
1948
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.
1963
1963
support JSON: API at all or that the client has failed to provide a required
1964
1964
profile.
1965
1965
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
-
1982
1966
> Note: When a client lists a profile in the ` Accept ` header, it's asking the
1983
1967
> server to compute its response as normal, but then send the response document
1984
1968
> with some extra information, as described in the requested profile. By
@@ -1987,47 +1971,6 @@ https://jsonapi.org/errors/profile-not-supported
1987
1971
> rules of the profile. This can fundamentally change the meaning of the
1988
1972
> server's response.
1989
1973
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
-
2031
1974
2032
1975
### <a href =" #profile-keywords " id =" profile-keywords " class =" headerlink " ></a > Profile Keywords
2033
1976
0 commit comments