Skip to content

Commit abaa3c8

Browse files
authored
Merge pull request #422 from handrews/header-guidance
Guidance on HTTP headers an "targetHints"/"headerSchema"
2 parents 7be79b4 + a6085fe commit abaa3c8

File tree

1 file changed

+31
-3
lines changed

1 file changed

+31
-3
lines changed

jsonschema-hyperschema.xml

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1296,6 +1296,19 @@ GET /foo/
12961296
Approaches shown in that document's examples SHOULD be applied to other
12971297
similarly structured headers wherever possible.
12981298
</t>
1299+
<t>
1300+
It is RECOMMENDED that schema authors provide hints for the values of
1301+
the following types of HTTP headers whenever applicable:
1302+
<list style="symbols">
1303+
<t>Method allowance</t>
1304+
<t>Method-specific request media types</t>
1305+
<t>Authentication challenges</t>
1306+
</list>
1307+
</t>
1308+
<t>
1309+
In general, headers that are likely to have different values at different
1310+
times SHOULD NOT be included in "targetHints".
1311+
</t>
12991312
<t>
13001313
No distinction is made between headers that may appear in responses to
13011314
different methods, such as HEAD vs OPTIONS.
@@ -1478,12 +1491,27 @@ GET /foo/
14781491
other similarly structured headers wherever possible.
14791492
</t>
14801493
<t>
1481-
The "Prefer" header defined in <xref target="RFC7240">RFC 7240</xref>
1482-
is a good candidate for description in "headerSchema". It defines
1483-
several standard values and allows for extension values.
1494+
It is RECOMMENDED that schema authors describe the available usage of
1495+
the following types of HTTP headers whenever applicable:
1496+
<list style="symbols">
1497+
<t>Content negotiation</t>
1498+
<t>Authentication and authorization</t>
1499+
<t>Range requests</t>
1500+
<t>The "Prefer" header</t>
1501+
</list>
1502+
</t>
1503+
<t>
1504+
Headers such as cache control and conditional request headers are generally
1505+
implemented by intermediaries rather than the resource, and are therefore
1506+
not generally useful to describe. While the resource must supply the
1507+
information needed to use conditional requests, the runtime handling of
1508+
such headers and related responses is not resource-specific.
14841509
</t>
14851510
<figure>
14861511
<preamble>
1512+
The "Prefer" header defined in <xref target="RFC7240">RFC 7240</xref>
1513+
is a good candidate for description in "headerSchema". It defines
1514+
several standard values and allows for extension values.
14871515
This schema indicates that the target understands the
14881516
"respond-async" preference, the "wait" preference which
14891517
takes a number of seconds to wait, as well as "minimal" and

0 commit comments

Comments
 (0)