|
450 | 450 | is its top-level schema object, which would also be a document root schema
|
451 | 451 | if the resource were to be extracted to a standalone JSON Schema document.
|
452 | 452 | </t>
|
| 453 | + <t> |
| 454 | + Whether multiple schema resources are embedded or linked with a reference, |
| 455 | + they are processed in the same way, with the same available behaviors. |
| 456 | + </t> |
453 | 457 | </section>
|
454 | 458 | </section>
|
455 | 459 |
|
|
631 | 635 | </t>
|
632 | 636 | <t>
|
633 | 637 | Note that some keywords, such as "$schema", apply to the lexical
|
634 |
| - scope of the entire schema document, and therefore MUST only |
| 638 | + scope of the entire schema resource, and therefore MUST only |
635 | 639 | appear in a schema resource's root schema.
|
636 | 640 | </t>
|
637 | 641 | <t>
|
|
1163 | 1167 | media type "application/schema+json".
|
1164 | 1168 | </t>
|
1165 | 1169 | <t>
|
1166 |
| - The "$schema" keyword SHOULD be used in a resource root schema. |
1167 |
| - It MUST NOT appear in resource subschemas. If absent from the root schema, the |
1168 |
| - resulting behavior is implementation-defined. |
| 1170 | + The "$schema" keyword SHOULD be used in the document root schema object, |
| 1171 | + and MAY be used in the root schema objects of embedded schema resources. |
| 1172 | + It MUST NOT appear in non-resource root schema objects. If absent from |
| 1173 | + the document root schema, the resulting behavior is implementation-defined. |
1169 | 1174 | </t>
|
1170 | 1175 | <t>
|
1171 |
| - If multiple schema resources are present in a single document, then all |
1172 |
| - schema resources SHOULD Have the same value for "$schema". The result of |
1173 |
| - differing values for "$schema" within the same schema document is |
1174 |
| - implementation-defined. |
1175 |
| - <cref> |
1176 |
| - Using multiple "$schema" keywords in the same document would imply that the |
1177 |
| - feature set and therefore behavior can change within a document. This would |
1178 |
| - necessitate resolving a number of implementation concerns that have not yet |
1179 |
| - been clearly defined. So, while the pattern of using "$schema" only in root |
1180 |
| - schemas is likely to remain the best practice for schema authoring, |
1181 |
| - implementation behavior is subject to be revised or liberalized in |
1182 |
| - future drafts. |
1183 |
| - </cref> |
1184 |
| - <cref> |
1185 |
| - The exception made for embedded schema resources is to |
1186 |
| - allow bundling multiple schema resources into a single schema document |
1187 |
| - without needing to change their contents, as described later in this |
1188 |
| - specification. |
1189 |
| - </cref> |
1190 |
| - <!-- |
1191 |
| - In particular, the process of validating an instance, including validating a |
1192 |
| - schema as an instance against its meta-schema, only allows for a single set |
1193 |
| - of rules across the entire instance document. There is no equivalent of |
1194 |
| - changing the meta-schema partway through the validation for non-schema |
1195 |
| - instances. |
1196 |
| - --> |
| 1176 | + If multiple schema resources are present in a single document, then |
| 1177 | + schema resources which do not have a "$schema" keyword in their root |
| 1178 | + schema object MUST be processed as if "$schema" were present with the |
| 1179 | + same value as for the immediately enclosing resource. |
| 1180 | + </t> |
| 1181 | + <t> |
| 1182 | + Embedded schema resources MAY specify different "$schema" values from their |
| 1183 | + enclosing resource, as any schema that can be referenced can also be embedded. |
1197 | 1184 | </t>
|
1198 | 1185 | <t>
|
1199 | 1186 | Values for this property are defined elsewhere in this and other documents,
|
@@ -3789,7 +3776,7 @@ https://example.com/schemas/common#/$defs/count/minimum
|
3789 | 3776 | <list style="hanging">
|
3790 | 3777 | <t hangText="draft-handrews-json-schema-03">
|
3791 | 3778 | <list style="symbols">
|
3792 |
| - <t></t> |
| 3779 | + <t>"$schema" MAY change for embedded resources</t> |
3793 | 3780 | <t>Array-value "items" functionality is now "prefixItems"</t>
|
3794 | 3781 | <t>"items" subsumes the old function of "additionalItems"</t>
|
3795 | 3782 | <t>"contains" and "unevaluatedItems" interactions now specified</t>
|
|
0 commit comments