Closed lfse-slafleur closed 1 week ago
datamodel-code-generator already supports pydantic v2 as a seperate output type: https://github.com/koxudaxi/datamodel-code-generator#supported-output-types
@Flix6x Regarding the discussion on why and when to move to pydantic v2:
I would consider moving to pydantic 2 soon due to:
Moving from pydantic 1 to 2 api is quite a bit of work. This work has already been performed for all existing messages (FRBC & Common) but we need to generate all the other messages soon as well. If we generate the messages and create the non-generated classes for the other device types, we would be increasing the technical depth to migrate to pydantic 2 significantly as we would then have to migrate all other device types as well. I would really like to prevent this and rather generate/create all the necessary messages & classes after moving to pydantic 2.
Pydantic v1 is nearing its end-of-life: https://docs.pydantic.dev/latest/version-policy/#pydantic-v1
Should we perhaps keep a hotfix
branch with pydantic v1 support for your use case for now? (E.g. s2-python 0.1.x
)
Thank you for creating the hotfix branch. I agree this is the best solution.
When fixed, also fix Transition unit test to use keyword arguments in init instead of the dict approach.