-
Notifications
You must be signed in to change notification settings - Fork 6k
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
[TypeScript-*] Generating array of enum values fails to create TS enums #5681
Comments
@kirpit recently, some changes regarding enums have been comitted. could you retry with the current master and close the issue if it is resolved? |
Will do that a.s.a.p (that probably means sometime in the weekend). Thanks for the heads up! |
@kirpit I'm fixing this as a part of a PR right now for typescript-node. typescript-angular is already fixed i'd have to look into others as they all have different model generators :x. |
…Array<Enum> is defined fixes part of Issue swagger-api#5681
Unfortunately the problem is still consist with minor improvement on
However, enum set of values are not there at all, so they have no effect. Tried with |
The arrayofstringchoices model I don't believe was a properly setup enum.
Currently it only supports the enum being on the response and not in the
definition so we may need to do more.
…On Sat, Nov 4, 2017, 4:19 AM kirpit ***@***.***> wrote:
Unfortunately the problem is still consist with minor improvement on
typescript-angular (previously known as typescript-angular2) definition:
export interface MyData {
myNumbersField?: Array<number>; // <------ Definition looks like fixed
myStringsField?: ArrayOfStringChoicesModel;
}
However, enum set of values are not there at all, so they have no effect.
Tried with typescript-angular, typescript-angularjs and typescript-fetch
but not others, against current master 4dafa5b
<4dafa5b>
.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#5681 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AMPLtaH9-VOQibaumrdl4INJwX-RccFRks5szB3_gaJpZM4Nh4CU>
.
|
It is
And I already compiled with |
Description
Basically trying to combine
type: array
andenum: [ ... ]
within a single field, so we can limit the possible parameters to be passed, as seen in the official docs here.There are two ways to do this; one is specifying directly in-place, another is to give reference to a definition, and the both cases fail similarly to create the enum values on TypeScript models. In other words, enum definitions within the swagger spec fades away and has no effect.
Swagger-codegen version
Latest master; 802641b.
Swagger declaration file content or url
Example output (typescript/fetch):
That has no enum values defined at all.
Even though, I change the field type from
array
to any primitive, in-place enum definitions still disappear when generated:Example output (typescript/angular2 this time):
Command line used for generation
Regular
java -jar swagger-codegen-cli.jar generate -i spec.yml -l {language}
call with any of the typescript/framework pair as far as I'm aware of:Steps to reproduce
Most convenient way to reproduce (perhaps with the latest stable) is swagger editor:
Related issues
Suggest a Fix
Can help if the issue is addressed correctly.
The text was updated successfully, but these errors were encountered: