Skip to content

Commit

Permalink
feat: Async retriever
Browse files Browse the repository at this point in the history
Signed-off-by: Dmitry Dygalo <[email protected]>
  • Loading branch information
Stranger6667 committed Feb 7, 2025
1 parent 6a529dd commit 10baec1
Show file tree
Hide file tree
Showing 9 changed files with 862 additions and 124 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
cache-all-crates: "true"
key: ${{ matrix.os }}

- run: cargo test --no-fail-fast
- run: cargo test --no-fail-fast --all-features

test-wasm:
name: Test on WASM
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

### Added

- Support async retrieval for external resources during schema resolution via the new `resolve-async` feature. [#385](https://github.com/Stranger6667/jsonschema/issues/385)
- Re-export `referencing::Registry` as `jsonschema::Registry`.
- `ValidationOptions::with_registry` that allows for providing a predefined `referencing::Registry`. [#682](https://github.com/Stranger6667/jsonschema/issues/682)

Expand Down
8 changes: 8 additions & 0 deletions crates/jsonschema-referencing/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ parking_lot = "0.12.3"
percent-encoding = "2.3.1"
serde_json.workspace = true

async-trait = { version = "0.1.86", optional = true }
futures = { version = "0.3.31", optional = true }

[features]
default = []
async = ["dep:async-trait", "dep:futures"]

[lints]
workspace = true

Expand All @@ -26,6 +33,7 @@ codspeed-criterion-compat = { version = "2.7", default-features = false }
criterion = { version = "0.5", default-features = false }
referencing_testsuite = { package = "jsonschema-referencing-testsuite", path = "../jsonschema-referencing-testsuite/" }
test-case = "3.3.1"
tokio = { version = "1", features = ["macros", "rt"] }

[[bench]]
harness = false
Expand Down
3 changes: 3 additions & 0 deletions crates/jsonschema-referencing/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,6 @@ pub use retriever::{DefaultRetriever, Retrieve};
pub(crate) use segments::Segments;
pub use specification::Draft;
pub use vocabularies::{Vocabulary, VocabularySet};

#[cfg(feature = "async")]
pub use retriever::AsyncRetrieve;
Loading

0 comments on commit 10baec1

Please sign in to comment.