Interface ArrayFieldDef

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>>.

const schema = {
tags: { type: "array", items: { type: "string" } },
matrix: { type: "array", items: { type: "array", items: { type: "number" } } }
} as const satisfies ObjectSchema;
interface ArrayFieldDef {
    items: FieldDef;
    nullable?: boolean;
    type: "array";
}

Properties

Properties

items: FieldDef

A FieldDef describing the type of each array element.

nullable?: boolean

When true, the field accepts null and becomes optional.

type: "array"

Must be "array" to indicate a list/array field.