Skip to content

Plain name IRI fragments can use unicode (markdown version) #1430

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Sep 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 19 additions & 6 deletions jsonschema-core.md
Original file line number Diff line number Diff line change
Expand Up @@ -337,11 +337,24 @@ 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](#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:

```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.
Expand Down Expand Up @@ -3286,7 +3299,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
Expand Down