Skip to content

x-enum-varnames revival#880

Merged
4 commits merged intooapi-codegen:masterfrom
amery:feature/enum-varnames
Dec 17, 2022
Merged

x-enum-varnames revival#880
4 commits merged intooapi-codegen:masterfrom
amery:feature/enum-varnames

Conversation

@amery
Copy link
Copy Markdown
Contributor

@amery amery commented Nov 30, 2022

This is #692 by @reedom rebased on top of master

Comment thread pkg/codegen/test_spec.yaml Outdated
enumNames:
type: integer
enum: [0, 1, 2]
x-enum-varnames:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

x-enumNames here?

Copy link
Copy Markdown
Contributor Author

@amery amery Dec 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@derfenix amended

@amery amery force-pushed the feature/enum-varnames branch from 4590e81 to 0c24a79 Compare December 1, 2022 16:30
@amery amery force-pushed the feature/enum-varnames branch from 0c24a79 to d7f9c38 Compare December 5, 2022 21:19
@amery
Copy link
Copy Markdown
Contributor Author

amery commented Dec 5, 2022

rebased upon v1.12.4

@Antonboom
Copy link
Copy Markdown
Contributor

Please, merge this feature 🙏

@Antonboom
Copy link
Copy Markdown
Contributor

@deepmap-marcinr

@ghost ghost merged commit d516da7 into oapi-codegen:master Dec 17, 2022
@amery amery deleted the feature/enum-varnames branch December 17, 2022 01:03
@amery
Copy link
Copy Markdown
Contributor Author

amery commented Dec 17, 2022

thank you @deepmap-marcinr!

@saulhoward
Copy link
Copy Markdown

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.
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.

5 participants