x-enum-varnames revival#880
Merged
4 commits merged intooapi-codegen:masterfrom Dec 17, 2022
Merged
Conversation
derfenix
reviewed
Dec 1, 2022
| enumNames: | ||
| type: integer | ||
| enum: [0, 1, 2] | ||
| x-enum-varnames: |
4590e81 to
0c24a79
Compare
x-enum-varnames can be used to have an other enum name for the corresponding value. This is used to define names of the enum items.
0c24a79 to
d7f9c38
Compare
Contributor
Author
|
rebased upon v1.12.4 |
Contributor
|
Please, merge this feature 🙏 |
Contributor
|
@deepmap-marcinr |
Contributor
Author
|
thank you @deepmap-marcinr! |
|
Great feature! In my testing, this removes any underscores in the provided enum names -- I assume this is a bug? |
adrianpk
pushed a commit
to foorester/oapi-codegen
that referenced
this pull request
Jan 16, 2024
* feat: support x-enum-varnames for numeric enums x-enum-varnames can be used to have an other enum name for the corresponding value. This is used to define names of the enum items. * test: add test for x-enum-varnames * docs: describe x-enum-varnames in README.md * feat: also support `x-enumNames`, alias for `x-enum-varnames` Co-authored-by: HANAI tohru <tohru@reedom.com>
adrianpk
added a commit
to foorester/oapi-codegen
that referenced
this pull request
May 31, 2024
* feat: support x-enum-varnames for numeric enums x-enum-varnames can be used to have an other enum name for the corresponding value. This is used to define names of the enum items. * test: add test for x-enum-varnames * docs: describe x-enum-varnames in README.md * feat: also support `x-enumNames`, alias for `x-enum-varnames` Co-authored-by: HANAI tohru <tohru@reedom.com>
danicc097
pushed a commit
to danicc097/oapi-codegen
that referenced
this pull request
Aug 31, 2024
* feat: support x-enum-varnames for numeric enums x-enum-varnames can be used to have an other enum name for the corresponding value. This is used to define names of the enum items. * test: add test for x-enum-varnames * docs: describe x-enum-varnames in README.md * feat: also support `x-enumNames`, alias for `x-enum-varnames` Co-authored-by: HANAI tohru <tohru@reedom.com>
This pull request was closed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is #692 by @reedom rebased on top of master