Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pydantic_v2.BaseModel] Field specified as date-time is generated as AwareDatetime #1944

Closed
benverhees opened this issue May 2, 2024 · 1 comment

Comments

@benverhees
Copy link

Is your feature request related to a problem? Please describe.
A field, specified as a date-time is generated as AwareDatetime when the output model type is pydantic_v2.BaseModel, requiring a timezone to be specified.
While I understand it is best practice to work with timezones, not all systems have a timezone stored with their date-time data.

Describe the solution you'd like
I would like it to be possible to opt out of the AwareDatetime type, and use a type that doesn't require a timezone to be specified.

Describe alternatives you've considered
I have considered monkey-patching the generated code, but that doesn't feel right, and I have looked at the possibility to set a default timezone for AwareDatetime, but that doesn't seem to exist.

@benverhees
Copy link
Author

I just found #1735, so I understand this was driven by the openapi spec.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant