Skip to content

Reference

Utils — OCF Zod schemas

Runtime parse helpers that load codegen’d Zod schemas for OCF objects and validate unknown input before batch operations.

ocfZodSchemas wires JSON-schema-backed validation: getOcfSchema, parseOcfObject, parseOcfEntityInput, OCF_OBJECT_SCHEMA_PATHS, resolveOcfSchemaDir, and a test-only resetOcfSchemaRegistryForTests.

Parse failures surface as Zod errors (wrapped or raw depending on caller)—treat as validation failures alongside OcpValidationError.

Source