Declarative schema for describing the shape of an object attribute.
Used with @ObjectAttribute to provide both runtime validation (via Zod) and compile-time TypeScript type inference (via InferObjectSchema).
@ObjectAttribute
Each key maps to a FieldDef describing the field's type, nesting, and nullability.
Important: Always declare schemas with as const satisfies ObjectSchema to preserve literal types for accurate type inference.
as const satisfies ObjectSchema
const mySchema = { name: { type: "string" }, score: { type: "number" }, status: { type: "enum", values: ["active", "inactive"] }} as const satisfies ObjectSchema; Copy
const mySchema = { name: { type: "string" }, score: { type: "number" }, status: { type: "enum", values: ["active", "inactive"] }} as const satisfies ObjectSchema;
Declarative schema for describing the shape of an object attribute.
Used with
@ObjectAttributeto provide both runtime validation (via Zod) and compile-time TypeScript type inference (via InferObjectSchema).Each key maps to a FieldDef describing the field's type, nesting, and nullability.
Important: Always declare schemas with
as const satisfies ObjectSchemato preserve literal types for accurate type inference.