| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
When enum subclassing/mix-in[1] is used, especially to ensure compatibility and produce correct OpenAPI specifications with FastAPI[2], SQLModel on its side doesn't map to the correct SQLAlchemy type. e.g.: * `class Foo(Enum)` will work but won't allow a proper OpenAPI spec. to be generated. * `class Foo(str, Enum)` will fix the previous situation, but prevents SQLModel to read and map the object from the DB (due to validation errors). Changing ordering of checks to ensure that Enum subclasses are tested first. [1] https://docs.python.org/3/library/enum.html#restricted-enum-subclassing [2] https://fastapi.tiangolo.com/sq/tutorial/path-params/#create-an-enum-class
|
This will be available in the next release, 0.0.9. 🎉 |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
🐛 Fix enum type checks ordering in get_sqlalchemy_type
This continues the work in #442 by @pierrecdn as I can't push to the original branch, but it includes his commits. 🤓