Skip to content

Commit 5e522df

Browse files
committed
Explain schema media type param and Accept
This explains how to use HTTP content negotiation to request representations that conform to multiple schemas, or conform to at least one schema out of several.
1 parent 9bf78da commit 5e522df

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed

jsonschema-core.xml

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2186,7 +2186,8 @@ Content-Type: application/json;
21862186
</figure>
21872187

21882188
<t>
2189-
Multiple schemas are whitespace separated:
2189+
Multiple schemas are whitespace separated, and indicate that the
2190+
instance conforms to all of the listed schemas:
21902191
</t>
21912192

21922193
<figure>
@@ -2198,6 +2199,33 @@ Content-Type: application/json;
21982199
</artwork>
21992200
</figure>
22002201

2202+
<t>
2203+
Media type parameters are also used in HTTP's Accept request header:
2204+
</t>
2205+
2206+
<figure>
2207+
<artwork>
2208+
<![CDATA[
2209+
Accept: application/json;
2210+
schema="http://example.com/qiang http://example.com/li",
2211+
application/json;
2212+
schema="http://example.com/kumar"
2213+
]]>
2214+
</artwork>
2215+
</figure>
2216+
2217+
<t>
2218+
As with Content-Type, multiple schema parameters in the same string
2219+
requests an instance that conforms to all of the listed schemas.
2220+
</t>
2221+
2222+
<t>
2223+
The Accept header also allows repeating the same media type with
2224+
different parameters, which requests that the instance conforms
2225+
to one parameter value or the other. Such an instance can conform
2226+
to all separately specified parameters but is not guaranteed to do so.
2227+
</t>
2228+
22012229
<t>
22022230
<cref>
22032231
This paragraph assumes that we can register a "schema" link relation.

0 commit comments

Comments
 (0)