Skip to content

Commit

Permalink
chore: Update jsonschema to 0.20.0
Browse files Browse the repository at this point in the history
Signed-off-by: Dmitry Dygalo <[email protected]>
  • Loading branch information
Stranger6667 committed Sep 20, 2024
1 parent 8b2566e commit 7d7d1eb
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ http-types = "2.12.0"
humantime = "2.1.0"
itertools = "0.13.0"
json5 = "0.4.1"
jsonschema = { version = "0.19.1", default-features = false }
jsonschema = { version = "0.20", default-features = false }
keyed-set = "1.0.0"
lazy_static = "1.5.0"
libc = "0.2.158"
Expand Down
4 changes: 2 additions & 2 deletions plugins/zenoh-plugin-rest/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ fn main() {
);

let schema = serde_json::to_value(schema_for!(Config)).unwrap();
let schema = jsonschema::JSONSchema::compile(&schema).unwrap();
let validator = jsonschema::validator_for(&schema).unwrap();
let config = std::fs::read_to_string("config.json5").unwrap();
let config: serde_json::Value = serde_json::from_str(&config).unwrap();
if let Err(es) = schema.validate(&config) {
if let Err(es) = validator.validate(&config) {
let es = es.map(|e| format!("{}", e)).collect::<Vec<_>>().join("\n");
panic!("config.json5 schema validation error: {}", es);
};
Expand Down
4 changes: 2 additions & 2 deletions plugins/zenoh-plugin-storage-manager/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ fn main() {
);

let schema = serde_json::to_value(schema_for!(PluginConfig)).unwrap();
let schema = jsonschema::JSONSchema::compile(&schema).unwrap();
let validator = jsonschema::validator_for(&schema).unwrap();
let config = std::fs::read_to_string("config.json5").unwrap();
let config: serde_json::Value = serde_json::from_str(&config).unwrap();
if let Err(es) = schema.validate(&config) {
if let Err(es) = validator.validate(&config) {
let es = es.map(|e| format!("{}", e)).collect::<Vec<_>>().join("\n");
panic!("config.json5 schema validation error: {}", es);
};
Expand Down

0 comments on commit 7d7d1eb

Please sign in to comment.