Skip to content

Commit

Permalink
chore: update to jsonschema 0.20.0 (#323)
Browse files Browse the repository at this point in the history
  • Loading branch information
anakrish authored Sep 23, 2024
1 parent d2b27ee commit 13d8289
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ semver = {version = "1.0.20", optional = true, default-features = false }
wax = { version = "0.6.0", features = [], default-features = false, optional = true }
url = { version = "2.5.0", optional = true }
uuid = { version = "1.6.1", default-features = false, features = ["v4", "fast-rng"], optional = true }
jsonschema = { version = "0.19.1", default-features = false, optional = true }
jsonschema = { version = "0.20.0", default-features = false, optional = true }
chrono = { version = "0.4.31", optional = true }
chrono-tz = { version = "0.10.0", optional = true }
jsonwebtoken = { version = "9.2.0", optional = true }
Expand Down
4 changes: 2 additions & 2 deletions src/builtins/objects.rs
Original file line number Diff line number Diff line change
Expand Up @@ -391,14 +391,14 @@ fn object_union_n(
}

#[cfg(feature = "jsonschema")]
fn compile_json_schema(param: &Ref<Expr>, arg: &Value) -> Result<jsonschema::JSONSchema> {
fn compile_json_schema(param: &Ref<Expr>, arg: &Value) -> Result<jsonschema::Validator> {
let schema_str = match arg {
Value::String(schema_str) => schema_str.as_ref().to_string(),
_ => arg.to_json_str()?,
};

if let Ok(schema) = serde_json::from_str(&schema_str) {
match jsonschema::JSONSchema::compile(&schema) {
match jsonschema::validator_for(&schema) {
Ok(schema) => return Ok(schema),
Err(e) => bail!(e.to_string()),
}
Expand Down

0 comments on commit 13d8289

Please sign in to comment.