Skip to content

Commit

Permalink
Merge pull request #1430 from json-schema-org/handrews/iri-anchors
Browse files Browse the repository at this point in the history
Plain name IRI fragments can use unicode (markdown version)
  • Loading branch information
gregsdennis authored Sep 12, 2023
2 parents 8552177 + 4df2e4d commit de65b76
Showing 1 changed file with 19 additions and 6 deletions.
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

0 comments on commit de65b76

Please sign in to comment.