jsonschema

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

Library
Cargo
v0.58.1
822 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
89 /100 Excellent
Development Activity 96
Maintenance 100
Community 60
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
86 /100 Excellent
Architecture 88
Code Quality 90
Innovation 87
Learning Curve 78

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 9 apps in this directory

TypeScript
82%
Other

AFFiNE

Collaboration · Note Taking · Productivity

73,040

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
67
Dependency
Built with
TypeScript 82%
Rust 11%
Updated 5 days ago
Python
67%
Apache 2.0

Agent Control

AI Agents

314

An open-source runtime control plane for AI agents — define safety guardrails once, apply them across agents built on LangChain, CrewAI, Google ADK, or AWS Strands, and update controls without redeploying code.

View details
74
Repo Health
71
Technical
67
Dependency
Built with
Python 67%
TypeScript 32%
Updated 4 days ago
Go
59%
Apache 2.0

Cog

AI Development · Developer Tools · Devops

9,484

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

View details
85
Repo Health
88
Technical
69
Dependency
Built with
Go 59%
Rust 17%
HTML 13%
Updated 1 weeks ago
Rust
73%
Other

iii

Developer Tools · Devops

18,814

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

View details
87
Repo Health
85
Technical
65
Dependency
Built with
Rust 73%
TypeScript 16%
Updated 5 days ago
Rust
56%
Apache 2.0

Magnitude

AI Development · Developer Tools

5,285

An open source inference engine that profiles your hardware, recommends the best local models, and tunes them for the coding agent you already use.

View details
78
Repo Health
83
Technical
71
Dependency
Built with
Rust 56%
TypeScript 18%
Python 11%
Updated 4 days ago
Rust
77%
AGPL 3.0

Spacedrive

Collaboration · File Storage

39,041

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

View details
56
Repo Health
84
Technical
63
Dependency
Built with
Rust 77%
TypeScript 20%
Updated 2 months ago
Rust
47%
MIT

Svix

Automation · Developer Tools

3,423

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
90
Repo Health
77
Technical
67
Dependency
Built with
Rust 47%
C# 15%
Updated 1 weeks ago
Rust
79%
Apache 2.0

TensorZero

Ab Testing Experimentation · AI Development · Monitoring

11,717

TensorZero unifies the LLM gateway, observability, evaluation, optimization, and experimentation stack behind a single OpenAI-compatible API, built in Rust for sub-millisecond p99 latency.

View details
53
Repo Health
87
Technical
69
Dependency
Built with
Rust 79%
TypeScript 15%
Updated 3 months ago
OCaml
73%
MPL 2.0

Terrateam

Developer Tools · Devops

1,285

GitOps automation for Terraform, Pulumi, and IaC at scale

View details
86
Repo Health
72
Technical
74
Dependency
Built with
OCaml 73%
HCL 19%
Updated 5 days ago

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