-
Notifications
You must be signed in to change notification settings - Fork 10
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
Support Pydantic v2 #51
Comments
Hey there! Sure, we plan to support FastAPI 0.100+ and Pydantic V2 |
Hi, @mahenzon, I'd like to try to take on resolving this issue. Could you provide additional information if needed, and could you assign me to this issue? Regarding the additional information, At the moment, I have a couple of questions: the current version of the library uses pydantic v1. Do you plan to add support for pydantic v2 while maintaining backward compatibility? Or is it necessary to add pydantic v2 without preserving support for pydantic v1? |
Hi @DavidRomanovizc, great news! Nope, backward compatibility is not planned. There'll be a new release 3.0 with FastAPI 0.100+ and Pydantic 2+ I tried to migrate using the official migration script, but there were a lot of errors, here's the branch: Also there were some problems with annotations. For example atomic operations list has to be of length 1 or more, I could not find new annotation validator for this case. And a strange one: schemas are being serialized with model_config: it's serialized to json with all other attributes. Probably it's because schemas generation is kinda overcomplicated. I could not find a quick solution. We have decent tests coverage, so a lot of problems can be detected automatically. Feel free to open new PRs, I've created a new branch for version 3.x https://github.com/mts-ai/FastAPI-JSONAPI/tree/dev-3.x |
Hello there! This upgrade would be extremely valuable for a project I'm currently working on. Any updates on when it might be ready or how to contribute? Thanks! |
@kmbhm1 hello there! Here it is: #88 It'll be cool, if you can check if it works for you in this state. Feel free to report any issues |
@samikhailov @kmbhm1 thank you for your patience. I invite you to test the updated version of the library #97. The update was applied not only to the Pydantic library but also included version upgrades for SQLAlchemy and FastAPI. Performance has more than doubled; for example, with 50 users, the average response time decreased from 302 ms to 138 ms. Feel free to open a new issue if you encounter any problems with the updated version. Thank you. |
An example doesn't work with Pydantic v2.
An error occurred:
Dependencies:
Do you plan to support Pydantic v2?
The text was updated successfully, but these errors were encountered: