Skip to content

Commit 11216df

Browse files
committed
clarify that contentSchema holds a subschema and when/how it applies
1 parent 258d721 commit 11216df

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
@@ -533,19 +533,24 @@ defined by [RFC 2046](#rfc2046).
533533

534534
### `contentSchema`
535535

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

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

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

550555
### Example
551556

0 commit comments

Comments
 (0)