From f3e2b96d89630719d0b0bdd30dee1732da8c29b8 Mon Sep 17 00:00:00 2001 From: Fabian Date: Sat, 2 Sep 2023 13:10:37 +0200 Subject: [PATCH 1/2] chrono:: NaiveTime as "time" format --- schemars/src/json_schema_impls/chrono.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/schemars/src/json_schema_impls/chrono.rs b/schemars/src/json_schema_impls/chrono.rs index 005c89b3..9ed51b31 100644 --- a/schemars/src/json_schema_impls/chrono.rs +++ b/schemars/src/json_schema_impls/chrono.rs @@ -55,5 +55,5 @@ macro_rules! formatted_string_impl { formatted_string_impl!(NaiveDate, "date"); formatted_string_impl!(NaiveDateTime, "partial-date-time"); -formatted_string_impl!(NaiveTime, "partial-date-time"); +formatted_string_impl!(NaiveTime, "time"); formatted_string_impl!(DateTime, "date-time", JsonSchema for DateTime); From 0b4c379b8bf3a5b3befdde1c4ea06ec77097c17f Mon Sep 17 00:00:00 2001 From: Fabian Date: Sat, 2 Sep 2023 13:30:20 +0200 Subject: [PATCH 2/2] fix test --- schemars/tests/expected/chrono-types.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/schemars/tests/expected/chrono-types.json b/schemars/tests/expected/chrono-types.json index e3e788f7..9f35de11 100644 --- a/schemars/tests/expected/chrono-types.json +++ b/schemars/tests/expected/chrono-types.json @@ -36,7 +36,7 @@ }, "naive_time": { "type": "string", - "format": "partial-date-time" + "format": "time" } } } \ No newline at end of file