Skip to content

Commit 8e5412b

Browse files
committed
Rework reference sections for new organization
Add an intro paragraph about reference keywords and their nature as indirect in-place applicators. "$ref" is no longer really targeted at recursive schemas, so tweak its wording slightly. Do a few further improvements to "$recurse" wording, particularly around root schemas and schema documents. Correct an apparent typo about a schema "against a schema", this is almost certainly supposed to be "against an instance", as the rest of the paragraph talks in terms of instance validation.
1 parent 22c316c commit 8e5412b

File tree

1 file changed

+21
-9
lines changed

1 file changed

+21
-9
lines changed

jsonschema-core.xml

+21-9
Original file line numberDiff line numberDiff line change
@@ -790,11 +790,19 @@
790790
</section>
791791
</section>
792792

793-
<section title='Schema References With "$ref"'>
793+
<section title="Schema References">
794+
<t>
795+
Two keywords are provided for referencing one schema from another, and
796+
for validating recursive structures through self-reference.
797+
Both of these keywords behave as
798+
<xref target="in-place">in-place applicators</xref>, except that the schema
799+
being applied is identified rather than appearing as all or part of the
800+
keyword's value.
801+
</t>
802+
794803
<section title='Direct References with "$ref"'>
795804
<t>
796-
The "$ref" keyword is used to reference a schema, and provides the ability
797-
to validate recursive structures through self-reference.
805+
The "$ref" keyword is used to reference a statically identified schema.
798806
</t>
799807
<t>
800808
An object schema with a "$ref" property MUST be interpreted as a "$ref"
@@ -809,15 +817,18 @@
809817
when they encounter a network-addressable URI.
810818
</t>
811819
<t>
812-
A schema MUST NOT be run into an infinite loop against a schema. For
820+
A schema MUST NOT be run into an infinite loop against an instance. For
813821
example, if two schemas "#alice" and "#bob" both have an "allOf" property
814822
that refers to the other, a naive validator might get stuck in an infinite
815823
recursive loop trying to validate the instance. Schemas SHOULD NOT make
816824
use of infinite recursive nesting like this; the behavior is undefined.
817825
</t>
818826
</section>
819827

820-
<section title='Recursive references with "$recurse"'>
828+
<section title='Recursive References with "$recurse"'>
829+
<t>
830+
The "$recurse" keyword is used to construct extensible recursive schemas.
831+
</t>
821832
<t>
822833
This keyword's value MUST be the boolean literal true.
823834
<cref>
@@ -831,16 +842,16 @@
831842
</t>
832843
<t>
833844
The presence of this keyword with a boolean true value indicates that,
834-
during processing, it MUST be treated as a reference to the
845+
during processing, it MUST be treated as a reference to the root of the
835846
<xref target="schema-documents">schema document</xref> where processing
836-
was initiated.
847+
was initiated. The current base URI is not relevant to "$recurse".
837848
</t>
838849
<t>
839850
This document, known as the entry point schema, is the schema document that
840851
was initially supplied to the implementation, as opposed to schema documents
841852
that were processed as a result of following a "$ref" reference. Note that
842853
even if processing began at a subschema within a document, the "$recurse"
843-
target MUST be the root of the document.
854+
target MUST be the root schema.
844855
</t>
845856
<t>
846857
Aside from the dynamic definition of the reference target, a "$recurse"
@@ -1092,7 +1103,8 @@
10921103
</t>
10931104
</section>
10941105

1095-
<section title="Keywords for Applying Subschemas in Place">
1106+
<section title="Keywords for Applying Subschemas in Place"
1107+
anchor="in-place">
10961108
<t>
10971109
These keywords apply subschemas to the same location in the instance
10981110
as the parent schema is being applied. They allow combining

0 commit comments

Comments
 (0)