Open samikhailov opened 7 months ago
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: https://github.com/mts-ai/FastAPI-JSONAPI/tree/upgrade-fastapi-and-pydantic
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! Technically, Pydantic V2 support is ready, but I need to make sure it works on older Python versions, I need to update examples and all docs, and also I'd like to update some legacy stuff
Here it is: https://github.com/mts-ai/FastAPI-JSONAPI/pull/88
It'll be cool, if you can check if it works for you in this state. Feel free to report any issues
An example doesn't work with Pydantic v2.
An error occurred:
Dependencies:
Do you plan to support Pydantic v2?