Releases: Stranger6667/jsonschema
Releases · Stranger6667/jsonschema
[Rust] Release 0.29.0
Breaking Changes
-
All builder methods on
ValidationOptions
now take ownership ofself
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'sretrieve
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:- Removed
RegistryOptions::try_new
andRegistryOptions::try_from_resources
in favor ofRegistry::build
- Removed
Registry::try_with_resource_and_retriever
- useRegistry::options().retriever()
instead - Registry creation is now consistently done through the builder pattern
// 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)?;
- Removed
Added
- Support non-blocking retrieval for external resources during schema resolution via the new
resolve-async
feature. #385 - Re-export
referencing::Registry
asjsonschema::Registry
. ValidationOptions::with_registry
that allows for providing a predefinedreferencing::Registry
. #682
Performance
- Significantly improved validator compilation speed by using pointer-based references to schema fragments instead of cloning them during traversal.
- Faster anchors & sub-resources lookups during validator compilation.
[Python] Release 0.29.1
Packaging
- Fix missing source distribution.
[Python] Release 0.29.0
Added
- Added
Registry
class for schema reuse and reference resolution.
Performance
- Significantly improved validator compilation speed by using pointer-based references to schema fragments instead of cloning them during traversal.
[Rust] Release 0.28.3
Fixed
- Panic when schema registry base URI contains an unencoded fragment.
Performance
- Fewer JSON pointer lookups.
[Python] Release 0.28.3
Fixed
- Panic when schema registry base URI contains an unencoded fragment.
Performance
- Fewer JSON pointer lookups.
[Rust] Release 0.28.2
[Python] Release 0.28.2
[Rust] Release 0.28.1
Fixed
- Handle fragment references within
$id
-anchored subschemas. #640
[Python] Release 0.28.1
Fixed
- Handle fragment references within
$id
-anchored subschemas. #640
[Rust] Release 0.28.0
Added
- Implement
IntoIterator
forLocation
to iterate overLocationSegment
. - Implement
FromIter
forLocation
to build aLocation
from an iterator ofLocationSegment
. ValidationError::to_owned
method for converting errors into owned versions.- Meta-schema validation support. #442