ArrayInputBuilder
Declares the element type of an array input.
Remarks
Section titled “Remarks”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.
Methods
Section titled “Methods”array()
Section titled “array()”array():
ArrayInputBuilder
Declares the elements as arrays; declare their element type on the returned builder.
Returns
Section titled “Returns”ArrayInputBuilder
json()
Section titled “json()”json(
parser):JsonInputBuilder
Declares the elements as JSON values parsed by a Zod type or parse function.
Parameters
Section titled “Parameters”parser
Section titled “parser”ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>> | JsonParse<any> | ZodMiniType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>
Zod type or parse function that parses each element.
Returns
Section titled “Returns”mandatory()
Section titled “mandatory()”mandatory(
value?):this
Marks the array itself as required.
Parameters
Section titled “Parameters”value?
Section titled “value?”boolean
Whether the array is required.
Returns
Section titled “Returns”this
This builder for chaining.
Default Value
Section titled “Default Value”trueobject()
Section titled “object()”object():
ObjectInputBuilder
Declares the elements as objects; declare their members on the returned builder.
Returns
Section titled “Returns”property()
Section titled “property()”Call Signature
Section titled “Call Signature”property(
type):DataTypeInputBuilder
Declares the elements as primitive or temporal values.
Parameters
Section titled “Parameters”PrimitiveDataType | TemporalDataType
Data type of each element.
Returns
Section titled “Returns”Call Signature
Section titled “Call Signature”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.
Parameters
Section titled “Parameters”Select data type.
options?
Section titled “options?”Select options, such as the format the options are resolved from.
Returns
Section titled “Returns”toDefinition()
Section titled “toDefinition()”toDefinition():
ArrayInputDefinition
Emits the array input Definition.

