Skip to content

Commit 8d86c85

Browse files
authored
Merge pull request #1293 from handrews/plain-name-frags
Explain why plain name fragments are as they are and consolidate fragment syntax rules
2 parents e34bc36 + c4aed5e commit 8d86c85

File tree

1 file changed

+17
-8
lines changed

1 file changed

+17
-8
lines changed

jsonschema-core.xml

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
<!ENTITY RFC8288 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.8288.xml">
1313
<!ENTITY ldp SYSTEM "https://xml2rfc.tools.ietf.org/public/rfc/bibxml4/reference.W3C.REC-ldp-20150226.xml">
1414
<!ENTITY fragid-best-practices SYSTEM "https://xml2rfc.tools.ietf.org/public/rfc/bibxml4/reference.W3C.WD-fragid-best-practices-20121025.xml">
15+
<!ENTITY xptr-framework SYSTEM "https://bib.ietf.org/public/rfc/bibxml4/reference.W3C.REC-xptr-framework-20030325.xml">
1516
]>
1617
<?rfc toc="yes"?>
1718
<?rfc symrefs="yes"?>
@@ -513,7 +514,18 @@
513514
Per the W3C's
514515
<xref target="W3C.WD-fragid-best-practices-20121025">best practices for fragment identifiers</xref>,
515516
plain name fragment identifiers in "application/schema+json" are reserved for referencing
516-
locally named schemas. All fragment identifiers that do
517+
locally named schemas.
518+
</t>
519+
<t>
520+
Plain name fragments MUST start with a letter ([A-Za-z]) or underscore ("_"),
521+
followed by any number of letters, digits ([0-9]), hyphens ("-"),
522+
underscores ("_"), and periods ("."). This matches the US-ASCII part of XML's
523+
<xref target="xml-names">NCName production</xref>, which allows for compatibility
524+
with the recommended plain name <xref target="W3C.REC-xptr-framework-20030325">syntax</xref> for
525+
XML-based media types.
526+
</t>
527+
<t>
528+
All fragment identifiers that do
517529
not match the JSON Pointer syntax MUST be interpreted as
518530
plain name fragment identifiers.
519531
</t>
@@ -522,8 +534,6 @@
522534
"application/schema+json" document are specified
523535
in the <xref target="anchor">"$anchor" keyword</xref> section.
524536
</t>
525-
<t>
526-
</t>
527537
</section>
528538

529539
<section title="General Considerations">
@@ -1455,11 +1465,9 @@
14551465
need for "$dynamicAnchor".
14561466
</t>
14571467
<t>
1458-
If present, the value of this keyword MUST be a string and MUST start with
1459-
a letter ([A-Za-z]) or underscore ("_"), followed by any number of letters,
1460-
digits ([0-9]), hyphens ("-"), underscores ("_"), and periods (".").
1461-
This matches the US-ASCII part of XML's
1462-
<xref target="xml-names">NCName production</xref>.
1468+
If present, the value of these keywords MUST be a string and MUST conform
1469+
to the plain name fragment identifier syntax defined in section
1470+
<xref target="fragments" format="counter"></xref>.
14631471
<cref>
14641472
Note that the anchor string does not include the "#" character,
14651473
as it is not a IRI-reference. An "$anchor": "foo" becomes the
@@ -3555,6 +3563,7 @@ https://example.com/schemas/common#/$defs/allOf/1
35553563
&RFC7231;
35563564
&RFC8288;
35573565
&fragid-best-practices;
3566+
&xptr-framework;
35583567
<reference anchor="json-schema-validation">
35593568
<front>
35603569
<title>JSON Schema Validation: A Vocabulary for Structural Validation of JSON</title>

0 commit comments

Comments
 (0)