Open khalo-sa opened 1 year ago
I just added support for computed fields, and a corresponding test.
Just looking through pydantic
docs. https://docs.pydantic.dev/latest/version-policy/#pydantic-v1
Active development of V1 has already stopped, however critical bug fixes and security vulnerabilities will be fixed in V1 for one year after the release of V2 (June 30, 2024).
The complexity of supporting both versions seems excessive to me. Wouldn't this library be better just releasing a v2
with support for pydantic v2
?
Any reason I'm missing for supporting both pydantic
major versions?
Any reason I'm missing for supporting both pydantic major versions?
There's a lot of Pydantic 1 using code out there that's not necessarily going to update, but could use this library. It doesn't seem to be very much extra code to support both (the majority of this PR's changes are test fixtures).
Any reason I'm missing for supporting both pydantic major versions?
There's a lot of Pydantic 1 using code out there that's not necessarily going to update, but could use this library. It doesn't seem to be very much extra code to support both (the majority of this PR's changes are test fixtures).
@akx pydantic 1 using code can use v1 of this library right?
What's the difference between this PR and https://github.com/phillipdupuis/pydantic-to-typescript/pull/40 or https://github.com/phillipdupuis/pydantic-to-typescript/pull/37 ?
Can they be consolidated?
In my project this MR worked. I'm using pydantic 2.6.4.
I created a fork with this merged so the community can easily install it via pip. The code is published to PyPI as pydantic-to-typescript2.
Phillip Dupuis is still included as an author.
Repository link: Darius-Labs/pydantic-to-typescript2
Hi @phillipdupuis, after switching to Pydantic V2 in one of my projects, this library stopped working. To make sure that my changes are compatible with both, Pydantic V1 and V2, I created two virtual environments with each respective Pydantic version, and this library installed. The initial goal was to keep the tests the same, but V2 requires slight adjustments to the inputs and generated outputs, which is why I created v1/v2-subdirectories for each type of test. The changes that made that necessary were:
The library seems to work now with both, V1 and V2, by dynamically determining the installed Pydantic version and using the appropriate functions.