From f7775a63e259ab2a3bf1f9c8e0e4241f053a6bcb Mon Sep 17 00:00:00 2001 From: Greg Dennis Date: Tue, 29 Aug 2023 10:28:55 +1200 Subject: [PATCH 1/6] Plain name IRI fragments can use unicode (@handrews) --- jsonschema-core.md | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/jsonschema-core.md b/jsonschema-core.md index 15c03391..ef25582f 100644 --- a/jsonschema-core.md +++ b/jsonschema-core.md @@ -337,11 +337,26 @@ identifiers](#w3cwd-fragid-best-practices-20121025), plain name fragment identifiers in `application/schema+json` are reserved for referencing locally named schemas. -Plain name fragments MUST start with a letter ([A-Za-z]) or underscore ("\_"), -followed by any number of letters, digits ([0-9]), hyphens ("-"), underscores -("\_"), and periods ("."). This matches the US-ASCII part of XML's [NCName -production](#xml-names), which allows for compatibility with the recommended -plain name [syntax](#w3crec-xptr-framework-20030325) for XML-based media types. +Plain name fragments MUST follow XML's [NCName production](#xml-names), which +allows for compatibility with the recommended plain name +[syntax](#W3C.REC-xptr-framework-20030325) for XML-based media types. For +convenience, the `NCName`` syntax is reproduced here in ABNF form, using +a minimal set of rules: [^20] + +[^20] Note that the previous syntax for plain name fragment is a subset of this syntax, which used only the first line of each of the `NCNameStartChar`` and `NCNameChar`` rules. + +```abnf +NCName = NCNameStartChar *NCNameChar +NCNameStartChar = "_" / ALPHA + / %xC0-D6 / %xD8-F6 / %xF8-2FF + / %x370-37D / %x37F-1FFF + / %x200C-200D / %x2070-218F + / %x2C00-2FEF / %x3001-D7FF + / %xF900-FDCF / %xFDF0-FFFD + / %x10000-EFFFF +NCNameChar = NCNameStartChar / "-" / "." / DIGIT + / %xB7 / %x0300-036F / %x203F-2040 +``` All fragment identifiers that do not match the JSON Pointer syntax MUST be interpreted as plain name fragment identifiers. From 9c01998b7114d7119fdd6fa06444b959e900e996 Mon Sep 17 00:00:00 2001 From: Greg Dennis Date: Tue, 29 Aug 2023 10:32:08 +1200 Subject: [PATCH 2/6] remove extra backtick --- jsonschema-core.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jsonschema-core.md b/jsonschema-core.md index ef25582f..2891722d 100644 --- a/jsonschema-core.md +++ b/jsonschema-core.md @@ -340,7 +340,7 @@ named schemas. Plain name fragments MUST follow XML's [NCName production](#xml-names), which allows for compatibility with the recommended plain name [syntax](#W3C.REC-xptr-framework-20030325) for XML-based media types. For -convenience, the `NCName`` syntax is reproduced here in ABNF form, using +convenience, the `NCName` syntax is reproduced here in ABNF form, using a minimal set of rules: [^20] [^20] Note that the previous syntax for plain name fragment is a subset of this syntax, which used only the first line of each of the `NCNameStartChar`` and `NCNameChar`` rules. From 5ddd9214da5ef7861e8f8a0de6ab1da43d51c209 Mon Sep 17 00:00:00 2001 From: Greg Dennis Date: Tue, 29 Aug 2023 10:33:00 +1200 Subject: [PATCH 3/6] remove more extra backticks --- jsonschema-core.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jsonschema-core.md b/jsonschema-core.md index 2891722d..5d0c30bb 100644 --- a/jsonschema-core.md +++ b/jsonschema-core.md @@ -337,13 +337,13 @@ identifiers](#w3cwd-fragid-best-practices-20121025), plain name fragment identifiers in `application/schema+json` are reserved for referencing locally named schemas. -Plain name fragments MUST follow XML's [NCName production](#xml-names), which +Plain name fragments MUST follow XML's [`NCName` production](#xml-names), which allows for compatibility with the recommended plain name [syntax](#W3C.REC-xptr-framework-20030325) for XML-based media types. For convenience, the `NCName` syntax is reproduced here in ABNF form, using a minimal set of rules: [^20] -[^20] Note that the previous syntax for plain name fragment is a subset of this syntax, which used only the first line of each of the `NCNameStartChar`` and `NCNameChar`` rules. +[^20] Note that the previous syntax for plain name fragment is a subset of this syntax, which used only the first line of each of the `NCNameStartChar` and `NCNameChar` rules. ```abnf NCName = NCNameStartChar *NCNameChar From 33391a707c822967d015aa8ff3f47f411e6f8154 Mon Sep 17 00:00:00 2001 From: Greg Dennis Date: Tue, 29 Aug 2023 10:45:37 +1200 Subject: [PATCH 4/6] update changelog (imported from #1360) --- jsonschema-core.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jsonschema-core.md b/jsonschema-core.md index 5d0c30bb..dbc7d77e 100644 --- a/jsonschema-core.md +++ b/jsonschema-core.md @@ -3301,7 +3301,7 @@ to the document. ### draft-bhutton-json-schema-next - `contains` now applies to objects as well as arrays -- Use IRIs instead of URIs +- Use IRIs instead of URIs, including allowing unicode in plain-name fragments - Clarify that detecting duplicate IRIs for different schemas SHOULD raise an error - Consolidate and clarify the syntax and rationale for plain-name fragments - "$id" MUST be an absolute-IRI, without any fragment, even an empty one From f01e1a0805e65942e20b239e5ce197aeb8eadd69 Mon Sep 17 00:00:00 2001 From: Greg Dennis Date: Thu, 31 Aug 2023 10:44:01 +1200 Subject: [PATCH 5/6] Update jsonschema-core.md Co-authored-by: Jason Desrosiers --- jsonschema-core.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jsonschema-core.md b/jsonschema-core.md index dbc7d77e..317a2151 100644 --- a/jsonschema-core.md +++ b/jsonschema-core.md @@ -339,7 +339,7 @@ named schemas. Plain name fragments MUST follow XML's [`NCName` production](#xml-names), which allows for compatibility with the recommended plain name -[syntax](#W3C.REC-xptr-framework-20030325) for XML-based media types. For +[syntax](#w3crec-xptr-framework-20030325) for XML-based media types. For convenience, the `NCName` syntax is reproduced here in ABNF form, using a minimal set of rules: [^20] From 4df2e4d828ca8ec14b2d75ea6ba0ceb38f19f250 Mon Sep 17 00:00:00 2001 From: Greg Dennis Date: Mon, 4 Sep 2023 12:42:40 +1200 Subject: [PATCH 6/6] remove superfluous note --- jsonschema-core.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/jsonschema-core.md b/jsonschema-core.md index 317a2151..992df3c7 100644 --- a/jsonschema-core.md +++ b/jsonschema-core.md @@ -341,9 +341,7 @@ Plain name fragments MUST follow XML's [`NCName` production](#xml-names), which allows for compatibility with the recommended plain name [syntax](#w3crec-xptr-framework-20030325) for XML-based media types. For convenience, the `NCName` syntax is reproduced here in ABNF form, using -a minimal set of rules: [^20] - -[^20] Note that the previous syntax for plain name fragment is a subset of this syntax, which used only the first line of each of the `NCNameStartChar` and `NCNameChar` rules. +a minimal set of rules: ```abnf NCName = NCNameStartChar *NCNameChar