[all] add "x-enum-varnames" extension to control enum varname#917
[all] add "x-enum-varnames" extension to control enum varname#917jmini merged 2 commits intoOpenAPITools:masterfrom
Conversation
a16d0ba to
cfd1f4c
Compare
There was a problem hiding this comment.
Maye you could just log a warning if the sizes do not match.
In my opinion it is OK to still change the first two defined names in a case like this:
EnumProp:
type: string
enum:
- a
- b
- c
x-enum-varnames:
- FOO
- BARThere was a problem hiding this comment.
I see.
Then I'll make changes to allow to set different number of elements from target enum.
|
Tested with a java client generator with: EnumWithCustomName:
type: integer
format: int32
enum:
- 1
- 2
x-enum-varnames:
- FOO
- BARThe produced code |
|
Thank you for this great contribution! |
|
@osjupiter thanks for the PR, which has been included in the v3.2.3 release: https://twitter.com/oas_generator/status/1035200785066254336 |
|
The codegen of This issue was fixed in #1120. |
…ITools#917) * add "x-enum-varnames" extension to control the naming of the enum parameter name * allow to set different size from target enum
|
ABCEnum: Why is this not working??? |
PR checklist
./bin/to update Petstore sample so that CIs can verify the change. (For instance, only need to run./bin/{LANG}-petstore.shand./bin/security/{LANG}-petstore.shif updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in.\bin\windows\.master,3.3.x,4.0.x. Default:master.Description of the PR
(details of the change, additional tests that have been done, reference to the issue for tracking, etc)
For issue #893
Add "x-enum-varnames" vendor extension to control names of generated enum properties.