Deduplicate enums #1683
Labels
enhancement
New feature or request
openapi-ts
Relevant to the openapi-typescript library
planned
Expected in an upcoming version
PRs welcome
PRs are welcome to solve this issue!
Description
Hi, when using the
--enum
flag, the same enum gets generated multiple times if it's used multiple times, can we get a new flag or something to not generate duplicate enums when the keys and values of the enum match an existing enum?Proposal
A new flag that dedupes the enums will be useful. Currently, I'm patching the lib and keeping the stringified version of keys-values in a map and checking if it exists then returning instead of creating a new enum. I can create a PR to implement this feature first creating this issue to discuss how we can proceed with the naming and all
Checklist
My diff
The text was updated successfully, but these errors were encountered: