Skip to content

Commit d7f48cb

Browse files
authored
chore(deps): Update jsonschema to 0.28 (#12089)
1 parent a16796a commit d7f48cb

File tree

3 files changed

+89
-47
lines changed

3 files changed

+89
-47
lines changed

Cargo.lock

Lines changed: 83 additions & 42 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/tauri-cli/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ tauri-utils-v1 = { version = "1", package = "tauri-utils", features = [
7070
"config-toml",
7171
] }
7272
toml = "0.8"
73-
jsonschema = "0.18"
73+
jsonschema = "0.28"
7474
handlebars = "6"
7575
include_dir = "0.7"
7676
minisign = "=0.7.3"

crates/tauri-cli/src/helpers/config.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// SPDX-License-Identifier: Apache-2.0
33
// SPDX-License-Identifier: MIT
44

5+
use itertools::Itertools;
56
use json_patch::merge;
67
use serde_json::Value as JsonValue;
78

@@ -172,11 +173,11 @@ fn get_internal(
172173
|| config_path.extension() == Some(OsStr::new("json5"))
173174
{
174175
let schema: JsonValue = serde_json::from_str(include_str!("../../config.schema.json"))?;
175-
let schema = jsonschema::JSONSchema::compile(&schema).unwrap();
176-
let result = schema.validate(&config);
177-
if let Err(errors) = result {
176+
let validator = jsonschema::validator_for(&schema).expect("Invalid schema");
177+
let mut errors = validator.iter_errors(&config).peekable();
178+
if errors.peek().is_some() {
178179
for error in errors {
179-
let path = error.instance_path.clone().into_vec().join(" > ");
180+
let path = error.instance_path.into_iter().join(" > ");
180181
if path.is_empty() {
181182
log::error!("`{}` error: {}", config_file_name, error);
182183
} else {

0 commit comments

Comments
 (0)