-
-
Notifications
You must be signed in to change notification settings - Fork 338
Define compound schema documents (#936) #977
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
2a788d8
67c00d2
2dc975a
d3f6274
ac9ec4f
3c99506
7beb355
c44829d
959fb2b
375cb26
08e9e60
f82ee55
6cf7022
976a6fb
49d77b2
5d36e17
4eacfe3
b27a703
9f51c19
0409c72
13867cd
20e1910
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
Define Compound Schema Document and associated concerns
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1845,6 +1845,48 @@ | |
</section> | ||
</section> | ||
|
||
<section title="Compound Documents"> | ||
<t> | ||
A Compound Schema Document is defined as JSON document (sometimes called a "dereferenced" or | ||
"bundled" schema) which has multiple embedded JSON Schema Resources bundled into the same | ||
document to ease transportation. | ||
</t> | ||
<t> | ||
Each embedded Schema Resource MUST be treated as an individual Schema Resource, following standard | ||
schema loading and processing requirements, including determining voacbulary support. | ||
Relequestual marked this conversation as resolved.
Show resolved
Hide resolved
|
||
</t> | ||
<section title="Bundling"> | ||
<t> | ||
A Compound Schema Document is created by replacing references (such as "$ref") with an | ||
embedded version of the referenced Schema Resource. | ||
handrews marked this conversation as resolved.
Show resolved
Hide resolved
|
||
</t> | ||
<t> | ||
Each embedded JSON Schema Resource (and the document's root) MUST identify itself | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Technically the document's root is only a SHOULD for |
||
with an absolute URI using the "$id" keyword, and SHOULD make use of the "$schema" | ||
keyword to identify the dialect it is using, in the root of the schema resource. | ||
Relequestual marked this conversation as resolved.
Show resolved
Hide resolved
|
||
</t> | ||
<t> | ||
When a reference applicator is dereferenced as part of the bundling process, the Schema Resource | ||
Relequestual marked this conversation as resolved.
Show resolved
Hide resolved
|
||
MUST NOT be embedded by replacing the schema object from which it was referenced, or by wrapping | ||
handrews marked this conversation as resolved.
Show resolved
Hide resolved
|
||
in other applicator keywords. In stead, a bundled Schema Resource MUST be located in `$defs`, | ||
Relequestual marked this conversation as resolved.
Show resolved
Hide resolved
|
||
where the key is the `$id` of the Schema Resource, which MUST then be referenced using `$ref`. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is easier if you just say that the original reference MUST be left unchanged (but could later be changed through dereferencing, which is defined separately). |
||
</t> | ||
</section> | ||
<section title="Validating"> | ||
<t> | ||
Given a Compound Schema Document may have embedded resources which idenfiy as using different | ||
Relequestual marked this conversation as resolved.
Show resolved
Hide resolved
|
||
dialects, it is NOT RECOMMENDED that these documents are validated by applying a meta-schema | ||
to the Compound Schema Document as an instance. It is RECOMMENDED that an alternate | ||
Relequestual marked this conversation as resolved.
Show resolved
Hide resolved
|
||
validation process be provided in order to validate Compound Schema Documents | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this need to be an alternate for compound schema documents, or just an alternate for schema documents (schemas against meta-schemas) in general? You should always be able to tell whether a given schema is compound, so if you know your instance is a schema that is enough. We don't want to encourage two different meta-schema functions, because if someone validating a non-bundled schema with the "regular" meta-schema validation function, but then that schema got changed to a bundled schema, it would now require a code change to be handled correctly. We never want to require a code change to keep validation working. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The consensus in the associated issue was that a compound document would be transport only, in that you can't validate it by applying a meta schema to it as an instance. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Relequestual I think @handrews was just concerned that this could be misunderstood to mean that you need a separate process to validate a schema than you do to validate a compound schema. The process for validating schema documents is the process for validating compound schema documents. I think the suggestion would be to do something like ...
The "Compound" part is implied because all schemas are potentially compound. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Relequestual yes, what @jdesrosiers said. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, we are on the same page now. I don't disagree. I thought in the issue we said it wouldn't be possible to identify a compound schema document vs a normal schema document, although that may have been in context of being an instance. I'm going to HAVE to review the issue discussion again. It's fine =] There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Yes, that was in the context of being an instance. It's not possible to identify an instance as a schema (compound or otherwise). |
||
(such as a differnet function). | ||
Relequestual marked this conversation as resolved.
Show resolved
Hide resolved
|
||
</t> | ||
<t> | ||
A Compound Schema Document in which all embedded resources idenfity as using the same | ||
dialect MAY be validated by applying the appropriate meta-schema. | ||
</t> | ||
</section> | ||
</section> | ||
|
||
<section title="Caveats"> | ||
<section title="Guarding Against Infinite Recursion"> | ||
<t> | ||
|
Uh oh!
There was an error while loading. Please reload this page.