-
-
Notifications
You must be signed in to change notification settings - Fork 177
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
Support of DateTime and Date formats #937
base: dev
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi. Thanks for digging into this.
I didn't take to time to review thoroughly but here's a question already.
Any idea why it stopped working as expected in version 6.4?
@@ -574,16 +573,62 @@ def datetime2properties(self, field, **kwargs: typing.Any) -> dict: | |||
"example": "1676451277514.654", | |||
"min": "0", | |||
} | |||
elif field.format is not None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At this point, field.format
can't be None
due to line 549, right?
Also, format and pattern should not ever by None, according to openapi spec they must be strings. Probably should be removed from the ret dict when they are None. |
Adds full support for rendering Date and DateTime Marshmallow fields with each of their
format
values.This solve the issue of
Date
andDateTime
with a non-default format being rendered withformat: null
instead offormat: date
andformat: date-time
respectively.