|
635 | 635 | </t>
|
636 | 636 | <t>
|
637 | 637 | Note that some keywords, such as "$schema", apply to the lexical
|
638 |
| - scope of the entire schema document, and therefore MUST only |
| 638 | + scope of the entire schema resource, and therefore MUST only |
639 | 639 | appear in a schema resource's root schema.
|
640 | 640 | </t>
|
641 | 641 | <t>
|
|
1167 | 1167 | media type "application/schema+json".
|
1168 | 1168 | </t>
|
1169 | 1169 | <t>
|
1170 |
| - The "$schema" keyword SHOULD be used in a resource root schema. |
1171 |
| - It MUST NOT appear in resource subschemas. If absent from the root schema, the |
1172 |
| - 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 subschemas. If absent from the document root schema, |
| 1173 | + the resulting behavior is implementation-defined. |
1173 | 1174 | </t>
|
1174 | 1175 | <t>
|
1175 |
| - If multiple schema resources are present in a single document, then all |
1176 |
| - schema resources SHOULD Have the same value for "$schema". The result of |
1177 |
| - differing values for "$schema" within the same schema document is |
1178 |
| - implementation-defined. |
1179 |
| - <cref> |
1180 |
| - Using multiple "$schema" keywords in the same document would imply that the |
1181 |
| - feature set and therefore behavior can change within a document. This would |
1182 |
| - necessitate resolving a number of implementation concerns that have not yet |
1183 |
| - been clearly defined. So, while the pattern of using "$schema" only in root |
1184 |
| - schemas is likely to remain the best practice for schema authoring, |
1185 |
| - implementation behavior is subject to be revised or liberalized in |
1186 |
| - future drafts. |
1187 |
| - </cref> |
1188 |
| - <cref> |
1189 |
| - The exception made for embedded schema resources is to |
1190 |
| - allow bundling multiple schema resources into a single schema document |
1191 |
| - without needing to change their contents, as described later in this |
1192 |
| - specification. |
1193 |
| - </cref> |
1194 |
| - <!-- |
1195 |
| - In particular, the process of validating an instance, including validating a |
1196 |
| - schema as an instance against its meta-schema, only allows for a single set |
1197 |
| - of rules across the entire instance document. There is no equivalent of |
1198 |
| - changing the meta-schema partway through the validation for non-schema |
1199 |
| - instances. |
1200 |
| - --> |
| 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 inherit the meta-schema from the enclosing resource. |
| 1179 | + </t> |
| 1180 | + <t> |
| 1181 | + Embedded schema resources MAY specify different "$schema" values from their |
| 1182 | + enclosing resource, as any schema that can be referenced can also be embedded. |
1201 | 1183 | </t>
|
1202 | 1184 | <t>
|
1203 | 1185 | Values for this property are defined elsewhere in this and other documents,
|
@@ -3769,6 +3751,11 @@ https://example.com/schemas/common#/$defs/count/minimum
|
3769 | 3751 | </t>
|
3770 | 3752 | <t>
|
3771 | 3753 | <list style="hanging">
|
| 3754 | + <t hangText="draft-handrews-json-schema-03"> |
| 3755 | + <list style="symbols"> |
| 3756 | + <t>"$schema" MAY change for embedded resources</t> |
| 3757 | + </list> |
| 3758 | + </t> |
3772 | 3759 | <t hangText="draft-handrews-json-schema-02">
|
3773 | 3760 | <list style="symbols">
|
3774 | 3761 | <t>Update to RFC 8259 for JSON specification</t>
|
|
0 commit comments