Skip to content
Open
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
36 changes: 36 additions & 0 deletions draft-vasters-json-structure-validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down Expand Up @@ -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
Expand Down