Skip to content

Commit b50f94d

Browse files
committed
test: update dependencies and related code
Signed-off-by: David Bernard <[email protected]>
1 parent 2e68342 commit b50f94d

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

cdevents-sdk/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ boon = "0.6"
2525
glob = "0.3"
2626
proptest = "1"
2727
regex = "1.10"
28-
rstest = "0.21"
28+
rstest = "0.22"
2929

3030
[features]
3131
default = ["cloudevents"]

cdevents-sdk/tests/specs.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ impl EventsSchemas {
2020
let mut mapping = HashMap::new();
2121

2222
//HACK to resolve invalid `$ref: "/schema/links/embeddedlinksarray.json"`
23-
compiler.register_url_loader("https", Box::new(HackUrlLoader{}));
23+
compiler.use_loader(Box::new(HackUrlLoader{}));
2424

2525
for entry in glob("../cdevents-specs/*/schemas/*.json").expect("Failed to read glob pattern") {
2626
let schemapath = entry.unwrap();
@@ -66,6 +66,10 @@ impl UrlLoader for HackUrlLoader {
6666
let path = url.replace("https://cdevents.dev/schema", "../cdevents-specs/spec-v0.4/schemas/");
6767
let jsonschema: serde_json::Value = serde_json::from_str(&std::fs::read_to_string(path)?)?;
6868
Ok(jsonschema)
69+
} else if url.starts_with("file://") {
70+
let path = url.replace("file://", "");
71+
let jsonschema: serde_json::Value = serde_json::from_str(&std::fs::read_to_string(path)?)?;
72+
Ok(jsonschema)
6973
} else {
7074
Err(format!("fail to load {url}").into())
7175
}

0 commit comments

Comments
 (0)