Skip to content

Commit

Permalink
chore(deps): Update jsonschema to 0.28 (#12089)
Browse files Browse the repository at this point in the history
  • Loading branch information
Stranger6667 authored Jan 2, 2025
1 parent a16796a commit d7f48cb
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 47 deletions.
125 changes: 83 additions & 42 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 crates/tauri-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ tauri-utils-v1 = { version = "1", package = "tauri-utils", features = [
"config-toml",
] }
toml = "0.8"
jsonschema = "0.18"
jsonschema = "0.28"
handlebars = "6"
include_dir = "0.7"
minisign = "=0.7.3"
Expand Down
9 changes: 5 additions & 4 deletions crates/tauri-cli/src/helpers/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT

use itertools::Itertools;
use json_patch::merge;
use serde_json::Value as JsonValue;

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

0 comments on commit d7f48cb

Please sign in to comment.