From 0533e67ea62aa63ff9563f66b19b3e1bcdc5000e Mon Sep 17 00:00:00 2001 From: OlivierDehaene <23298448+OlivierDehaene@users.noreply.github.com> Date: Mon, 19 Feb 2024 17:33:23 +0100 Subject: [PATCH] use Draft202012 --- router/Cargo.toml | 2 +- router/src/lib.rs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/router/Cargo.toml b/router/Cargo.toml index 97a46ad1..8f13dc33 100644 --- a/router/Cargo.toml +++ b/router/Cargo.toml @@ -22,7 +22,7 @@ text-generation-client = { path = "client" } clap = { version = "4.4.5", features = ["derive", "env"] } futures = "0.3.28" hf-hub = { version = "0.3.0", features = ["tokio"] } -jsonschema = "0.17.1" +jsonschema = { version = "0.17.1", features = ["draft202012"] } metrics = "0.21.1" metrics-exporter-prometheus = { version = "0.12.1", features = [] } nohash-hasher = "0.2.0" diff --git a/router/src/lib.rs b/router/src/lib.rs index e1217fa7..c1da6572 100644 --- a/router/src/lib.rs +++ b/router/src/lib.rs @@ -46,7 +46,7 @@ impl HubTokenizerConfig { } mod json_object_or_string_to_string { - use jsonschema::JSONSchema; + use jsonschema::{Draft, JSONSchema}; use serde::{Deserialize, Deserializer}; use serde_json::Value; @@ -59,6 +59,7 @@ mod json_object_or_string_to_string { let value = Value::deserialize(deserializer)?; JSONSchema::options() + .with_draft(Draft::Draft202012) .compile(&value) .map_err(|e| serde::de::Error::custom(format!("invalid JSONSchema: {e}")))?;