Skip to content

Commit e6726f5

Browse files
committed
replace error-prone manual schema overrides with chrono feature
1 parent 0f24417 commit e6726f5

File tree

5 files changed

+2
-6
lines changed

5 files changed

+2
-6
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ reqwest = { version = "0.12.4", features = [
3434
"rustls-tls",
3535
], default-features = false }
3636
rust-embed = { version = "8.0.0", features = ["interpolate-folder-path"] }
37-
schemars = "0.9"
37+
schemars = { version = "0.9", features = ["chrono04"] }
3838
serde = { version = "1.0.188", features = ["derive"] }
3939
serde_json = { version = "1.0.105", features = ["preserve_order"] }
4040
serde_repr = "0.1.16"

src/logs/schema/message/basic.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ use super::ResponseMessage;
1313
pub struct BasicMessage<'a> {
1414
pub text: Cow<'a, str>,
1515
pub display_name: &'a str,
16-
#[schemars(with = "String")]
1716
pub timestamp: DateTime<Utc>,
1817
pub id: Cow<'a, str>,
1918
pub tags: HashMap<&'a str, Cow<'a, str>>,

src/logs/schema/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,8 @@ use serde::Deserialize;
66

77
#[derive(Deserialize, JsonSchema, Clone, Copy, Debug)]
88
pub struct LogRangeParams {
9-
#[schemars(with = "String")]
109
/// RFC 3339 start date
1110
pub from: Option<DateTime<Utc>>,
12-
#[schemars(with = "String")]
1311
/// RFC 3339 end date
1412
pub to: Option<DateTime<Utc>>,
1513
}

src/web/schema.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,6 @@ pub struct UserNameHistoryParam {
188188
#[derive(Serialize, JsonSchema)]
189189
pub struct PreviousName {
190190
pub user_login: String,
191-
#[schemars(with = "String")]
192191
pub last_timestamp: DateTime<Utc>,
193-
#[schemars(with = "String")]
194192
pub first_timestamp: DateTime<Utc>,
195193
}

0 commit comments

Comments
 (0)