Skip to Content
@jetio/schema-builder docs are live 🎉
API ReferenceStringSchemaBuilder

StringSchemaBuilder

Provides the universal and metadata methods ($id, title, description, enum, const, anyOf, allOf, oneOf, not, if, errorMessage, extend, build, …) plus the string-specific constraints below. Per type locking, only this type’s constraints are accessible once the builder is locked to string.

MethodParametersReturnsDescription
.minLength(len)number or $dataSchemaBuilderMinimum string length
.maxLength(len)number or $dataSchemaBuilderMaximum string length
.pattern(regex)string or RegExp or $dataSchemaBuilderRegex pattern
.format(name)string or $dataSchemaBuilderFormat validation (email, uri, date-time, etc.)
Last updated on