NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
crates.io · #894 most downloaded on crates.io
JSON schema validaton library
Last release today
06 Oct 2026
Ships fairly regularly
a new release about every 9 days
Nearly every release is documented
notes for 59 of the last 60 stable releases
1 version withdrawn
withdrawn after publishing
7 years old
137 releases · first in 2020
One column per quarter.
External resources not discovered within subresources of local $ref targets. #892
$ref targets. #892JsonTypeSet::len() and JsonTypeSet::remove() helpers for managing type sets.
JsonTypeSet::len() and JsonTypeSet::remove() helpers for managing type sets.$ref references. #892Stack overflow on empty $ref value. #886
$ref value. #886evaluate() top-level function for convenient access to structured validation output.
evaluate() top-level function for convenient access to structured validation output.contentEncoding values per RFC 4648: base64url, base32, base32hex, and base16. These encodings are now validated alongside the existing base64 support in Draft 6 and 7. #26validator.iter_errors(instance).into_errors(). It returns a ValidationErrors type that collects validation errors and implements std::error::Error. #451ValidationError fields are private; use instance(), kind(), instance_path(), and schema_path() instead of accessing struct fields directly.ErrorIterator is now a newtype wrapper instead of Box<dyn ValidationErrorIterator>.validate and other APIs returning Result<_, ValidationError> are 5–10% faster in some workloads due to the smaller error handle.evaluate: Avoiding deep clones of unmatched keyword values (e.g., title, description, examples) on every schema node evaluation by using Arc internally. Can be multiple times faster for schemas with large annotations.decimal.Decimal type in both schemas and instances. #319contentEncoding values per RFC 4648: base64url, base32, base32hex, and base16. These encodings are now validated alongside the existing base64 support in Draft 6 and 7. #26jsonschema_rs.validate() and Validator.validate() run 5–10% faster in some workloads.evaluate(): Avoiding deep clones of unmatched keyword values (e.g., title, description, examples) on every schema node evaluation. Can be multiple times faster for schemas with large annotations.CLI: Structured --output flag|list|hierarchical modes now stream newline-delimited JSON records with schema/instance metadata plus JSON Schema Output
--output flag|list|hierarchical modes now stream newline-delimited JSON records with schema/instance metadata plus JSON Schema Output v1 payloads (default text output remains human-readable).--errors-only flag to suppress successful validation output and only show failures.Validator::evaluate() API exposes JSON Schema Output v1 (flag/list/hierarchical) reports along with iterator helpers for annotations and errors.meta::validator_for() function to build validators for meta-schema validation with full Validator API access.Validator now implements Clone. #809Validator::apply(), Output, and BasicOutput types have been removed in favor of the richer evaluate() API.jsonschema_rs.evaluate(), Validator.evaluate(), and the Evaluation type for retrieving JSON Schema Output v1 (flag/list/hierarchical) formats along with annotations and errors.Validator type alias for union of all validator types (Draft4Validator | Draft6Validator | Draft7Validator | Draft201909Validator | Draft202012Validator).__eq__ and __hash__ methods to ValidationError and ReferencingError.__repr__ method stubs to all validator classes, Evaluation, Registry, and regex options classes.is_valid, validate, iter_errors, evaluate, validator_for).verbose_message attribute in ValidationError type stub.context field in ValidationErrorKind.OneOfMultipleValid type stub.ValidationErrorKind.MultipleOf.multiple_of - now correctly typed as int | float | Decimal to support arbitrary precision numbers.BREAKING: primitive_type module (deprecated since 0.30.0). Use jsonschema::types instead.
$schema URIs can now be used by registering their meta-schemas in the Registry via jsonschema::options().with_registry(). #664arbitrary-precision feature for exact numeric validation of large integers and decimals beyond standard floating-point limits. #103$schema URIs for drafts 04, 06, and 07 (e.g., https://json-schema.org/draft-07/schema). #802meta::is_valid now panics for unknown $schema values instead of defaulting to Draft 2020-12. meta::validate returns an error for unknown $schema values. Use meta::options().with_registry() to validate schemas against custom meta-schemas.Resource::from_contents no longer returns Result and always succeeds, since draft detection no longer fails for unknown $schema values.meta::try_is_valid and meta::try_validate. Use meta::is_valid and meta::validate instead.primitive_type module (deprecated since 0.30.0). Use jsonschema::types instead.required: short-circuit when the instance object has fewer properties than required keys.$schema URIs can now be used by registering their meta-schemas via the registry parameter in validator_for(). #664registry parameter to meta.is_valid() and meta.validate() for validating schemas against custom meta-schemas.meta module.$schema URIs for drafts 04, 06, and 07 (e.g., https://json-schema.org/draft-07/schema). #802meta.is_valid() and meta.validate() now raise ReferencingError for unknown $schema values instead of defaulting to Draft 2020-12. Use the registry parameter to validate against custom meta-schemas.required: short-circuit when the instance object has fewer properties than required keys.BREAKING: BasicOutput and Annotations no longer have lifetime parameters. Update type annotations from BasicOutput<'a> to BasicOutput and Annotations<
BasicOutput and Annotations no longer have lifetime parameters. Update type annotations from BasicOutput<'a> to BasicOutput and Annotations<'a> to Annotations.referencing: URI caching now avoids hash collisions and reduces lock contention.fluent-uri to 0.4.1.1.83.0.Send + Sync bounds from Retrieve/AsyncRetrieve on wasm32.draftX::meta::validator() helper so meta-schema validators lazy-init on wasm32 while native targets keep borrowing the cached jsonschema::meta::MetaValidator.xn-- labels, reject leading combining marks/uppercase prefixes, and enforce the latest JSON Schema punycode context rules.wasm32-unknown-unknown support. #785apply now reuses cached schema locations, URI fragments, and buffers for up to ~2.5x faster validation.$ref compilation deduplicates validator nodes, which decreases the memory usage and improves performance.apply on location-heavy workloads.unevaluatedProperties validation is 25-35% faster through optimized property marking and early-exit paths.unevaluatedProperties memory usage drastically reduced by eliminating redundant registry clones during compilation.unevaluatedItems validation is ~10% faster through early-exit optimizations and eliminating redundant validations in combinators.Validator::config to reduce the memory footprint.DRAFT4_META_VALIDATOR, DRAFT6_META_VALIDATOR, DRAFT7_META_VALIDATOR, DRAFT201909_META_VALIDATOR, and DRAFT202012_META_VALIDATOR statics. Use draftX::meta::validator() helper functions instead (e.g., draft7::meta::validator()).pyo3 to 0.27.xn-- labels, reject leading combining marks/uppercase prefixes, and enforce the latest JSON Schema punycode context rules.$ref compilation deduplicates validator nodes, which decreases the memory usage and improves performance.apply on location-heavy workloads.unevaluatedProperties validation is 25-35% faster through optimized property marking and early-exit paths.unevaluatedProperties memory usage drastically reduced by eliminating redundant registry clones during compilation.unevaluatedItems validation is ~10% faster through early-exit optimizations and eliminating redundant validations in combinators.BREAKING: instance_path segments are now unescaped when iterating. LocationSegment::Property now holds Cow<'_, str> and LocationSegment is no longer C
instance_path segments are now unescaped when iterating. LocationSegment::Property now holds Cow<'_, str> and LocationSegment is no longer Copy. #788### Changed - Bump fancy-regex to 0.16.
fancy-regex to 0.16.Added missing context field to ValidationErrorKind::OneOfMultipleValid.
context field to ValidationErrorKind::OneOfMultipleValid.enum.CLI: flag -d, --draft <4|6|7|2019|2020> to enforce a specific JSON Schema draft.
-d, --draft <4|6|7|2019|2020> to enforce a specific JSON Schema draft.--assert-format and --no-assert-format to toggle validation of format keywords.context for ValidationErrorKind::AnyOf and ValidationErrorKind::OneOfNotValid which contains errors for all subschemas, each inside a separate vector with an index matching subschema ID.multipleOf for float values.fancy-regex to 0.15.context for ValidationErrorKind.AnyOf and ValidationErrorKind.OneOfNotValid which contains errors for all subschemas, each inside a separate list with an index matching subschema ID.pyo3 to 0.25.multipleOf for float values.ValidationOptions::with_base_uri that allows for specifying a base URI for all relative references in the schema.
JsonType and JsonTypeSet.ValidationOptions::with_base_uri that allows for specifying a base URI for all relative references in the schema.pattern and patternProperties keywords.$ref without base URI.$ref. #725PrimitiveType and PrimitiveTypesBitMap.base_uri keyword argument that allows for specifying a base URI for all relative references in the schema.pattern and patternProperties keywords.$ref without base URI.pyo3 to 0.24.Hash, PartialOrd, Ord and serde::Serialize for Location.
Hash, PartialOrd, Ord and serde::Serialize for Location.Location::join public.All builder methods on ValidationOptions now take ownership of self instead of &mut self. This change enables better support for non-blocking retrieva
All builder methods on ValidationOptions now take ownership of self instead of &mut self.
This change enables better support for non-blocking retrieval of external resources during the process of building a validator.
Update your code to chain the builder methods instead of reusing the options instance:
// Before (0.28.x)
let mut options = jsonschema::options();
options.with_draft(Draft::Draft202012);
options.with_format("custom", my_format);
let validator = options.build(&schema)?;
// After (0.29.0)
let validator = jsonschema::options()
.with_draft(Draft::Draft202012)
.with_format("custom", my_format)
.build(&schema)?;
The Retrieve trait's retrieve method now accepts URI references as &Uri<String> instead of &Uri<&str>.
This aligns with the async version and simplifies internal URI handling. The behavior and available methods remain the same, this is purely a type-level change.
// Before
fn retrieve(&self, uri: &Uri<&str>) -> Result<Value, Box<dyn std::error::Error + Send + Sync>>
// After
fn retrieve(&self, uri: &Uri<String>) -> Result<Value, Box<dyn std::error::Error + Send + Sync>>
Simplified Registry creation API:
RegistryOptions::try_new and RegistryOptions::try_from_resources in favor of Registry::buildRegistry::try_with_resource_and_retriever - use Registry::options().retriever() instead// Before (0.28.x)
let registry = Registry::options()
.draft(Draft::Draft7)
.try_new(
"http://example.com/schema",
resource
)?;
let registry = Registry::options()
.draft(Draft::Draft7)
.try_from_resources([
("http://example.com/schema", resource)
].into_iter())?;
let registry = Registry.try_with_resource_and_retriever(
"http://example.com/schema",
resource,
retriever
)?;
// After (0.29.0)
let registry = Registry::options()
.draft(Draft::Draft7)
.build([
("http://example.com/schema", resource)
])?;
let registry = Registry::options()
.draft(Draft::Draft7)
.build([
("http://example.com/schema", resource)
])?;
let registry = Registry::options()
.retriever(retriever)
.build(resources)?;
resolve-async feature. #385referencing::Registry as jsonschema::Registry.ValidationOptions::with_registry that allows for providing a predefined referencing::Registry. #682Registry class for schema reuse and reference resolution.Panic when schema registry base URI contains an unencoded fragment.
Resolving external references that nested inside local references. #671
Handle fragment references within $id-anchored subschemas. #640
$id-anchored subschemas. #640Implement IntoIterator for Location to iterate over LocationSegment.
IntoIterator for Location to iterate over LocationSegment.FromIter for Location to build a Location from an iterator of LocationSegment.ValidationError::to_owned method for converting errors into owned versions.Implement ExactSizeIterator for PrimitiveTypesBitMapIterator.
ExactSizeIterator for PrimitiveTypesBitMapIterator.ValidationErrorKind with error-specific context data.retriever & mask arguments.Added masked() and masked_with() methods to ValidationError to support hiding sensitive data in error messages. #434
masked() and masked_with() methods to ValidationError to support hiding sensitive data in error messages. #4341.71.1.mask argument to validators for hiding sensitive data in error messages. #434ValidationError.kind and ValidationError.instance attributes. #650pyo3 to 0.23.### Documentation - Fix documentation for validate
validateReturn "Unknown specification" error on https-prefixed $schema for Draft 4, 5, 6. #629
https-prefixed $schema for Draft 4, 5, 6. #629https-prefixed $schema for Draft 4, 5, 6. #629Important: This release contains breaking changes. See the Migration Guide for details on transitioning to the new API.
Important: This release contains breaking changes. See the Migration Guide for details on transitioning to the new API.
Validator::iter_errors that iterates over all validation errors.ValidationErrorKind::JSONParse, ValidationErrorKind::InvalidReference, ValidationErrorKind::Schema, ValidationErrorKind::FileNotFound and ValidationErrorKind::Utf8.Validator::validate now returns the first error instead of an iterator in the Err variant.validate function.Re-export referencing::Error as ReferencingError. #614
referencing::Error as ReferencingError. #614Important: This release removes deprecated old APIs. See the Migration Guide for details on transitioning to the new API.
Important: This release removes deprecated old APIs. See the Migration Guide for details on transitioning to the new API.
draft201909, draft202012, and cli features.CompilationOptions, JSONSchema, PathChunkRef, JsonPointerNode, and SchemaResolverError aliases.jsonschema::compile, Validator::compile, ValidationOptions::compile, ValidationOptions::with_resolver, ValidationOptions::with_meta_schemas, ValidationOptions::with_document functions.SchemaResolver trait.Important: This release removes deprecated old APIs. See the Migration Guide for details on transitioning to the new API.
JSONSchema class.with_meta_schemas argument in multiple functions.Infinite recursion when using mutually recursive $ref in unevaluatedProperties.
$ref in unevaluatedProperties.Infinite recursion in some cases. #146
$ref interaction with $recursiveAnchor in Draft 2019-09.unevaluatedProperties with $recursiveRef & $dynamicRef.Incomplete external reference resolution.
Support $ref, $recursiveRef, and $dynamicRef in unevaluatedItems. #287
Partial support for unevaluatedItems, excluding references.
unevaluatedItems, excluding references.JsonPointer in favor of Location.PathChunkRef in favor of LocationSegment.JsonPointerNode in favor of LazyLocation.$ref or $dynamicRef).hostname & idn-hostname formats validation.apply.JsonPointerNode::to_vec without a replacement.unevaluatedItems, excluding references.validate_formats argument to all validator classes and validation functions. This allows overriding the draft-specific default behavior for format validation.ignore_unknown_formats argument to all validator classes and validation functions. When set to False, unrecognized formats will be reported as validation errors instead of being silently ignored.hostname & idn-hostname formats validation.### Performance - Speedup resolving.
Speedup json-pointer and relative-json-pointer formats validation.
json-pointer and relative-json-pointer formats validation.### Fixed - Removed dbg! macro.
dbg! macro.BREAKING: Custom retrievers now receive &Uri<&str> instead of &UriRef<&str>
&Uri<&str> instead of &UriRef<&str>once_cell to 1.20.regex to 1.11.time format validation (leap seconds and second fractions).duration format validation.$id without base. #547hostname format validation (double dot).idn-hostname format validation. #101hostname, date, time, date-time, and duration formats validation.pattern. #417Important: This release brings a complete rework of reference resolving which deprecates some older APIs. While backward compatibility is maintained f…
Important: This release brings a complete rework of reference resolving which deprecates some older APIs. While backward compatibility is maintained for now, users are encouraged to update their code. See the Migration Guide for details on transitioning to the new API.
$anchor support.$recursiveRef & $recursiveAnchor support in Draft 2019-09.$dynamicRef & $dynamicAnchor support in Draft 2020-12.$ref as URI, not URL, and additionally normalize them. #454$id. #264SchemaResolver trait and SchemaResolverError in favor of a simpler Retrieve that works with Box<dyn std::error::Error>.
In turn, it also deprecates ValidationOptions::with_resolver in favor of ValidationOptions::with_retrieverValidationOptions::with_document in favor of ValidationOptions::with_resource.unevaluatedProperties. #420iri & iri-reference validation.uri, iri, uri-reference, and iri-reference formats.Important: This release includes several deprecations and renames. While backward compatibility is maintained for now, users are encouraged to update…
Important: This release includes several deprecations and renames. While backward compatibility is maintained for now, users are encouraged to update their code. See the Migration Guide for details on transitioning to the new API.
jsonschema::draft4jsonschema::draft6jsonschema::draft7jsonschema::draft201909jsonschema::draft202012
Each module provides new(), is_valid(), and options() functions.jsonschema::options() function as a shortcut for jsonschema::Validator::options(), that allows for customization of the validation process.Debug implementation for SchemaNode opaque.jsonschema::validator_for and related functions return ValidationError<'static> in their Err variant.
This change makes possible to use the ? operator to return errors from functions where the input schema is defined.CompilationOptions to ValidationOptions for clarity.JSONSchema to Validator for clarity. #424JSONPointer to JsonPointer for consistency with naming conventions. #424jsonschema::compile to jsonschema::validator_for.CompilationOptions::compile to ValidationOptions::build.Old names are retained for backward compatibility but will be removed in a future release.
Draft4Validator, Draft6Validator, Draft7Validator, Draft201909Validator, and Draft202012Validator.validator_for function for automatic draft detection.JSONSchema class has been renamed to Validator. The old name is retained for backward compatibility but will be removed in a future release.JSONSchema class is deprecated. Use the validator_for function or draft-specific validators instead.
You can use validator_for instead of JSONSchema.from_str.jsonschema_rs.DRAFT4, jsonschema_rs.DRAFT6, jsonschema_rs.DRAFT7, jsonschema_rs.DRAFT201909, and jsonschema_rs.DRAFT202012 are deprecated in favor of draft-specific validator classes.### Fixed - ipv4 format validation. #512
ipv4 format validation. #512Combination of unevaluatedProperties with allOf and oneOf. #496
jsonschema::compile shortcut.1.70.uuid format validation.unevaluatedProperties with allOf and oneOf. #496cli feature in favor of a separate jsonschema-cli crate.draft201909 and draft202012 features. The relevant functionality is now enabled by default.uuid validation via uuid-simd.uuid format validation.unevaluatedProperties with allOf and oneOf. #496uuid validation.Changing base URI when $ref is present in drafts 7 and earlier.
$ref is present in drafts 7 and earlier.dbg! macro.Ignoring $schema in resolved references.
$schema in resolved references.maxItems, maxLength, maxProperties, maxContains, minItems, minLength, minProperties, minContains.with_meta_schemas() method. Meta schemas are included by default.$schema in resolved references.maxItems, maxLength, maxProperties, maxContains, minItems, minLength, minProperties, minContains.with_meta_schemas argument. Meta schemas are included by default.ErrorDescription::into_inner to retrieve the inner String value.
ErrorDescription::into_inner to retrieve the inner String value.Expose JsonPointerNode that can be converted into JSONPointer. This is needed for the upcoming custom validators support.
JsonPointerNode that can be converted into JSONPointer.
This is needed for the upcoming custom validators support.base64 to 0.22.clap to 4.5.fancy-regex to 0.13.fraction to 0.15.memchr to 2.7.once_cell to 1.19.percent-encoding to 2.3.regex to 1.10.url to 2.5.cli feature is enabled.CompilationOptions to support more ways to define custom format checkers (for example in Python bindings).
In turn it changes ValidationErrorKind::Format to contain a String instead of a &'static str.schema_path when multiple errors coming from the $ref keyword #426JSONPointer for validation errors by allocating the exact amount of memory needed.pyo3 to 0.21.schema_path when multiple errors coming from the $ref keyword #426Improved error messages for oneOf / anyOf keywords. #429
pyo3 to 0.19.oneOf / anyOf keywords. #429Replace lazy_static with once_cell.
base64 to 0.21.fancy-regex to 0.11.fraction to 0.13.iso8601 to 0.6.lazy_static with once_cell.unevaluatedProperties. (gated by the draft201909/draft202012 feature flags). #288$ref is now evaluated alongside
other keywords. #378Add a compilation option (should_ignore_unknown_formats()) that allows treating unknown formats as compilation errors.
should_ignore_unknown_formats()) that allows treating unknown formats as compilation errors.ValueError on validating dicts with non-string keys. #386pyo3 to 0.17.Library compilation with no default features. #356
pyo3-built incompatibilityiter_errors. #325pyo3 to 0.16.Allow HTTP(S) schema resolving with rustls. #353
rustls. #353Enable reqwest/native-tls by default to avoid validation errors caused by reqwest missing a TLS backend. #343
reqwest/native-tls by default to avoid validation errors caused by reqwest missing a TLS backend. #343The SchemaResolver trait to support resolving external schema references. #246
Optimize the loop implementation used for uniqueness check on short arrays.
itoa to 1.0. #337equal_arrays helper.false schemas.Make BasicOutput.is_valid public.
BasicOutput.is_valid public.JSONSchema.apply on schemas with additionalProperties, patternProperties, and properties combined.JSONSchema.apply on schemas with if and then (without else) keywords. #318JSONSchema.apply on some schemas with prefixItems and items. It panicked if items is an object and the length of prefixItems is greater than the length of the input array.JSONSchema, that lead to improvement in the compilation performance.multipleOf implementation, which now can short-circuit in some cases.uniqueItems keyword implementation.schema argument from all methods of the Validate trait.Support for prefixItems keyword. #303
prefixItems keyword. #303OutputUnit.### Fixed - Missing derive from serde.
derive from serde.duration format validator. #265
uuid format validator. #266duration format validator. #265format keyword. #261basic & flag output formatting styles. #100dependentRequired & dependentSchemas keywords. #286reqwest features.Draft201909 variant for the Draft enum that is available only under the draft201909 feature. This feature is considered private and should not be used outside of the testing context.
It allows us to add features from the 2019-09 Draft without exposing them in the public API. Therefore, support for this draft can be added incrementally.Draft enum is now marked as non_exhaustive.ValidationError::schema was removed and the calls replaced by proper errors.PrimitiveTypesBitMapIterator from 3 to 2 bytes. #282bytecount crate for maxLength & minLength keywords, and for the hostname format.JSONSchema.from_str method that accepts a string to construct a compiled schema.
Useful if you have a schema as string, because you don't have to call json.loads on your side - parsing will happen on the Rust side.jsonschema_rs.JSONSchema.__module__ to jsonschema_rs.ValueError: Unsupported type: 'tuple'.Display the original value in errors from minimum, maximum, exclusiveMinimum, exclusiveMaximum. #215
minimum, maximum, exclusiveMinimum, exclusiveMaximum. #215chrono to time==0.3.3 due to RUSTSEC-2020-0159 in older time versions that chrono depends on.Allow using empty arrays or arrays with non-unique elements for the enum keyword in schemas. #258
Support for custom format validators. #158
Report schema paths in validation errors - ValidationError.schema_path. #199
ValidationError message. #199BREAKING: Meta-schema validation for input schemas. By default, all input schemas are validated with their respective meta-schemas and instead of Comp
CompilationError there will be the usual ValidationError. #198CompilationError. Use ValidationError instead.The format validator incorrectly rejecting supported regex patterns. #230
format validator incorrectly rejecting supported regex patterns. #230Your coding agent can read these notes before it upgrades. Set up the MCP server →