fastapi-cache
fastapi-cache copied to clipboard
Use fastapi._compat's ModelField if pydantic version is 2
Use fastapi._compat's ModelField if pydantic version is 2, as the ModelField in pydantic v1 is not there in v2 anymore.
I hope it will eventually be merged, because outdated pedantic makes whole library unusable (together with stupid limitation of caching only GET requests)
Hey, how is this PR supposed to work?
I merged your changes locally, but I get an attribute error when fastapi-cache tries to initialize ModelField class due to non-existent attributes in the FastAPI compat class when it loads data from cache.
Any ideas would be helpful, I'm getting frustrated and will downgrade FastAPI to use Pydantic v1 just for this reason.
@long2ice can we move forward with supporting pedantic > 2 ?