Skip to content

Conversation

karthik17
Copy link

Use fastapi._compat's ModelField if pydantic version is 2, as the ModelField in pydantic v1 is not there in v2 anymore.

…elField in pydantic v1 is not there in v2 anymore.
@antonkulaga
Copy link

I hope it will eventually be merged, because outdated pedantic makes whole library unusable (together with stupid limitation of caching only GET requests)

@divadsn
Copy link

divadsn commented Dec 28, 2023

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.

@lb-ronyeh
Copy link

@long2ice can we move forward with supporting pedantic > 2 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants