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 |
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: