Skip to content

Commit 69dd9a2

Browse files
committed
Put boundaries on lack of "$schema" behavior
This may well change prior to the next release, but documents the intended range of options so as to avoid crashes or completely arbitrary behavior.
1 parent d962a20 commit 69dd9a2

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

jsonschema-core.xml

+12-4
Original file line numberDiff line numberDiff line change
@@ -1228,7 +1228,15 @@
12281228
The "$schema" keyword SHOULD be used in the document root schema object,
12291229
and MAY be used in the root schema objects of embedded schema resources.
12301230
It MUST NOT appear in non-resource root schema objects. If absent from
1231-
the document root schema, the resulting behavior is implementation-defined.
1231+
the document root schema, the resulting behavior is implementation-defined,
1232+
but MUST fall within the following options:
1233+
<ul>
1234+
<li>Refuse to process the schema, as with unsupported required
1235+
vocabularies</li>
1236+
<li>Assume a specific, documented meta-schema</li>
1237+
<li>Document the process by which it examines the schema and determines
1238+
which of a specific set of meta-schemas to assume</li>
1239+
</ul>
12321240
</t>
12331241
<t>
12341242
Values for this property are defined elsewhere in this and other documents,
@@ -3547,9 +3555,9 @@ https://example.com/schemas/common#/$defs/allOf/1
35473555
<t>
35483556
Instances and schemas are both frequently written by untrusted third parties, to be
35493557
deployed on public Internet servers.
3550-
Validators should take care that the parsing and validating against schemas does not consume excessive
3551-
system resources.
3552-
Validators MUST NOT fall into an infinite loop.
3558+
Implementations should take care that the parsing and evaluating against schemas
3559+
does not consume excessive system resources.
3560+
Implementations MUST NOT fall into an infinite loop.
35533561
</t>
35543562
<t>
35553563
A malicious party could cause an implementation to repeatedly collect a copy

0 commit comments

Comments
 (0)