A fast, lightweight JSON Schema validator for Node.js and browsers with full support for the latest drafts.
z-schema is a JSON Schema validator written in JavaScript for Node.js and browser environments. It validates JSON data against formal schema definitions to ensure data conforms to expected structure, types, and constraints. The library solves the problem of programmatically verifying data correctness and consistency in applications that rely on JSON.
JavaScript and TypeScript developers working on Node.js backends, frontend web applications, or full-stack projects that require rigorous JSON data validation. It's also suitable for tooling authors building CLI tools or development utilities.
Developers choose z-schema for its comprehensive support of the latest JSON Schema drafts, its high performance, and its flexible API offering multiple validation modes (sync/async, throw/safe). Its active maintenance and full test suite compliance provide confidence in specification correctness.
JSON Schema validator written in JavaScript for NodeJS and Browsers
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Supports all JSON Schema drafts from draft-04 to 2020-12, ensuring compatibility with both legacy and modern schema definitions, as highlighted in the full draft support feature.
Offers four validator variants (sync/async, throw/safe) via ZSchema.create() options, allowing developers to choose patterns that fit their application's error management needs.
Includes schema compilation and caching through validateSchema(), which can improve validation speed for repeated checks with referenced schemas, as noted in the schema compilation section.
Provides a command-line interface for direct validation of schema and data files, useful for scripting and development workflows without writing custom code.
Requires Node.js 22 or later, which excludes environments using older LTS versions and may force upgrades or limit adoption in legacy projects.
Major version upgrades (e.g., v9 introducing ZSchema.create() over new ZSchema()) introduce significant shifts, necessitating careful migration as documented in MIGRATION.md.
Cloning the repository requires the --recursive flag for submodules, adding complexity for new contributors compared to standard GitHub workflows.