diff --git a/draft-vasters-json-structure-validation.md b/draft-vasters-json-structure-validation.md index 7e6d516..d4c4825 100644 --- a/draft-vasters-json-structure-validation.md +++ b/draft-vasters-json-structure-validation.md @@ -43,6 +43,13 @@ normative: ECMA Standards: ECMA-262 target: https://www.ecma-international.org/publications-and-standards/standards/ecma-262/ title: "ECMAScript\xAE Language Specification" + UNICODE_ANNEX_29: + author: + - org: The Unicode Consortium + date: '2025-08-17' + target: https://www.unicode.org/reports/tr29/ + title: "Unicode Standard Annex #29" + informative: @@ -177,6 +184,35 @@ This section defines the validation keywords applicable to schemas with the type `string`. The `maxLength` keyword is not included as it is part of JSON Structure Core and is not redefined here. +### `maxGraphemes` {#maxGraphemes} + +A string is valid if its number of Unicode grapheme clusters - as defined in +Chapter 3 of Unicode Standard Annex #29 {{UNICODE_ANNEX_29}} - not exceed this +value. The value of `maxGraphemes` MUST be a non-negative integer. + +The purpose of `maxGraphemes` is to specify the maximum length of perceptible +characters in form elements that is understandable to humans. + +Example: + +~~~json +{ "type": "string", "maxGraphemes": 3 } +~~~ + +### `minGraphemes` {#minGraphemes} + +A string is valid if its number of Unicode grapheme clusters - as defined in +Chapter 3 of Unicode Standard Annex #29 - is at least the integer value +specified in `minGraphemes`. The value of `minGraphemes` MUST be a +non-negative integer. + +Example: + +~~~json +{ "type": "string", "minGraphemes": 2 } +~~~ + + ### `minLength` {#minLength} A string is valid if its length is at least the integer value specified in