Skip to content

Commit 487a36c

Browse files
committed
clarify that contentSchema holds a subschema and when/how it applies
1 parent e3a87d4 commit 487a36c

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

specs/jsonschema-validation.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -532,19 +532,24 @@ defined by [RFC 2046](#rfc2046).
532532

533533
### `contentSchema`
534534

535-
If the instance is a string, and if `contentMediaType` is present, this property
536-
contains a schema which describes the structure of the string.
535+
If the instance is a string, and if `contentMediaType` is present, this
536+
property's subschema describes the structure of the string.
537537

538538
This keyword MAY be used with any media type that can be mapped into JSON
539539
Schema's data model. Specifying such mappings is outside of the scope of this
540540
specification.
541541

542-
The value of this property MUST be a valid JSON schema. It SHOULD be ignored if
543-
`contentMediaType` is not present. Accessing the schema through the schema
544-
location IRI included as part of the annotation will ensure that it is correctly
545-
processed as a subschema. Using the extracted annotation value directly is only
546-
safe if the schema is an embedded resource with both `$schema` and an
547-
absolute IRI `$id`.
542+
The value of this property MUST be a valid JSON schema. The subschema is
543+
produced as an annotation.
544+
545+
Since `contentMediaType` is required to provide instruction on how to interpret
546+
the string content, the annotation schema produced by this keyword has no
547+
meaning if `contentMediaType` is not present.
548+
549+
Accessing the schema through the schema location IRI included as part of the
550+
annotation will ensure that it is correctly processed as a subschema. Using the
551+
extracted annotation value directly is only safe if the subschema is an embedded
552+
resource with both `$schema` and an absolute IRI `$id`.
548553

549554
### Example
550555

0 commit comments

Comments
 (0)