DataDog / apigentools

Generate API clients with ease
https://apigentools.readthedocs.io
BSD 3-Clause "New" or "Revised" License
41 stars 16 forks source link

Bump openapi-generator #251

Closed dd-ashishaev closed 1 year ago

dd-ashishaev commented 1 year ago

What does this PR do?

Description of the Change

We generate a Java client for one of our services. Unfortunately, the version that is used currently has a bug in the generator, and there's no good workaround. The fix is in this PR: https://github.com/OpenAPITools/openapi-generator/pull/12131.

Alternate Designs

Possible Drawbacks

Verification Process

Additional Notes

It would be practical to have a way to version templates independently from apigentools, and preferably per-language. Sometime a bug, like this one, requires an upgrade for one language, but other languages are operational.

Release Notes

Review checklist (to be filled by reviewers)

therve commented 1 year ago

For the record generally they way to update one template is to use a downstream patch: https://apigentools.readthedocs.io/en/latest/workflow/#add-template-patches

dd-ashishaev commented 1 year ago

Thanks for your response! Template patches are great! On the other hand, I'm not sure they are a replacement for updating the templates in general. We could indeed copy the code from the linked PR and check it in our repository as a patch. However, this will become complicated if we need more changes, or need to understand where a generated line comes from. The patch will also separate the change from its context (state of the repo, PR/issue discussion).

In addition to that, not all bugfixes can be applied as a template patch/override, for example, if the changes are outside the templates in the code generation logic. You can fork the template in this case, but the maintenance burden of this is likely huge.

I'm OK with patching for now, but not sure this is the best way in general. What are your thoughts on bumping the version? I'm seeing that it hasn't been updated in about a year...

therve commented 1 year ago

Oh no I was just suggesting that in the future. No issue from me updating the image.

dd-ashishaev commented 1 year ago

Ah! Thank you! Perfect 🙇 I think I misunderstood your comment, sorry!