Skip to content
Discussion options

You must be logged in to vote

The OpenAPI spec says that the date-time format (which is what FastAPI and pydantic convert python datetime objects into) only needs to be an RFC3339-compliant string (not ISO8601, but a subset), with no restriction of the timezone format, so both Z and +00:00 need to be supported. I forget how Pydantic handles it, but RFC3339 does mandate that valid strings have a timezone offset specifier, as raised in OAI/OpenAPI-Specification#1498.

From what I can tell, it really is more of an interface issue (OpenAPI implicitly requires date-time strings to be timezone-aware) combined with a defaut value issue (most renderers just use the current UTC datetime as example values for those strings unles…

Replies: 6 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by tiangolo
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@xavatu
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Question or problem question-migrate
7 participants
Converted from issue

This discussion was converted from issue #1178 on February 28, 2023 10:19.