-
-
Notifications
You must be signed in to change notification settings - Fork 616
fix(transform): avoid duplicate enum declaration when using root types with no prefix #2351
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
fix(transform): avoid duplicate enum declaration when using root types with no prefix #2351
Conversation
❌ Deploy Preview for openapi-ts failed.
|
|
|
@duncanbeevers can I hand this over to you? I'm not feeling sufficiently comfortable with the internals to review this. |
|
@gzm0 Yes I can take this. I think it's a duplicate of a couple other issues, so I'll see about taking some time to gather the various bugs + fixes together to pick the best solution. |
|
Hi, I'm also encountering this issue. Do you know if you have a rough estimate of when this will be merged and released? |
|
@Newbie012 could you add a |
|
@Newbie012 @gzm0 @duncanbeevers @sultaniman This is a duplicate of this PR which was not yet merged; you can read the discussion there but the general idea I had is that we should avoid generating root types for enums when these flags are used together, instead of generating an exported type with Schema prefix just for enums, as it would be confusing. WDYT? |
Changes
given the following settings:
the generated output will declare an enum and a type with the same name. This PR will avoid redeclaring a type if its node is an enum.
How to Review
The PR is quite minimal - code adjustment + a test
Checklist
docs/updated (if necessary)pnpm run update:examplesrun (only applicable for openapi-typescript)