Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #9769
Closed
Open
Issue created Jun 15, 2021 by Administrator@rootContributor

[REQ] [rust] map `format: date` to `chrono::naive::NaiveDate` for `rust-server` generator

Created by: seiyab

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.

Assignee
Assign to
Time tracking