{"id":17973828,"url":"https://github.com/stranger6667/jsonschema","last_synced_at":"2026-10-06T01:34:42.496Z","repository":{"id":38328414,"uuid":"245613208","full_name":"Stranger6667/jsonschema","owner":"Stranger6667","description":"A high-performance JSON Schema validator for Rust","archived":false,"fork":false,"pushed_at":"2026-10-02T23:10:50.000Z","size":13610,"stargazers_count":824,"open_issues_count":24,"forks_count":133,"subscribers_count":8,"default_branch":"master","last_synced_at":"2026-10-03T05:43:26.573Z","etag":null,"topics":["jsonschema","python","rust","validation","webassembly"],"latest_commit_sha":null,"homepage":"https://jsonschema.dygalo.dev/","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Stranger6667.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"claude":null,"gemini":null,"cursor":null,"copilot":null,"dco":null,"cla":null,"disclosure":null},"funding":{"github":"Stranger6667"}},"created_at":"2020-03-07T10:35:43.000Z","updated_at":"2026-10-02T23:07:05.000Z","dependencies_parsed_at":"2026-10-02T22:35:59.804Z","dependency_job_id":null,"html_url":"https://github.com/Stranger6667/jsonschema","commit_stats":{"total_commits":540,"total_committers":41,"mean_commits":"13.170731707317072","dds":0.5018518518518518,"last_synced_commit":"8dc33ea41ad7a19b4c5fb67126448e101b6a9316"},"previous_names":["stranger6667/jsonschema-rs"],"tags_count":391,"template":false,"template_full_name":null,"purl":"pkg:github/Stranger6667/jsonschema","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Stranger6667%2Fjsonschema","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Stranger6667%2Fjsonschema/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Stranger6667%2Fjsonschema/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Stranger6667%2Fjsonschema/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Stranger6667","download_url":"https://codeload.github.com/Stranger6667/jsonschema/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Stranger6667%2Fjsonschema/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":343072799,"owners_count":37972789,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-08-22T15:14:58.755Z","status":"online","status_checked_at":"2026-10-03T02:00:07.567Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["jsonschema","python","rust","validation","webassembly"],"created_at":"2024-10-29T17:03:29.560Z","updated_at":"2026-10-06T01:34:42.491Z","avatar_url":"https://github.com/Stranger6667.png","language":"Rust","funding_links":["https://github.com/sponsors/Stranger6667"],"categories":[],"sub_categories":[],"readme":"# jsonschema\n\n[\u003cimg alt=\"crates.io\" src=\"https://img.shields.io/crates/v/jsonschema.svg?style=flat-square\u0026color=fc8d62\u0026logo=rust\" height=\"20\"\u003e](https://crates.io/crates/jsonschema)\n[\u003cimg alt=\"docs.rs\" src=\"https://img.shields.io/badge/docs.rs-jsonschema-66c2a5?style=flat-square\u0026labelColor=555555\u0026logo=docs.rs\" height=\"20\"\u003e](https://docs.rs/jsonschema)\n[\u003cimg alt=\"build status\" src=\"https://img.shields.io/github/actions/workflow/status/Stranger6667/jsonschema/ci.yml?branch=master\u0026style=flat-square\" height=\"20\"\u003e](https://github.com/Stranger6667/jsonschema/actions?query=branch%3Amaster)\n[\u003cimg alt=\"codecov.io\" src=\"https://img.shields.io/codecov/c/gh/Stranger6667/jsonschema?logo=codecov\u0026style=flat-square\u0026token=B1EnafGlRL\" height=\"20\"\u003e](https://app.codecov.io/github/Stranger6667/jsonschema)\n[\u003cimg alt=\"Supported Dialects\" src=\"https://img.shields.io/endpoint?url=https%3A%2F%2Fbowtie.report%2Fbadges%2Frust-jsonschema%2Fsupported_versions.json\u0026style=flat-square\"\u003e](https://bowtie.report/#/implementations/rust-jsonschema)\n\nA high-performance JSON Schema validator for Rust.\n\n```rust\nuse serde_json::json;\n\nfn main() -\u003e Result\u003c(), Box\u003cdyn std::error::Error\u003e\u003e {\n    let schema = json!({\"maxLength\": 5});\n    let instance = json!(\"foo\");\n\n    // One-off validation\n    assert!(jsonschema::is_valid(\u0026schema, \u0026instance));\n    assert!(jsonschema::validate(\u0026schema, \u0026instance).is_ok());\n\n    // Build \u0026 reuse (faster)\n    let validator = jsonschema::validator_for(\u0026schema)?;\n\n    // Fail on first error\n    assert!(validator.validate(\u0026instance).is_ok());\n\n    // Iterate over errors\n    for error in validator.iter_errors(\u0026instance) {\n        eprintln!(\"Error: {error}\");\n        eprintln!(\"Location: {}\", error.instance_path());\n    }\n\n    // Boolean result\n    assert!(validator.is_valid(\u0026instance));\n\n    // Structured output (JSON Schema Output v1)\n    let evaluation = validator.evaluate(\u0026instance);\n    for annotation in evaluation.iter_annotations() {\n        eprintln!(\n            \"Annotation at {}: {:?}\",\n            annotation.schema_location,\n            annotation.annotations.value()\n        );\n    }\n\n    // Generated validators are significantly faster than runtime ones,\n    // so prefer them when the schema is known at build time.\n    // Requires the `macros` feature.\n    // Inline schema, or `path = \"schema.json\"` to load from a file\n    #[jsonschema::validator(schema = r#\"{\"maxLength\": 5}\"#)]\n    struct Short;\n\n    assert!(Short::is_valid(\u0026instance));\n    Short::validate(\u0026instance)?;\n\n    Ok(())\n}\n```\n\nYou also can use it from the command line via the [jsonschema-cli](https://github.com/Stranger6667/jsonschema/tree/master/crates/jsonschema-cli) crate.\n\n```console\n$ jsonschema-cli schema.json -i instance.json\n```\n\nSee more usage examples in the [documentation](https://docs.rs/jsonschema).\n\n\u003e ⚠️ **Upgrading from older versions?** Check our [Migration Guide](https://github.com/Stranger6667/jsonschema/blob/master/MIGRATION.md) for key changes.\n\n## Playground\n\nIf you'd like to try `jsonschema`, you can check the WebAssembly-powered [playground](https://jsonschema.dygalo.dev/) to see the results instantly.\n\n## Highlights\n\n- 📚 Full support for popular JSON Schema drafts\n- 🔧 Custom keywords and format validators\n- ⚡ Compile-time validators for Rust, Python and Ruby extension modules\n- 🌐 Blocking \u0026 non-blocking remote reference fetching (network/file)\n- 📦 Schema bundling into Compound Schema Documents, and `$ref` dereferencing\n- 🎨 Structured Output v1 reports (flag/list/hierarchical)\n- ✨ Meta-schema validation for schema documents, including custom metaschemas\n- 🧮 Experimental schema canonicalization\n- 🧩 Validation of custom in-memory JSON representations\n- 🔗 Bindings for [Python](https://github.com/Stranger6667/jsonschema/tree/master/crates/jsonschema-py) and [Ruby](https://github.com/Stranger6667/jsonschema/tree/master/crates/jsonschema-rb)\n- 🚀 WebAssembly support\n- 💻 Command Line Interface\n\n### Supported drafts\n\nThe following drafts are supported:\n\n- [![Draft 2020-12](https://img.shields.io/endpoint?url=https%3A%2F%2Fbowtie.report%2Fbadges%2Frust-jsonschema%2Fcompliance%2Fdraft2020-12.json)](https://bowtie.report/#/implementations/rust-jsonschema)\n- [![Draft 2019-09](https://img.shields.io/endpoint?url=https%3A%2F%2Fbowtie.report%2Fbadges%2Frust-jsonschema%2Fcompliance%2Fdraft2019-09.json)](https://bowtie.report/#/implementations/rust-jsonschema)\n- [![Draft 7](https://img.shields.io/endpoint?url=https%3A%2F%2Fbowtie.report%2Fbadges%2Frust-jsonschema%2Fcompliance%2Fdraft7.json)](https://bowtie.report/#/implementations/rust-jsonschema)\n- [![Draft 6](https://img.shields.io/endpoint?url=https%3A%2F%2Fbowtie.report%2Fbadges%2Frust-jsonschema%2Fcompliance%2Fdraft6.json)](https://bowtie.report/#/implementations/rust-jsonschema)\n- [![Draft 4](https://img.shields.io/endpoint?url=https%3A%2F%2Fbowtie.report%2Fbadges%2Frust-jsonschema%2Fcompliance%2Fdraft4.json)](https://bowtie.report/#/implementations/rust-jsonschema)\n\nYou can check the current status on the [Bowtie Report](https://bowtie.report/#/implementations/rust-jsonschema).\n\n## Notable Users\n\n- Tauri: [Config validation](https://github.com/tauri-apps/tauri/blob/c901d9fdf932bf7c3c77e9d3097fabb1fe0712af/crates/tauri-cli/src/helpers/config.rs#L173)\n- Apollo Router: [Config file validation](https://github.com/apollographql/router/blob/855cf6cc0757ca6176970ddf3ae8c98c87c632d1/apollo-router/src/configuration/schema.rs#L120)\n- qsv: [CSV record validation with custom keyword \u0026 format validator](https://github.com/jqnatividad/qsv/blob/6b6985065a1270f767d881b13aa2a27fae1958fb/src/cmd/validate.rs#L630)\n\n## Performance\n\n`jsonschema` outperforms other Rust JSON Schema validators in most scenarios. The numbers below are for the runtime validator, which compiles a schema into a reusable `Validator`:\n\n- **75-692x** faster than `valico` and **10-78x** faster than `jsonschema_valid` for complex schemas (**\u003e1,000,000x** on FHIR)\n- Generally **2.8-40x** faster than `boon`, **\u003e280x** on FHIR, and **\u003e5000x** for recursive schemas\n\nWhen the schema is known at build time, the `#[jsonschema::validator]` macro (`macros` feature) generates a specialized validator at compile time. This avoids schema compilation at runtime and validates roughly **2.3-10x** faster than the runtime validator across our benchmark schemas.\n\nFor detailed benchmarks, see our [full performance comparison](https://github.com/Stranger6667/jsonschema/tree/master/crates/benchmark-suite).\n\n## Cargo features\n\n| Feature | Default | Enables |\n|---|---|---|\n| `resolve-http` | ✅ | Fetching remote references over HTTP |\n| `resolve-file` | ✅ | Reading references from the filesystem |\n| `tls-aws-lc-rs` | ✅ | TLS provider for `resolve-http` |\n| `idna` | ✅ | The `idn-hostname` and `idn-email` formats |\n| `tls-ring` | | `ring` as the TLS provider instead of `aws-lc-rs` |\n| `resolve-async` | | Non-blocking reference resolution |\n| `arbitrary-precision` | | Arbitrarily large integers and exact decimal values |\n| `macros` | | The `#[jsonschema::validator]` compile-time validator |\n| `pyo3` | | Validating Python objects in place, and `backend = Pyo3` for the macro |\n| `magnus` | | Validating Ruby objects in place, and `backend = Magnus` for the macro |\n| `jsonb` | | Validating Postgres `jsonb` values in place |\n\nTurning off `idna` drops the IDNA and ICU dependencies; `idn-hostname` and `idn-email` are then\ntreated as unknown formats.\n\n## Minimum Supported Rust Version (MSRV)\n\nThis crate requires Rust 1.85.0 or later.\n\n## TLS Configuration\n\nBy default, `jsonschema` uses `aws-lc-rs` as the TLS cryptography provider, which is the default one in `reqwest`.\n\n### Using Ring Instead\n\nYou can opt into using `ring` as the TLS provider:\n\n```toml\n[dependencies]\njsonschema = {\n    version = \"0.42\",\n    default-features = false,\n    features = [\"resolve-http\", \"resolve-file\", \"tls-ring\"]\n}\n```\n\n**NOTE:** If both `tls-aws-lc-rs` and `tls-ring` features are enabled, `aws-lc-rs` takes precedence.\n\n## Acknowledgements\n\nThis library draws API design inspiration from the Python [`jsonschema`](https://github.com/python-jsonschema/jsonschema) package. We're grateful to the Python `jsonschema` maintainers and contributors for their pioneering work in JSON Schema validation.\n\n## Support\n\nIf you have questions, need help, or want to suggest improvements, please use [GitHub Discussions](https://github.com/Stranger6667/jsonschema/discussions).\n\n## Sponsorship\n\nIf you find `jsonschema` useful, please consider [sponsoring its development](https://github.com/sponsors/Stranger6667).\n\n## Contributing\n\nWe welcome contributions! Here's how you can help:\n\n- Share your use cases\n- Implement missing keywords\n- Fix failing test cases from the [JSON Schema test suite](https://bowtie.report/#/implementations/rust-jsonschema)\n\nSee [CONTRIBUTING.md](https://github.com/Stranger6667/jsonschema/blob/master/CONTRIBUTING.md) for more details.\n\n## License\n\nLicensed under [MIT License](https://github.com/Stranger6667/jsonschema/blob/master/LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstranger6667%2Fjsonschema","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstranger6667%2Fjsonschema","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstranger6667%2Fjsonschema/lists"}