Skip to content

Commit 38c8b74

Browse files
committed
First attempt to resolve json-schema-org#936
Define Compound Schema Document and associated concerns
1 parent 9b32946 commit 38c8b74

File tree

1 file changed

+44
-2
lines changed

1 file changed

+44
-2
lines changed

jsonschema-core.xml

+44-2
Original file line numberDiff line numberDiff line change
@@ -1830,6 +1830,48 @@
18301830
</section>
18311831
</section>
18321832

1833+
<section title="Compound Documents">
1834+
<t>
1835+
A Compound Schema Document is defined as JSON document (sometimes called a "dereferenced" or
1836+
"bundled" schema) which has multiple embedded JSON Schema Resources bundled into the same
1837+
document to ease transportation.
1838+
</t>
1839+
<t>
1840+
Each embedded Schema Resource MUST be treated as an individual Schema Resource, following standard
1841+
schema loading and processing requirements, including determining voacbulary support.
1842+
</t>
1843+
<section title="Bundling">
1844+
<t>
1845+
A Compound Schema Document is created by replacing references (such as "$ref") with an
1846+
embedded version of the referenced Schema Resource.
1847+
</t>
1848+
<t>
1849+
Each embedded JSON Schema Resource (and the document's root) MUST identify itself
1850+
with an absolute URI using the "$id" keyword, and SHOULD make use of the "$schema"
1851+
keyword to identify the dialect it is using, in the root of the schema resource.
1852+
</t>
1853+
<t>
1854+
When a reference applicator is dereferenced as part of the bundling process, the Schema Resource
1855+
MUST NOT be embedded by replacing the schema object from which it was referenced, or by wrapping
1856+
in other applicator keywords. In stead, a bundled Schema Resource MUST be located in `$defs`,
1857+
where the key is the `$id` of the Schema Resource, which MUST then be referenced using `$ref`.
1858+
</t>
1859+
</section>
1860+
<section title="Validating">
1861+
<t>
1862+
Given a Compound Schema Document may have embedded resources which idenfiy as using different
1863+
dialects, it is NOT RECOMMENDED that these documents are validated by applying a meta-schema
1864+
to the Compound Schema Document as an instance. It is RECOMMENDED that an alternate
1865+
validation process be provided in order to validate Compound Schema Documents
1866+
(such as a differnet function).
1867+
</t>
1868+
<t>
1869+
A Compound Schema Document in which all embedded resources idenfity as using the same
1870+
dialect MAY be validated by applying the appropriate meta-schema.
1871+
</t>
1872+
</section>
1873+
</section>
1874+
18331875
<section title="Caveats">
18341876
<section title="Guarding Against Infinite Recursion">
18351877
<t>
@@ -2405,8 +2447,8 @@
24052447
</t>
24062448
<t>
24072449
This keyword produces an annotation value which is an array of
2408-
the indexes to which this keyword validates successfully when applying
2409-
its subschema, in ascending order. The value MAY be a boolean true if the
2450+
the indexes to which this keyword validates successfully when applying
2451+
its subschema, in ascending order. The value MAY be a boolean true if the
24102452
subschema validated successfully when applied to every index of the instance.
24112453
</t>
24122454
</section>

0 commit comments

Comments
 (0)