Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 1768b0c

Browse files
Clarify string length is code points
1 parent 4a2b6ad commit 1768b0c

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

‎specs/jsonschema-core.md‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,14 +135,14 @@ depending on the type:
135135
- *array*: An ordered list of instances, from the JSON "array" value
136136
- *number*: An arbitrary-precision, base-10 decimal number value, from the JSON
137137
"number" value
138-
- *string*: A string of Unicode code points, from the JSON "string" value
138+
- *string*: A string of [Unicode] code points, from the JSON "string" value
139139

140140
Whitespace and formatting concerns, including different lexical representations
141141
of numbers that are equal within the data model, are thus outside the scope of
142142
JSON Schema. Extensions to JSON Schema that wish to work with such differences
143143
in lexical representations SHOULD define keywords to precisely interpret
144144
formatted strings within the data model rather than relying on having the
145-
original JSON representation Unicode characters available.
145+
original JSON representation available.
146146

147147
Since an object cannot have two properties with the same key, behavior for a
148148
JSON document that tries to define two properties with the same key in a single
@@ -335,14 +335,14 @@ considered to be implicitly anchored at either end. All regular expression
335335
keywords in this specification and its companion documents are un-anchored.
336336

337337
Regular expressions SHOULD be built with the "u" flag (or equivalent) to provide
338-
Unicode support, or processed in such a way which provides Unicode support as
338+
[Unicode] support, or processed in such a way which provides Unicode support as
339339
defined by ECMA-262.
340340

341341
Furthermore, given the high disparity in regular expression constructs support,
342342
schema authors SHOULD limit themselves to the following regular expression
343343
tokens:
344344

345-
- individual Unicode characters, as defined by the [JSON
345+
- individual Unicode code points, as defined by the [JSON
346346
specification][rfc8259];
347347
- simple atoms: `.` (any character except line terminator);
348348
- simple character classes (`[abc]`), range character classes (`[a-z]`);
@@ -2628,3 +2628,4 @@ to the document.
26282628
[rfc8259]: https://www.rfc-editor.org/info/rfc8259
26292629
[rfc8288]: https://www.rfc-editor.org/info/rfc8288
26302630
[application/schema+json]: ../ietf/json-schema-media-types.md
2631+
[Unicode]: https://www.unicode.org/versions/Unicode16.0.0/

‎specs/jsonschema-validation.md‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,8 @@ The value of this keyword MUST be a non-negative integer.
218218
A string instance is valid against this keyword if its length is less than, or
219219
equal to, the value of this keyword.
220220

221-
The length of a string instance is defined as the number of its characters as
222-
defined by [RFC 8259][rfc8259].
221+
The length of a string instance is defined as the number of [Unicode] code
222+
points that make up the string.
223223

224224
#### `minLength`
225225

@@ -228,8 +228,8 @@ The value of this keyword MUST be a non-negative integer.
228228
A string instance is valid against this keyword if its length is greater than,
229229
or equal to, the value of this keyword.
230230

231-
The length of a string instance is defined as the number of its characters as
232-
defined by [RFC 8259][rfc8259].
231+
The length of a string instance is defined as the number of [Unicode] code
232+
points that make up the string.
233233

234234
Omitting this keyword has the same behavior as a value of 0.
235235

@@ -917,3 +917,4 @@ to the document.
917917

918918
[rfc3987]: https://www.rfc-editor.org/info/rfc3987
919919
[rfc8259]: https://www.rfc-editor.org/info/rfc8259
920+
[Unicode]: https://www.unicode.org/versions/Unicode16.0.0/

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /