use Draft202012

This commit is contained in:
OlivierDehaene 2024-02-19 17:33:23 +01:00
parent 2251f5b16f
commit 0533e67ea6
2 changed files with 3 additions and 2 deletions

View File

@ -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"

View File

@ -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}")))?;