FastAPI-JSONAPI icon indicating copy to clipboard operation
FastAPI-JSONAPI copied to clipboard

✨ Migrate from Pydantic V1 to V2 [WIP]

Open DavidRomanovizc opened this issue 1 year ago • 6 comments

What was wrong?

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

Todo:

  • [ ] Update documentation

DavidRomanovizc avatar Jan 31 '24 09:01 DavidRomanovizc

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

mahenzon avatar Feb 19 '24 10:02 mahenzon

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

DavidRomanovizc avatar Mar 24 '24 14:03 DavidRomanovizc

Looks great. Please rebase + fix tests + resolve comments

mahenzon avatar Mar 25 '24 13:03 mahenzon

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

mbp101 avatar Apr 23 '24 19:04 mbp101

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

mahenzon avatar May 01 '24 19:05 mahenzon

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 🙏

mahenzon avatar May 06 '24 08:05 mahenzon

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.

DavidRomanovizc avatar May 21 '24 15:05 DavidRomanovizc

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

mahenzon avatar Jun 09 '24 14:06 mahenzon