Length bounds count characters, never bytes
A limit measured in bytes would depend on the alphabet the author writes in, so the same word would fit one implementation and not another.
The rule
Normative: this is the rule
- A string config value shorter than its schema's
minLengthor longer than itsmaxLengthMUST be refused withR6_CONFIG_INVALIDatnode.{id}.config.{key}. - Both bounds MUST count Unicode code points, never bytes.
What it means
A length bound is measured against how many code points a string is written in, not how many bytes it takes up. A value that is well within a bound when counted one way can be over it when counted the other, and the two counts diverge exactly for the text a byte-based check would punish hardest: text written outside the single-byte range.
Example
A key's schema requires at least five code points; the value assigned to it is four characters long, eight bytes in a multi-byte encoding:
{"type": "string", "minLength": 5}"äöüß"Four code points is short of the minimum of five, even though the same value is eight bytes long.
Why
Recorded under OPEN-25.
Rule identifiers are permanent and are never renumbered. Each implementation publishes its own standing against these rules; this specification does not.spec 1.0 · R6.g · changed in spec 1.0