Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use fastapi._compat's ModelField if pydantic version is 2 #340

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

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.

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.

None yet

3 participants