diff --git a/content/2020-12/validation/minLength.markdown b/content/2020-12/validation/minLength.markdown index 76245536..55fd4540 100644 --- a/content/2020-12/validation/minLength.markdown +++ b/content/2020-12/validation/minLength.markdown @@ -16,49 +16,3 @@ related: - vocabulary: format-annotation keyword: format --- - -The `minLength` keyword is used to specify the minimum length of a string. It defines the minimum number of characters that a valid string must have to satisfy the schema. - -* Applies only to string data types. -* Value must be a non-negative integer. -* String length is counted in characters, not bytes. -* Validation succeeds if the string length is greater than or equal to the specified `minLength`. - -## Examples - -{{}} -{ - "$schema": "https://json-schema.org/draft/2020-12/schema", - "type": "string", - "minLength": 5 -} -{{}} - -{{}} -"This is a valid string" -{{}} - -{{}} -"foo" -{{}} - -{{}} -{ - "$schema": "https://json-schema.org/draft/2020-12/schema", - "type": ["string", "number"], - "minLength": 3 -} - -{{}} - -{{}} -"foo" -{{}} - -{{}} -"hi" -{{}} - -{{}} -55 -{{}} \ No newline at end of file