String
Last updated
Was this helpful?
Last updated
Was this helpful?
Represents JS primitive type string
.
The format
keyword allows for basic semantic validation on certain kinds of string values that are commonly used. This allows values to be constrained beyond what can do.
Possible values:
date, email, hostname, uri, uri-reference, ipv4, ipv6, mac, date-time, time, egex, color, credit-card, phone.
The keyword for setting minimal length on string prop is minLength
. The value of this keyword MUST be a non-negative integer.
A string instance is valid against this keyword if its length is greater than, or equal to, the value of this keyword. The length of a string instance is defined as the number of its characters as defined by RFC 7159 [RFC7159].
Omitting this keyword has the same behavior as a value of 0.
The keyword for setting maximal length on string prop is maxLength
. The value of this keyword MUST be a non-negative integer.
A string instance is valid against this keyword if its length is less than, or equal to, the value of this keyword. The length of a string instance is defined as the number of its characters as defined by RFC 7159 [RFC7159].
The keyword for setting pattern is pattern
.
The value of this keyword MUST be a string. This string SHOULD be a valid regular expression, according to the ECMA 262 regular expression dialect. A string instance is considered valid if the regular expression matches the instance successfully. Recall: regular expressions are not implicitly anchored.
The keyword for setting secret is secret
.
The value of this keyword MUST be a boolean - true or false.
The keyword for setting multiline is multiline
.
The value of this keyword can be either boolean or number. Number value controls quantity of rows to be displayed.