fastapi
fastapi copied to clipboard
Support Pydantic root model as query parameter
Fixes https://github.com/tiangolo/fastapi/issues/11134
Adds support for Pydantic root model in query/path parameters. Supports PydaticV2 RootModel[X]
and PydanticV1 BaseModel.__root__
. This is a non breaking change as previously root models usage threw errors on route initialization when they were not used as bodies.
Adds lots of (previously missing) tests.
Can I have a review @tiangolo / @alejsdev 🙏
@tiangolo is there a chance for getting a review for this PR? 🙏