Schema
A description of the values that a facet accepts. It uses a subset of JSON Schema: type, properties, required, items, enum, minimum, maximum, minLength, maxLength, pattern and format, nested up to a depth of 8.
Example
Section titled “Example”const schema = { type: 'object', properties: { date: { type: 'string', format: 'day' } }, required: ['date'] };Properties
Section titled “Properties”enum?: (string | number | boolean | null)[];The only values that are accepted.
format?
Section titled “format?”format?: SchemaFormat;For a text, a format that the text must have: day, time, date-time or uri.
items?
Section titled “items?”items?: Schema;For an array, the schema of its elements.
maximum?
Section titled “maximum?”maximum?: number;For a number, the largest accepted value.
maxLength?
Section titled “maxLength?”maxLength?: number;For a text, the largest accepted length.
minimum?
Section titled “minimum?”minimum?: number;For a number, the smallest accepted value.
minLength?
Section titled “minLength?”minLength?: number;For a text, the smallest accepted length.
pattern?
Section titled “pattern?”pattern?: string;For a text, a regular expression that the text must match.
properties?
Section titled “properties?”properties?: Record<string, Schema>;For an object, the schema of each property, by name.
required?
Section titled “required?”required?: string[];For an object, the names of the properties that must be present.
type?: SchemaType;The type of the value: string, number, integer, boolean, object, array or null.
