jsonschema

A high-performance JSON Schema validator for Rust with Python, Ruby, and WASM bindings

Library
Cargo
v0.49.9
804stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
90/100Excellent
Development Activity100
Maintenance100
Community60
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
86/100Excellent
Architecture88
Code Quality90
Innovation87
Learning Curve78

jsonschema is a Rust crate for validating JSON documents against JSON Schema, supporting Draft 4, 6, 7, 2019-09, and 2020-12. It compiles a schema into a reusable Validator that can be run repeatedly against many instances, and also ships a #[jsonschema::validator] macro that generates a specialized validator at compile time for schemas known ahead of time, avoiding runtime compilation entirely for a further 3-13x speedup over the already-fast runtime path.

Beyond the core Rust API, the project is a monorepo of bindings and tools built on the same validation engine: a Python package (jsonschema-rs), a Ruby gem, a WebAssembly build with a hosted playground, and a standalone CLI crate. It supports custom keywords and format validators, blocking and non-blocking remote $ref resolution over network or file, and Structured Output v1 reports (flag/list/hierarchical), making it usable both as an embedded validation library and as a general-purpose schema-checking tool.

What You Get

  • A Validator type built once from a schema (validator_for) and reused across many validate/is_valid/iter_errors calls
  • A #[jsonschema::validator] macro (via the macros feature) that generates a specialized, compile-time validator from an inline or file-based schema
  • Support for Draft 4, 6, 7, 2019-09, and 2020-12, with custom keyword and format validator hooks
  • Blocking and non-blocking remote reference resolution over network or filesystem
  • Structured Output v1 reports (flag/list/hierarchical) via the evaluate/iter_annotations API
  • Official Python, Ruby, and WebAssembly bindings plus a standalone jsonschema-cli crate, all built on the same core crate

Common Use Cases

  • Validating configuration files (e.g. Tauri or Apollo Router-style config validation) against a JSON Schema at startup
  • Validating API request/response payloads in a Rust web service before further processing
  • Using the compile-time #[jsonschema::validator] macro to eliminate runtime schema-compilation overhead in hot paths
  • Validating CSV or tabular records against a schema with custom keyword validators (as used by the qsv CLI)
  • Running ad-hoc schema validation from the command line via the jsonschema-cli crate without writing any Rust code

Under The Hood

Architecture - The workspace (Cargo.toml, members = ["crates/*"]) splits the core validation engine (crates/jsonschema) from jsonschema-referencing (reference resolution), jsonschema-regex, the proc-macro implementation (jsonschema-macros/jsonschema-macros-core), and per-language bindings (jsonschema-py, jsonschema-rb, jsonschema-wasm) plus jsonschema-cli. Each binding crate wraps the same core Validator rather than reimplementing validation logic, so drafts and keywords stay consistent across languages.

Tech Stack - Pure Rust (88.7% of the codebase) on top of serde/serde_json, with ahash for hashing; the crate’s default TLS provider is aws-lc-rs with an opt-in tls-ring feature for remote $ref fetching. MSRV is pinned at Rust 1.85.0, and workspace-wide Clippy pedantic lints are enabled with unsafe_code and unreachable_pub set to warn.

Code Quality - A dedicated jsonschema-testsuite crate plus jsonschema-testsuite-codegen generates tests from the official JSON Schema test suite, and a companion benchmark-suite crate tracks performance against valico, jsonschema_valid, and boon. Codecov is wired into CI, and the project publishes live spec-compliance results per draft via the Bowtie report.

API Design - The primary API is deliberately small: is_valid/validate for one-off checks, validator_for to build a reusable Validator, and iter_errors/evaluate for detailed or structured-output reporting. The optional #[jsonschema::validator] macro lets a schema known at compile time skip runtime compilation entirely while keeping the same is_valid/validate call shape, which the maintainers acknowledge was directly inspired by the Python jsonschema package’s API.

Used by 6 apps in this directory

TypeScript
88%
Other

AFFiNE

Productivity · Project Management · Note Taking

71,668

Write, draw, and plan in one infinite canvas — the open-source alternative to Notion and Miro that keeps your data yours.

View details
91
Repo Health
87
Technical
68
Dependency
Built with
TypeScript88%
Updated today
Go
59%
Apache 2.0

Cog

AI Development · Devops · Developer Tools

9,459

An open-source CLI that packages machine learning models into standard, production-ready Docker containers — no Dockerfile wrangling, no CUDA version hell.

View details
91
Repo Health
88
Technical
70
Dependency
Built with
Go59%
Rust16%
HTML13%
Updated today
Rust
72%
Other

iii

Developer Tools · Devops

18,604

Compose, extend, and observe every backend service in real time using three primitives: Workers, Functions, and Triggers.

View details
86
Repo Health
85
Technical
69
Dependency
Built with
Rust72%
TypeScript17%
Updated yesterday
Rust
77%
AGPL 3.0

Spacedrive

File Storage · Collaboration

38,790

One file manager for all your devices and clouds — powered by a Virtual Distributed File System built in Rust.

View details
60
Repo Health
84
Technical
65
Dependency
Built with
Rust77%
TypeScript20%
Updated 3 weeks ago
Rust
49%
MIT

Svix

Developer Tools · Automation

3,359

Open source, self-hostable webhook infrastructure that handles delivery, retries, HMAC signing, and multi-tenant event management so you never have to build a webhooks system from scratch.

View details
91
Repo Health
77
Technical
70
Dependency
Built with
Rust49%
C#15%
Updated today
OCaml
78%
MPL 2.0

Terrateam

Devops · Developer Tools

1,263

GitOps automation for Terraform, Pulumi, and IaC at scale

View details
86
Repo Health
72
Technical
79
Dependency
Built with
OCaml78%
HCL16%
Updated yesterday

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search