Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveL-MSFT committed Dec 12, 2024
1 parent 22d57e5 commit 12c97aa
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions dsc/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ use dsc_lib::{
};
use jsonschema::Validator;
use path_absolutize::Absolutize;
use rust_i18n::t;
use schemars::{schema_for, schema::RootSchema};
use serde::Deserialize;
use serde_json::Value;
Expand Down Expand Up @@ -438,12 +439,12 @@ pub fn validate_json(source: &str, schema: &Value, json: &Value) -> Result<(), D
let compiled_schema = match Validator::new(schema) {
Ok(compiled_schema) => compiled_schema,
Err(err) => {
return Err(DscError::Validation(format!("{}: {err}", t!("util.failedToCompileSchema")));
return Err(DscError::Validation(format!("{}: {err}", t!("util.failedToCompileSchema"))));
}
};

if let Err(err) = compiled_schema.validate(json) {
return Err(DscError::Validation(format!("{}: '{source}' {err}", t!("util.validationFailed")));
return Err(DscError::Validation(format!("{}: '{source}' {err}", t!("util.validationFailed"))));
};

Ok(())
Expand Down

0 comments on commit 12c97aa

Please sign in to comment.