Skip to content

Commit 30f3158

Browse files
authored
Merge pull request #970 from awwright/970
Clarify how JSON Schema works with a superset of the defined data model
2 parents 3f1b1c4 + 8afae04 commit 30f3158

File tree

1 file changed

+25
-19
lines changed

1 file changed

+25
-19
lines changed

jsonschema-core.xml

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,15 @@
200200
<t>
201201
A JSON document to which a schema is applied is known as an "instance".
202202
</t>
203+
<t>
204+
JSON Schema is defined over "application/json" or compatible documents,
205+
including media types with the "+json" structured syntax suffix.
206+
</t>
207+
<t>
208+
Among these, this specification defines the "application/schema-instance+json"
209+
media type which defines handling for fragments in the URI,
210+
and the "schema" media type parameter.
211+
</t>
203212

204213
<section title="Instance Data Model">
205214
<t>
@@ -243,25 +252,6 @@
243252
</t>
244253
</section>
245254

246-
<section title="Instance Media Types">
247-
<t>
248-
JSON Schema is designed to fully work with "application/json" documents,
249-
as well as media types using the "+json" structured syntax suffix.
250-
</t>
251-
<t>
252-
Some functionality that is useful for working with schemas is
253-
defined by each media type, namely media type parameters and
254-
URI fragment identifier syntax and semantics. These features are
255-
useful in content negotiation and in calculating URIs for specific
256-
locations within an instance, respectively.
257-
</t>
258-
<t>
259-
This specification defines the "application/schema-instance+json"
260-
media type in order to allow instance authors to take full advantage
261-
of parameters and fragment identifiers for these purposes.
262-
</t>
263-
</section>
264-
265255
<section title="Instance Equality">
266256
<t>
267257
Two JSON instances are said to be equal if and only if they are of the same type
@@ -288,6 +278,22 @@
288278
zeros) are insignificant.
289279
</t>
290280
</section>
281+
282+
<section title="Non-JSON Instances">
283+
<t>
284+
It is possible to use JSON Schema with a superset of the JSON Schema data model,
285+
where an instance may be outside any of the six JSON data types.
286+
</t>
287+
<t>
288+
In this case, annotations still apply; but validation keywords will not be useful,
289+
as they will always pass or always fail.
290+
</t>
291+
<t>
292+
A custom vocabulary may define support for a superset of the core data model.
293+
The schema itself may only be expressible in this superset;
294+
for example, to make use of the "const" keyword.
295+
</t>
296+
</section>
291297
</section>
292298

293299
<section title="JSON Schema Documents" anchor="schema-document">

0 commit comments

Comments
 (0)