Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Update jsonschema to 0.20.0 #579

Merged
merged 1 commit into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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