Interface ObjectFieldDef

A schema field definition for a nested object type.

The fields property is itself an ObjectSchema, enabling arbitrarily deep nesting.

const schema = {
geo: {
type: "object",
fields: {
lat: { type: "number" },
lng: { type: "number" }
}
}
} as const satisfies ObjectSchema;
interface ObjectFieldDef {
    fields: ObjectSchema;
    nullable?: boolean;
    type: "object";
}

Properties

Properties

fields: ObjectSchema

The nested ObjectSchema describing the object's shape.

nullable?: boolean

When true, the field accepts null and becomes optional.

type: "object"

Must be "object" to indicate a nested object field.