From 64dcff7263b4a008eec3f954b2ba654d37799825 Mon Sep 17 00:00:00 2001 From: Erick Tryzelaar Date: Wed, 1 Feb 2023 21:27:36 -0800 Subject: [PATCH] Fix time tests (#76) In https://github.com/chronotope/chrono/pull/473, chrono changed how %Z is handled, and was changed to simply skip over any non-whitespace characters in the timezone section, just like glibc's `strptime`. I'm not sure if this is the right fix, but it gets the tests to pass. --- Cargo.toml | 2 +- src/json_schema/validators/formats.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 7a6e2c1e..80ef54fa 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,7 +18,7 @@ uuid = {version = "0.8", features = ["v4"]} phf = "0.8" serde = "1" serde_json = "1" -chrono = "0.4.6" +chrono = "0.4.16" addr = "0.11" percent-encoding = "2.1" json-pointer = "0.3" diff --git a/src/json_schema/validators/formats.rs b/src/json_schema/validators/formats.rs index 35e3634b..3f3a0822 100644 --- a/src/json_schema/validators/formats.rs +++ b/src/json_schema/validators/formats.rs @@ -226,7 +226,7 @@ impl super::Validator for Time { fn validate(&self, val: &Value, path: &str, _scope: &scope::Scope) -> super::ValidationState { let string = nonstrict_process!(val.as_str(), path); - match chrono::NaiveTime::parse_from_str(string, "%H:%M:%S%.f%Z") { + match chrono::NaiveTime::parse_from_str(string, "%H:%M:%S%.f") { Ok(_) => super::ValidationState::new(), Err(_) => val_error!(errors::Format { path: path.to_string(),