Skip to content

Commit 2a788d8

Browse files
committed
First attempt to resolve json-schema-org#936
Define Compound Schema Document and associated concerns
1 parent 78413ee commit 2a788d8

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

jsonschema-core.xml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1845,6 +1845,48 @@
18451845
</section>
18461846
</section>
18471847

1848+
<section title="Compound Documents">
1849+
<t>
1850+
A Compound Schema Document is defined as JSON document (sometimes called a "dereferenced" or
1851+
"bundled" schema) which has multiple embedded JSON Schema Resources bundled into the same
1852+
document to ease transportation.
1853+
</t>
1854+
<t>
1855+
Each embedded Schema Resource MUST be treated as an individual Schema Resource, following standard
1856+
schema loading and processing requirements, including determining voacbulary support.
1857+
</t>
1858+
<section title="Bundling">
1859+
<t>
1860+
A Compound Schema Document is created by replacing references (such as "$ref") with an
1861+
embedded version of the referenced Schema Resource.
1862+
</t>
1863+
<t>
1864+
Each embedded JSON Schema Resource (and the document's root) MUST identify itself
1865+
with an absolute URI using the "$id" keyword, and SHOULD make use of the "$schema"
1866+
keyword to identify the dialect it is using, in the root of the schema resource.
1867+
</t>
1868+
<t>
1869+
When a reference applicator is dereferenced as part of the bundling process, the Schema Resource
1870+
MUST NOT be embedded by replacing the schema object from which it was referenced, or by wrapping
1871+
in other applicator keywords. In stead, a bundled Schema Resource MUST be located in `$defs`,
1872+
where the key is the `$id` of the Schema Resource, which MUST then be referenced using `$ref`.
1873+
</t>
1874+
</section>
1875+
<section title="Validating">
1876+
<t>
1877+
Given a Compound Schema Document may have embedded resources which idenfiy as using different
1878+
dialects, it is NOT RECOMMENDED that these documents are validated by applying a meta-schema
1879+
to the Compound Schema Document as an instance. It is RECOMMENDED that an alternate
1880+
validation process be provided in order to validate Compound Schema Documents
1881+
(such as a differnet function).
1882+
</t>
1883+
<t>
1884+
A Compound Schema Document in which all embedded resources idenfity as using the same
1885+
dialect MAY be validated by applying the appropriate meta-schema.
1886+
</t>
1887+
</section>
1888+
</section>
1889+
18481890
<section title="Caveats">
18491891
<section title="Guarding Against Infinite Recursion">
18501892
<t>

0 commit comments

Comments
 (0)