diff options
Diffstat (limited to 'generator')
-rw-r--r-- | generator/src/main.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/generator/src/main.rs b/generator/src/main.rs index 0286bf7..9bd1ea3 100644 --- a/generator/src/main.rs +++ b/generator/src/main.rs @@ -728,6 +728,12 @@ fn create_struct_for_definition( if field_ty == "Option<url::Url>" { fields.push_str("#[serde(deserialize_with = \"crate::none_if_blank_url\")]\n"); } + if field_ty == "time::OffsetDateTime" { + fields.push_str("#[serde(with = \"time::serde::rfc3339\")]\n"); + } + if field_ty == "Option<time::OffsetDateTime>" { + fields.push_str("#[serde(with = \"time::serde::rfc3339::option\")]\n"); + } if &field_name != prop_name { fields.push_str("#[serde(rename = \""); fields.push_str(prop_name); |