[Feature][TypeScript] request param enum as literal unions#7433
[Feature][TypeScript] request param enum as literal unions#7433wing328 merged 13 commits intoswagger-api:masterfrom macjohnny:feature/7365-typescript-request-param-enum
Conversation
… code in TypeScriptAngularClientCodegen, change type Object to Number in numericEnumValuesToEnumTypeUnion()
… code in TypeScriptAngularClientCodegen, change type Object to Number in numericEnumValuesToEnumTypeUnion()
|
See also the discussion in #7366 |
| any, | ||
| Pet, | ||
| ApiResponse, | ||
| Array<'available' | 'pending' | 'sold'>, |
There was a problem hiding this comment.
it seems that this has already been broken before, see the previous lines:
import {
Array<string>,
There was a problem hiding this comment.
@macjohnny what about fixing it by replacing {{ ... }} with {{{ ... }}} ?
There was a problem hiding this comment.
@wing328 it is broken even if the html issue is fixed, since it tries to import Array<string> from the file, but this is a generic type...
I will open a separate issue to have this fixed.
| @@ -1,4 +1,4 @@ | |||
| ## @swagger/jquery-typescript-petstore@0.0.1 | |||
| ## @swagger/angular2-typescript-petstore@0.0.1 | |||
There was a problem hiding this comment.
it seems this was introduced at some point before...
|
Could anyone of the technical comittee please revie this PR? |
|
I had a look at this PR and the change (which covers default codegen) looks good to me. I'll merge this into master if no one has any question by coming Wednesday. |
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\.3.0.0branch for changes related to OpenAPI spec 3.0. Default:master.Description of the PR
Allows request params of type enum to be represented as enum in the generated angular client code.
Before:
after:
fixes #7365
Replaces #7366