NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI · #1809 most downloaded on PyPI
A high-performance JSON Schema validator for Python
Last release 8 days ago
10 Sep 2026
Ships fairly regularly
a new release about every 9 days
Nearly every release is documented
notes for 60 of the last 60 stable releases
1 version withdrawn
withdrawn after publishing
6 years old
130 releases · first in 2020
One column per quarter.
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. #788instance_path segments are now unescaped when iterating. #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.Return "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 #426Support subclasses of Python dicts #427
dicts #427Expose drafts 2019-09 and 2020-12 to Python
pyo3 to 0.20.Improved error messages for oneOf / anyOf keywords. #429
pyo3 to 0.19.oneOf / anyOf keywords. #429Build wheels for Linux(glibc) x86_64/i686, Windows x64/x86, and macOS x86_64/aarch64.
pyo3 to 0.18.### Added - Support for Python 3.11
Add 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.Optimize the loop implementation used for uniqueness check on short arrays.
itoa to 1.0. #337equal_arrays helper.false schemas.### 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'.iter_errors to iterate all errors. #236
iter_errors to iterate all errors. #236Display 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
Additional attributes to ValidationError. They are message, schema_path and instance_path. #197
ValidationError. They are message, schema_path and instance_path. #197pyo3 to 0.14.1.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. #230Support for look-around patterns. #183
email format validation. Relevant test case from the JSONSchema test suite - email.json.The propertyNames validator now contains the parent object in its instance attribute instead of individual properties as strings.
propertyNames validator now contains the parent object in its instance attribute instead of individual properties as strings.additionalProperties validator. After - Additional properties are not allowed ('faz' was unexpected), before - False schema does not allow '"faz"'.additionalProperties validator emits a single error for all unexpected properties instead of separate errors for each unexpected property.ValidationError.instance_path is now a separate struct, that can be transformed to Vec<String> or JSON Pointer of type String.instance_path attributes are pointing to the proper location.Nothing published for this version
Incorrect handling of \w and \W character groups in pattern keywords. #180
\w and \W character groups in pattern keywords. #180\\w) in pattern keywords.Missing validation errors after the 1st one in additionalProperties validators.
additionalProperties validators.rayon in items keyword as it gives significant overhead for a general case.additionalProperties / properties / patternProperties validators. #173with_meta_schemas argument for is_valid and update docstrings.validate function.items and additionalProperties validators.Exclude unnecessary files from source code distribution.
Cache for documents loaded via the $ref keyword. #75
$ref keyword. #75$id values with trailing # symbol. #163-V/--validator options from the CLI. They were no-op and never worked.$ref keyword. #75$id values with trailing # symbol. #163pip install jsonschema_rs on platforms that we don't have wheels for.
#159Your coding agent can read these notes before it upgrades. Set up the MCP server →