diff --git a/Cargo.toml b/Cargo.toml index d966972..04f9266 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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 } diff --git a/src/builtins/objects.rs b/src/builtins/objects.rs index dbb207a..8788df4 100644 --- a/src/builtins/objects.rs +++ b/src/builtins/objects.rs @@ -391,14 +391,14 @@ fn object_union_n( } #[cfg(feature = "jsonschema")] -fn compile_json_schema(param: &Ref, arg: &Value) -> Result { +fn compile_json_schema(param: &Ref, arg: &Value) -> Result { 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()), }