oapi-codegen icon indicating copy to clipboard operation
oapi-codegen copied to clipboard

Allow resetting globalState.options

Open bcm820 opened this issue 1 year ago • 1 comments

We are using oapi-codegen as a library to split out client operation code by tags into separate files. However, it is currently impossible to do this in a single running process due to globalState being shared across each Generate operation. When I try to generate separate files by calling Generate multiple times, only the first set of operations are included, and the rest do not have any operations.

I wonder if being able to reset the global state options as needed would be helpful here to support more deterministic behavior.

bcm820 avatar Oct 16 '24 13:10 bcm820

Hey, thanks for raising this, and using oapi-codegen as a library!

We'd welcome a similar change to https://github.com/oapi-codegen/oapi-codegen/pull/1174 to override the options :raised_hands:

jamietanna avatar Oct 20 '24 09:10 jamietanna