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

Migration to Pydantic V2 #147

Open
maxyousif15 opened this issue Feb 14, 2024 · 2 comments
Open

Migration to Pydantic V2 #147

maxyousif15 opened this issue Feb 14, 2024 · 2 comments
Assignees
Labels
enhancement Enhancement to existing features

Comments

@maxyousif15
Copy link
Contributor

The Route object still uses pydantic V1. Are there plans to migrate to V2?

Out of curiosity, is there a reason why Route was based on pydantic V1 and not pydantic V2?

@bruvduroiu bruvduroiu added the enhancement Enhancement to existing features label Mar 19, 2024
@bruvduroiu bruvduroiu self-assigned this Mar 19, 2024
@bruvduroiu
Copy link
Collaborator

Inscoping this as part of our backlog

@pratiksinghchauhan
Copy link

pratiksinghchauhan commented Apr 3, 2024

@bruvduroiu there are so many projects that use pydantic v1 and upgrading to pydantic v2 is not an option for them due to the amount of change it requires. Currently, I am resorting to maintaining my own fork of this library and supporting v1 as in the following snippet. Do you think there is a way to keep supporting both the versions in the library itself for some time at least to make this project actually useful?

try:
    from pydantic.v1 import BaseModel  # type: ignore
except ImportError:
    from pydantic import BaseModel  # type: ignore  

Pydantic just released 1.10.15 like 7 hours ago, so I think we must support it. I can make a PR from my fork if this is on the roadmap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement to existing features
Projects
None yet
Development

No branches or pull requests

3 participants