Is your feature request related to a problem? Please describe.
According OpenAPI Specification, format: date for type: string is As defined by full-date - RFC3339.
That is defined as date-fullyear "-" date-month "-" date-mday (RFC3339), like 2021-06-15.
So it doesn't have time and timezone information.
However, rust-server generator maps format: date to chrono::DateTime::<chrono::Utc>, that has time and timezone information.
We are forced to add provisional time like 00:00:00 and timezone like Utc to make dates to be chrono::DateTime::<chrono::Utc>.
Describe the solution you'd like
Adding an option to mapformat: date to chrono::naive::NaiveDate.
Though I think the current behavior is not desire, changing the API causes serious backward incompatibility. It should be added as opt-in approach.
I think NaiveDate is more appropriate than chrono::Date since full-date doesn't have a timezone information.
Describe alternatives you've considered
I don't have any other ideas.
Additional context
Nothing.
I'll add information if community / maintainers need more description.
Is your feature request related to a problem? Please describe.
According OpenAPI Specification,
format: datefortype: stringisAs defined by full-date - RFC3339.That is defined as
date-fullyear "-" date-month "-" date-mday(RFC3339), like2021-06-15.So it doesn't have time and timezone information.
However,
rust-servergenerator mapsformat: datetochrono::DateTime::<chrono::Utc>, that has time and timezone information.We are forced to add provisional time like
00:00:00and timezone likeUtcto make dates to bechrono::DateTime::<chrono::Utc>.Describe the solution you'd like
Adding an option to map
format: datetochrono::naive::NaiveDate.Though I think the current behavior is not desire, changing the API causes serious backward incompatibility. It should be added as opt-in approach.
I think NaiveDate is more appropriate than
chrono::Datesincefull-datedoesn't have a timezone information.Describe alternatives you've considered
I don't have any other ideas.
Additional context
Nothing.
I'll add information if community / maintainers need more description.