From bbd3be9541af38152b884e8d75377cff512ff00d Mon Sep 17 00:00:00 2001 From: Henry Andrews Date: Sun, 16 Dec 2018 19:09:00 -0800 Subject: [PATCH 1/2] 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. --- jsonschema-core.xml | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/jsonschema-core.xml b/jsonschema-core.xml index a8ddb9d5..22221b1c 100644 --- a/jsonschema-core.xml +++ b/jsonschema-core.xml @@ -2912,7 +2912,8 @@ Content-Type: application/json; - Multiple schemas are whitespace separated: + Multiple schemas are whitespace separated, and indicate that the + instance conforms to all of the listed schemas:
@@ -2924,6 +2925,33 @@ Content-Type: application/json;
+ + Media type parameters are also used in HTTP's Accept request header: + + +
+ + + +
+ + + As with Content-Type, multiple schema parameters in the same string + requests an instance that conforms to all of the listed schemas. + + + + The Accept header also allows repeating the same media type with + different parameters, which requests that the instance conforms + to one parameter value or the other. Such an instance can conform + to all separately specified parameters but is not guaranteed to do so. + + This paragraph assumes that we can register a "schema" link relation. From 114b8c6a24d10b3ea9522ef9673b0851ec9b42b2 Mon Sep 17 00:00:00 2001 From: Henry Andrews Date: Sun, 30 Dec 2018 17:19:54 -0800 Subject: [PATCH 2/2] Better wording for Accept usage. --- jsonschema-core.xml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/jsonschema-core.xml b/jsonschema-core.xml index 22221b1c..d67b3d1e 100644 --- a/jsonschema-core.xml +++ b/jsonschema-core.xml @@ -2946,10 +2946,12 @@ Accept: application/json; - The Accept header also allows repeating the same media type with - different parameters, which requests that the instance conforms - to one parameter value or the other. Such an instance can conform - to all separately specified parameters but is not guaranteed to do so. + Unlike Content-Type, Accept can contain multiple values to + indicate that the client can accept several media types. + In the above example, note that the two media types differ + only by their schema parameter values. This requests an + application/json representation that conforms to at least one + of the identified schemas.