A schema field definition for an array/list type.
The items property describes the element type — primitives, enums, objects, or nested arrays. Inferred as Array<InferFieldDef<items>>.
items
Array<InferFieldDef<items>>
const schema = { tags: { type: "array", items: { type: "string" } }, matrix: { type: "array", items: { type: "array", items: { type: "number" } } }} as const satisfies ObjectSchema; Copy
const schema = { tags: { type: "array", items: { type: "string" } }, matrix: { type: "array", items: { type: "array", items: { type: "number" } } }} as const satisfies ObjectSchema;
A FieldDef describing the type of each array element.
Optional
When true, the field accepts null and becomes optional.
true
null
Must be "array" to indicate a list/array field.
"array"
A schema field definition for an array/list type.
The
itemsproperty describes the element type — primitives, enums, objects, or nested arrays. Inferred asArray<InferFieldDef<items>>.Example