Search for a command to run...
JSON Schema type builder that produces in-memory JSON Schema objects while inferring matching TypeScript types. Schemas compose like TypeScript types and align with the compiler's static checking rules, giving a single source of truth for both compile-time and runtime validation.
TypeBox stands out from schema-first libraries like Zod by emitting standard JSON Schema directly, which integrates with OpenAPI generation, Fastify's validation layer, and any tool expecting JSON Schema. Widely adopted with thousands of npm dependents. The Schema submodule provides a lightweight validator supporting drafts from 3 through 2020-12, and the Value submodule adds typed operations: Parse, Clone, Encode, Decode, Diff, and Patch.
Key capabilities:
REST and RPC services use TypeBox to validate request payloads and keep TypeScript types in sync with runtime schemas. Teams adopt it for generating API contracts from types, integrating with Fastify or OpenAPI tooling, and maintaining JSON Schema interoperability alongside strong typing.