Skip to content

Commit

Permalink
Fix time tests (#76)
Browse files Browse the repository at this point in the history
In chronotope/chrono#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.
  • Loading branch information
erickt committed Feb 2, 2023
1 parent 8c8826f commit 64dcff7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion src/json_schema/validators/formats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down

0 comments on commit 64dcff7

Please sign in to comment.