Skip to content

Commit 0fa1ba2

Browse files
committed
Note undefined behavior with unknown $ref targets
The most common situation here, which are basically alternate names for "definitions" or "$defs", will generally work, but this makes clear that there is no obligation to attempt to guarantee the proper behavior in such situations. We might want to narrow this behavior down in the future, but for now this at least clearly removes any possible burdensome and totally impractical inferencing requirements.
1 parent bbc5916 commit 0fa1ba2

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed

jsonschema-core.xml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1540,6 +1540,29 @@
15401540
</t>
15411541
</section>
15421542

1543+
<section title="References to Possible Non-Schemas">
1544+
<t>
1545+
Subschema objects (or booleans) are recognized by their use with known
1546+
applicator keywords. These keywords may be the standard applicators
1547+
from this document, or extension keywords from a known vocabulary or
1548+
implementation-specific custom keywords.
1549+
</t>
1550+
<t>
1551+
Multi-level structures of unknown keywords are capable of introducing
1552+
nested subschemas, which would be subject to the processing rules for
1553+
"$id". Therefore, having a reference target in such an unrecognized
1554+
structure cannot be reliably implemented, and the resulting behavior
1555+
is undefined.
1556+
</t>
1557+
<t>
1558+
Note that single-level custom keywords with identical syntax and
1559+
semantics to "$defs" do not allow for any intervening "$id" keywords,
1560+
and therefore will behave correctly under implementations that attempt
1561+
to use any reference target as a schema. However, this behavior is
1562+
implementation-specific and MUST NOT be relied upon for interoperability.
1563+
</t>
1564+
</section>
1565+
15431566
<section title="Loading a referenced schema">
15441567
<t>
15451568
The use of URIs to identify remote schemas does not necessarily mean anything is downloaded,

jsonschema-validation.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -864,8 +864,9 @@
864864
</artwork>
865865
<postamble>
866866
Instances described by this schema should be strings containing HTML, using
867-
whatever character set the JSON string was decoded into (default is
868-
Unicode).
867+
whatever character set the JSON string was decoded into. Per section 8.1 of
868+
<xref target="RFC8259">RFC 8259</xref>, outside of an entirely closed
869+
system, this MUST be UTF-8.
869870
</postamble>
870871
</figure>
871872

0 commit comments

Comments
 (0)