From 0586efc89f669336b683dbe1e4c643228a8e487b Mon Sep 17 00:00:00 2001 From: Leo Vernisse Date: Wed, 30 Oct 2024 15:08:11 +0100 Subject: [PATCH] chore: upgrade jsonschema to 0.26 (#1130) --- Cargo.lock | 28 +++++++++--------------- bin/nanocld/Cargo.toml | 2 +- bin/nanocld/src/repositories/resource.rs | 6 +---- 3 files changed, 12 insertions(+), 24 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 90a087186..804e9d941 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -115,12 +115,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "anyhow" -version = "1.0.90" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37bf3594c4c988a53154954629820791dde498571819ae4ca50ca811e060cc95" - [[package]] name = "anymap2" version = "0.13.0" @@ -345,18 +339,18 @@ checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "bit-set" -version = "0.5.3" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" +checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3" dependencies = [ "bit-vec", ] [[package]] name = "bit-vec" -version = "0.6.3" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" +checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" [[package]] name = "bitflags" @@ -1016,9 +1010,9 @@ dependencies = [ [[package]] name = "fancy-regex" -version = "0.13.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "531e46835a22af56d1e3b66f04844bed63158bc094a628bec1d321d9b4c44bf2" +checksum = "6e24cb5a94bcae1e5408b0effca5cd7172ea3c5755049c5f3af4cd283a165298" dependencies = [ "bit-set", "regex-automata", @@ -1806,12 +1800,11 @@ dependencies = [ [[package]] name = "jsonschema" -version = "0.24.0" +version = "0.26.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f56d0623a4ed571aceb87a2ba9562be29db8f48678458915839d618b5aea4f0" +checksum = "893d6229c7315763ca0df9b29ab7661ee419f286577a02847c5521b462e071af" dependencies = [ "ahash 0.8.11", - "anyhow", "base64", "bytecount", "email_address", @@ -1826,7 +1819,6 @@ dependencies = [ "regex-syntax", "serde", "serde_json", - "url", "uuid-simd", ] @@ -3188,9 +3180,9 @@ dependencies = [ [[package]] name = "referencing" -version = "0.24.0" +version = "0.26.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47cf406be4ba55a0098bace3076b9936f6f01c26f43adeb6b02b63f1c865451f" +checksum = "eb853437e467c693ac1dc8c1520105a31b8c2588544ff2f3cfa5a7c706c6c069" dependencies = [ "ahash 0.8.11", "fluent-uri", diff --git a/bin/nanocld/Cargo.toml b/bin/nanocld/Cargo.toml index 6850237f1..b3d573858 100644 --- a/bin/nanocld/Cargo.toml +++ b/bin/nanocld/Cargo.toml @@ -78,7 +78,7 @@ chrono = { version = "0.4", default-features = false, features = [ "clock", "serde", ] } -jsonschema = { version = "0.24", default-features = false } +jsonschema = { version = "0.26", default-features = false } nanocld_client = { version = "0.16", features = ["tokio"] } metrsd_client = "0.5" nanocl_stubs = { version = "0.16", features = ["serde", "clap"] } diff --git a/bin/nanocld/src/repositories/resource.rs b/bin/nanocld/src/repositories/resource.rs index 1dc4b4c5f..2f3555f6e 100644 --- a/bin/nanocld/src/repositories/resource.rs +++ b/bin/nanocld/src/repositories/resource.rs @@ -211,11 +211,7 @@ impl ResourceDb { HttpError::bad_request(format!("Invalid schema {}", err)) })?; schema.validate(&resource.data).map_err(|err| { - let mut msg = String::from("Invalid config "); - for error in err { - msg += &format!("{} ", error); - } - HttpError::bad_request(msg) + HttpError::bad_request(format!("Invalid schema {err}")) })?; } if let Some(url) = &kind.data.url {