Skip to content

Feature: allow enum ordered const name override (2nd PR for this) #2046

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

Conversation

drewsilcock
Copy link
Contributor

Describe the PR
Add ability to override name of enum variant generated from ordered constant using // @name VariantName in the same way you can do for types.

Note: This is based on another PR, #1779, which was stuck in a state where it couldn't get merged as it had been approved by one person but required re-approval by another. This is based on that PR with a few extra changes:

  • x-enum-descriptions now has the same length as enum, i.e. an empty value is put into the array instead of skipping it.
  • Pulled changes from master branch and updated my code and other code accordingly, namely changing TypeSpecDef.Alias() to use the nameOverride() function.
  • Improved enum tests a bit more.

Relation issue
#1778

Additional context
N/A

@sdghchj sdghchj merged commit b0c5cc9 into swaggo:master Jul 24, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants