-
-
Notifications
You must be signed in to change notification settings - Fork 6.1k
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 tuples in model roots #1870
Comments
Hey @Mause how is it going? Have you already tried to fix it? |
I think this will be doable once #3038 is merged. With 3.1 any JSON schema will be valid. And with pydantic/pydantic#2497 the generated tuple schema should be the expected one |
Tuples are supported directly in FastAPI, but not with the The latest version of OpenAPI, based on the latest JSON Schema, does support them, but Swagger UI still doesn't support that version. Pydantic v2 will come with the latest JSON Schema, and FastAPI will support the latest OpenAPI using it, although doing some tricks, probably declaring it as a previous version, to make Swagger UI keep rendering the rest (while they make a release that supports the latest versions). This is gonna be updated with the update to Pydantic v2, but without Given that I'll close this issue to clean up things, as this is mainly a drawback of Swagger UI. But still, soon with Pydantic v2 and the latest OpenAPI (with overridden tricks for the version, to convince Swagger UI) we'll have a way to do this.
|
First check
Example
Here's a self-contained minimal, reproducible, example with my use case:
Description
If you're happy to see this fixed, I can (attempt to) raise a pr to fix it myself
The text was updated successfully, but these errors were encountered: