Skip to content

ArrayInputBuilder

Declares the element type of an array input.

Call exactly one of array(), object(), property() or json() to set the element type; a subsequent call replaces the earlier one. An array without an element type is emitted as an array of optional strings.

InputBuilder.addArray

array(): ArrayInputBuilder

Declares the elements as arrays; declare their element type on the returned builder.

ArrayInputBuilder


json(parser): JsonInputBuilder

Declares the elements as JSON values parsed by a Zod type or parse function.

ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>> | JsonParse<any> | ZodMiniType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>

Zod type or parse function that parses each element.

JsonInputBuilder


mandatory(value?): this

Marks the array itself as required.

boolean

Whether the array is required.

this

This builder for chaining.

true

object(): ObjectInputBuilder

Declares the elements as objects; declare their members on the returned builder.

ObjectInputBuilder


property(type): DataTypeInputBuilder

Declares the elements as primitive or temporal values.

PrimitiveDataType | TemporalDataType

Data type of each element.

DataTypeInputBuilder

property(type, options?): SelectInputBuilder

Declares the elements as select values; declare the options on the returned builder, or resolve them from a well-known format via options.format.

SelectDataType

Select data type.

SelectInputOptions

Select options, such as the format the options are resolved from.

SelectInputBuilder


toDefinition(): ArrayInputDefinition

Emits the array input Definition.

ArrayInputDefinition