Skip to content

Commit 8df17ac

Browse files
committed
Allow "headerSchema" for content negotiation
While reworking the spec for overall flow, it became apparent that a valuable use of "headerSchema" is to advertise content negotiation options. However, as currently worded, this usage is forbidden. Change the usage to allow this without being too burdensome on implementations. The rewrite will provide greater clarity on the general implementation requirements of "targetHints" and "headerSchema", so please do not worry too much about that for now.
1 parent 0282f4a commit 8df17ac

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

jsonschema-hyperschema.xml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1235,9 +1235,18 @@ GET /foo/
12351235
</t>
12361236

12371237
<t>
1238-
If this property's value is not specified, then the value should be taken to be
1239-
"application/json". Hyper-Schema authors SHOULD NOT use a protocol-specific
1240-
value in <xref target="targetHints">"targetHints"</xref> for this purpose.
1238+
For protocols supporting content-negotiation, implementations MAY choose to
1239+
describe possible target media types using protocol-specific information in
1240+
<xref target="headerSchema">"headerSchema"</xref>. If both protocol-specific
1241+
information and "mediaType" are present, then the value of "mediaType" MUST
1242+
be compatible with the protocol-specific information, and SHOULD indicate
1243+
the media type that will be used in the absence of content negotiation.
1244+
1245+
</t>
1246+
<t>
1247+
When no such protocol-specific information is available, or when the
1248+
implementation does not recognize the protocol involved, then the value
1249+
SHOULD be taken to be "application/json".
12411250
</t>
12421251

12431252
<figure>

0 commit comments

Comments
 (0)