minLength - sgpinkus/json-schema GitHub Wiki

THIS WIKI IS OBSOLETE. PLEASE SEE THE NEW JSON-SCHEMA-ORG/JSON-SCHEMA-SPEC REPOSITORY.



Description

A string instance is valid against minLength if and only if its length is greater 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.

Valid values

The value of minLength MUST be an integer. This integer MUST be greater than, or equal, to 0.

Example

Given this schema:

{
    "minLength": 16
}

the following instances are valid:

  • "abcdefghijklmnop";
  • "that is long enough";
  • "Mémé a été poussée dans les orties";

the following instances are invalid:

  • "hello world";
  • "too short, mate".
⚠️ **GitHub.com Fallback** ⚠️