Closed jessemyers-lettuce closed 1 year ago
@MarcoMuellner Apologies, I didn't mean to submit this PR yet. I was making one against our own fork so I could test these changes and yours was the default origin.
That said, I'd love to contribute and get this upstreamed, but I think I'll need more guidance. The tests can't just be made to work without changing the project dependencies. If you want both versions of pydantic
to be supported, there'll need to be some changes to the pyproject.toml
structure... and I'm not really sure how to do that without breaking existing usage.
I guess it wouldn't be that difficult - and i don't think it really requires changes to the pyproject.toml file. There would need to be a --useDeprecatedPydantic
option for the code, where the models would then be in the form of a pydantic 1 style. By default your version can be used.
So we would need a second jinja2 file for the models, one for each pydantic version. Does this make sense?
So we would need a second jinja2 file for the models, one for each pydantic version
I ran into a problem doing that because the project itself uses pydantic
and uses it for validation; it's been a few weeks so I don't recall the exact error, but it was something along the lines of trying to use v1 to validate v2 templates.
Hi @jessemyers-lettuce, thanks for your PR :) Can you please add tests? Also both versions of Pydantic should be supported. Thank you