Replies: 1 comment
-
|
Yes, for now you can't use more than one model to declare Query parameters. As a workaround - if the fields in your models don't overlap, you can use multiple inheritance to combine them: |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
First Check
Commit to Help
Example Code
Description
Currently, GET to this api with http://localhost:8000/items/?limit=10&offset=0&order_by=created_at&tags=pop&tags=metal will return with code 422.
Only one query parameter model is supported.
Sometimes this will cause too much definition of Parameter classes.
If multiple query parameter model allowed, some parameter classes can be reused and then reduce parameter classes definition.
Operating System
macOS
Operating System Details
No response
FastAPI Version
0.119.1
Pydantic Version
2.12.3
Python Version
3.13.9
Additional Context
No response
Beta Was this translation helpful? Give feedback.
All reactions