Skip to content

Releases: Stranger6667/jsonschema

[Rust] Release 0.29.0

08 Feb 19:17
rust-v0.29.0
44e787f
Compare
Choose a tag to compare

Breaking Changes

  • 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:

    • Removed RegistryOptions::try_new and RegistryOptions::try_from_resources in favor of Registry::build
    • Removed Registry::try_with_resource_and_retriever - use Registry::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)?;

Added

  • Support non-blocking retrieval for external resources during schema resolution via the new resolve-async feature. #385
  • Re-export referencing::Registry as jsonschema::Registry.
  • ValidationOptions::with_registry that allows for providing a predefined referencing::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

08 Feb 21:10
python-v0.29.1
f6a4048
Compare
Choose a tag to compare

Packaging

  • Fix missing source distribution.

[Python] Release 0.29.0

08 Feb 19:35
python-v0.29.0
aeb98b9
Compare
Choose a tag to compare

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

24 Jan 15:35
rust-v0.28.3
f50299a
Compare
Choose a tag to compare

Fixed

  • Panic when schema registry base URI contains an unencoded fragment.

Performance

  • Fewer JSON pointer lookups.

[Python] Release 0.28.3

24 Jan 15:36
python-v0.28.3
33bce5a
Compare
Choose a tag to compare

Fixed

  • Panic when schema registry base URI contains an unencoded fragment.

Performance

  • Fewer JSON pointer lookups.

[Rust] Release 0.28.2

22 Jan 11:18
rust-v0.28.2
7c59034
Compare
Choose a tag to compare

Fixed

  • Resolving external references that are nested inside local references. #671
  • Resolving relative references with fragments against base URIs that also contain fragments. #666

Performance

  • Faster JSON pointer resolution.

[Python] Release 0.28.2

22 Jan 11:24
python-v0.28.2
e61c9f8
Compare
Choose a tag to compare

Fixed

  • Resolving external references that are nested inside local references. #671
  • Resolving relative references with fragments against base URIs that also contain fragments. #666

Performance

  • Faster JSON pointer resolution.

[Rust] Release 0.28.1

31 Dec 11:16
rust-v0.28.1
662dca4
Compare
Choose a tag to compare

Fixed

  • Handle fragment references within $id-anchored subschemas. #640

[Python] Release 0.28.1

31 Dec 12:28
python-v0.28.1
29b37f0
Compare
Choose a tag to compare

Fixed

  • Handle fragment references within $id-anchored subschemas. #640

[Rust] Release 0.28.0

29 Dec 14:09
rust-v0.28.0
2f31b07
Compare
Choose a tag to compare

Added

  • Implement IntoIterator for Location to iterate over LocationSegment.
  • Implement FromIter for Location to build a Location from an iterator of LocationSegment.
  • ValidationError::to_owned method for converting errors into owned versions.
  • Meta-schema validation support. #442