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 <dmitry.dygalo@workato.com>
  • Loading branch information
Stranger6667 committed Sep 20, 2024
1 parent 6c4a0a5 commit fe85ce0
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 8 deletions.
30 changes: 26 additions & 4 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 @@ -84,7 +84,7 @@ assert_cmd = "2.0.14"
axum = { version = "0.7", features = ["http2"] }
bytes = "1.6"
float-cmp = "0.9.0"
jsonschema = "0.18.0"
jsonschema = "0.20.0"
lazy_static = "1.5.0"
predicates = "3.1.0"
regex = "1.10.5"
Expand Down
6 changes: 3 additions & 3 deletions tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,7 @@ async fn test_json_schema() {

const SCHEMA: &str = include_str!("../schema.json");
let schema_value: serde_json::Value = serde_json::from_str(SCHEMA).unwrap();
let schema = jsonschema::JSONSchema::compile(&schema_value).unwrap();
let validator = jsonschema::validator_for(&schema_value).unwrap();

let output_json: String = String::from_utf8(
tokio::task::spawn_blocking(move || {
Expand Down Expand Up @@ -761,14 +761,14 @@ async fn test_json_schema() {
let value_stats_success_breakdown: serde_json::Value =
serde_json::from_str(&output_json_stats_success_breakdown).unwrap();

if let Err(errors) = schema.validate(&value) {
if let Err(errors) = validator.validate(&value) {
for error in errors {
eprintln!("{error}");
}
panic!("JSON schema validation failed\n{output_json}");
}

if let Err(errors) = schema.validate(&value_stats_success_breakdown) {
if let Err(errors) = validator.validate(&value_stats_success_breakdown) {
for error in errors {
eprintln!("{error}");
}
Expand Down

0 comments on commit fe85ce0

Please sign in to comment.