Maxlength - sgpinkus/json-schema GitHub Wiki
THIS WIKI IS OBSOLETE. PLEASE SEE THE NEW JSON-SCHEMA-ORG/JSON-SCHEMA-SPEC REPOSITORY.
A string instance is valid against maxLength if and only if its length is lower than, or equal to, this keyword's value.
The length of a string instance is defined as the number of its characters as per the JSON RFC.
The value of maxLength MUST be an integer. This integer MUST be greater than, or equal, to 0.
Given this schema:
{
"maxLength": 4
}
the following instances are valid:
- "abcd";
- "";
- "Mémé";
the following instances are invalid:
- "hello world";
- "too long for you".