pyfa-converter icon indicating copy to clipboard operation
pyfa-converter copied to clipboard

support pydantic v2

Open sanzoghenzo opened this issue 2 years ago • 3 comments

Hi! great to see this useful tool!

Cross posting from FastAPI discussions :wink:

I just tried it, but unfortunately it doesn't work with pydantic v2.

It crashes because it can't find pydantic.fields.ModelField, that is removed in facor of a cls.model_fields, which is a dict[str, FieldInfo]. Obviously there will be other error, but I couldn't find the time to investigate it further.

sanzoghenzo avatar Jul 14 '23 12:07 sanzoghenzo

The work is almost finished, but when I checked the tests from V1 to V2, I found a problem with the incorrect parsing of Optional[list[...]], Optional[set[...]] and other types for FORM , because of which I had to spend time and make a PR in FastAPI.

But need to wait for it - https://github.com/tiangolo/fastapi/pull/9925 & https://github.com/tiangolo/fastapi/pull/9928

dotX12 avatar Jul 22 '23 22:07 dotX12

Hello @dotX12. Could you please post the current version with pydantic v2?

cofob avatar Nov 06 '23 13:11 cofob

I made a fork with support for version 2 - https://github.com/AezaGroup/pyfa-converter-v2

cofob avatar Apr 09 '24 05:04 cofob