Validates that a string field ends with the specified suffix
⚠️ Only applicable to string fields
The suffix the string must end with
Optional
errorMessage: stringOptional custom error message
// String field example
a.string().validate(v => v.endsWith("-suffix", 'String must end with -suffix'))
Validates that a string field matches the specified regular expression pattern
⚠️ Only applicable to string fields
The regex pattern the string must match
Optional
errorMessage: stringOptional custom error message
// String field example
a.string().validate(v => v.matches("^[a-zA-Z0-9]+$", 'String must match the regex pattern'))
Validates that a string field does not exceed the specified length
⚠️ Only applicable to string fields
The maximum length allowed
Optional
errorMessage: stringOptional custom error message
// String field example
a.string().validate(v => v.maxLength(100, 'String must be at most 100 characters'))
Validates that a string field has at least the specified length
⚠️ Only applicable to string fields
The minimum length required
Optional
errorMessage: stringOptional custom error message
// String field example
a.string().validate(v => v.minLength(5, 'String must be at least 5 characters'))
Validates that a string field starts with the specified prefix
⚠️ Only applicable to string fields
The prefix the string must start with
Optional
errorMessage: stringOptional custom error message
// String field example
a.string().validate(v => v.startsWith("prefix-", 'String must start with prefix-'))
Interface for string validation methods without any exclusions