fastapi icon indicating copy to clipboard operation
fastapi copied to clipboard

Support Pydantic root model as query parameter

Open MarkusSintonen opened this issue 11 months ago • 2 comments

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.

MarkusSintonen avatar Mar 17 '24 14:03 MarkusSintonen

Can I have a review @tiangolo / @alejsdev 🙏

MarkusSintonen avatar Mar 27 '24 05:03 MarkusSintonen

@tiangolo is there a chance for getting a review for this PR? 🙏

MarkusSintonen avatar Aug 12 '24 14:08 MarkusSintonen