mts-ai / FastAPI-JSONAPI

JSON:API for FastAPI
https://mts-ai.github.io/FastAPI-JSONAPI/
MIT License
105 stars 9 forks source link

✨ Migrate from Pydantic V1 to V2 [WIP] #76

Closed DavidRomanovizc closed 3 months ago

DavidRomanovizc commented 8 months ago

What was wrong?

Need to migrate project from Pydantic V1 to V2 Related to Issue: #51

Todo:

mahenzon commented 7 months ago

Hey there! Please run pre-commit locally. Thank you

DavidRomanovizc commented 6 months ago

@mahenzon could you review my PR, please? If you're not busy with something else, I'd appreciate your feedback

mahenzon commented 6 months ago

Looks great. Please rebase + fix tests + resolve comments

mbp101 commented 5 months ago

@DavidRomanovizc, thanks for your work on this. When do you think you might be able to review/incorporate @mahenzon's feedback?

mahenzon commented 5 months ago

@DavidRomanovizc thank you for all your hard work! Please resolve conflicts (rebase on the target branch dev-3.x) 🙏

mahenzon commented 4 months ago

Hey there! Thank you again. Now tests are failing because of broken pydantic schemas, please take a look:

current PR branch: Screenshot 2024-05-06 at 11 03 42 We can see, that schema in the signature has relationships fields (but it should not)

here's the same test in the main branch: Screenshot 2024-05-06 at 11 08 32 no relationships schemas are present.

this is the reason why tests are failing with "Param: posts can only be a request body, using Body()". This param should not be even present.

Please check schemas generation 🙏

DavidRomanovizc commented 4 months ago

Also I commented out the keys_to_ids_list field for now, as it's causing an error again: Param: ... can only be a request body, using Body(). I checked the main branch and found that the field is in the schema's signature, but the type annotations are slightly different and I don't have any idea what the issue is yet.

mahenzon commented 3 months ago

Thank you a lot for your work! I'll take it from here