How to Create and Use a Reusable Mixin Class in Pydantic for Custom Field Transformation?
I am working on a FastAPI project using Pydantic v2 and SQLAlchemy. I want to create a reusable mixin class that can be used to apply custom transformations to fields in Pydantic models. Specifically, I want to:
Pydantic model with annotated query params does not work in FastAPI
FastAPI allows to define query params in Pydantic model. It works perfectly fine as long as we write non-Annotated Code but Annotated code failed to display query param metadata(description, examples) in Swagger UI.