Skip to content

Commit 0158f33

Browse files
committed
Guidance on content negotiation
...and a few other minor wording improvements around HTTP usage.
1 parent d9864a4 commit 0158f33

File tree

1 file changed

+31
-5
lines changed

1 file changed

+31
-5
lines changed

jsonschema-hyperschema.xml

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1294,11 +1294,10 @@ for varname in templateData:
12941294
using protocols such as CoAP that are explicitly analogous to HTTP.
12951295
</t>
12961296
<t>
1297-
This section provides guidance on how to define links for use with each
1298-
common HTTP method, and how collection resources impose additional constraints
1299-
on the use of HTTP POST. Additionally, guidance is provided on hinting at
1300-
HTTP response header values and describing possible HTTP request headers
1301-
that are relevant to the given resource.
1297+
This section provides guidance on how to use each common HTTP method with a link,
1298+
and how colletion resources impose additional constraints on HTTP POST.
1299+
Additionally, guidance is provided on hinting at HTTP response header values and
1300+
describing possible HTTP request headers that are relevant to the given resource.
13021301
</t>
13031302
<section title="One link per target and relation type">
13041303
<t>
@@ -1349,6 +1348,8 @@ for varname in templateData:
13491348
that are suitable for PATCH-ing define a syntax for expressing changes
13501349
to a document, which can be applied to the representation described by
13511350
"targetSchema" to determine the set of syntactically valid request payloads.
1351+
Often, the simplest way to validate a PATCH is to apply it and validate
1352+
the result as a normal representation.
13521353
</t>
13531354
<t>
13541355
HTTP POST request payloads are described by the "submissionSchema" and
@@ -1426,6 +1427,31 @@ for varname in templateData:
14261427
<xref target="collectionAndItem" />.
14271428
</t>
14281429
</section>
1430+
<section title="Content negotiation and schema evolution">
1431+
<t>
1432+
JSON Hyper-Schema facilitates HTTP content negotiation, and allows for
1433+
a hybrid of the proactive and reactive strategies. As mentioned
1434+
above, a hyper-schema can include a schema for HTTP headers such as
1435+
"Accept", "Accept-Charset", "Accept-Language", etc with the "headerSchema"
1436+
keyword. A user agent or client application can use information in
1437+
this schema, such as an enumerated list of supported laguages, in lieu of
1438+
making an initial request to start the reactive negotiation process.
1439+
</t>
1440+
<t>
1441+
In this way, the proactive content negotiation technique of setting these
1442+
headers can be informed by server information about what values are
1443+
possible, similar to examining a list of alternatives in reactive negotiation.
1444+
</t>
1445+
<t>
1446+
For media types that allow specifying a schema as a media type parameter,
1447+
the "Accept" values sent in a request or advertised in "headerSchema" can
1448+
include the URI(s) of the schema(s) to which the negotiated representation
1449+
is expected to conform. One possible use for schema parameters in
1450+
content negotiation is if the resource has conformed to several different
1451+
schema versions over time. The client can indicate what version(s) it
1452+
understands in the "Accept" header in this way.
1453+
</t>
1454+
</section>
14291455
</section>
14301456

14311457
<section title="Examples" anchor="examples">

0 commit comments

Comments
 (0)