File tree Expand file tree Collapse file tree 5 files changed +56
-3
lines changed Expand file tree Collapse file tree 5 files changed +56
-3
lines changed Original file line number Diff line number Diff line change @@ -6,9 +6,10 @@ feat: `--custom-config <string>` option (#503)
66feat: ` --sort-routes ` option, ability to sort routes;
77fix: critical bugs based with extract types and enums
88fix: sort types option (sort was not correctly work with nested or extracted types)
9- fix: problems based with extracting enums;
9+ fix: problems based with extracting enums;
1010fix: nullable enum with integer values (#543 )
11- chore: refactoring the axios imports
11+ fix: generation enum numbers as strings one (#534 )
12+ chore: refactoring the axios imports
1213fix: non-object custom spec extensions (#500 )
1314fix(docs): input instead of output in readme
1415internal: remove redundant internal scripts
@@ -28,7 +29,7 @@ fix: problem with filtering primitive in complex types (#459)
2829feat: add discriminator property support (#456 )
2930internal: prepare code + templates for async code execution (next plans)
3031fix: problems with dot in query params (hard fix) (#460 )
31- feature: ability to send custom Ts output code translator to js. Example:
32+ feature: ability to send custom Ts output code translator to js. Example:
3233``` ts
3334 const { Translator } = require (" swagger-typescript-api/src/translators/translator" );
3435 const { JavascriptTranslator } = require (" swagger-typescript-api/src/translators/javascript" );
Original file line number Diff line number Diff line change @@ -90,3 +90,11 @@ export enum SomeInterestEnum {
9090 ASDds = "ASDds" ,
9191 HSDFDS = "HSDFDS" ,
9292}
93+
94+ export interface PostFooPayload {
95+ someTypeId ?: 1 | 2 | 3 | 4 | 5 ;
96+ }
97+
98+ export interface PostFooParams {
99+ testKek : 1 | 2 | 3 | 4 | 5 ;
100+ }
Original file line number Diff line number Diff line change 8080 " HSDFDS"
8181 ]
8282 }
83+ },
84+ "paths" : {
85+ "/foo" : {
86+ "post" : {
87+ "operationId" : " postFoo" ,
88+ "parameters" : [
89+ {
90+ "in" : " query" ,
91+ "name" : " testKek" ,
92+ "required" : true ,
93+ "type" : " integer" ,
94+ "enum" : [1 ,2 ,3 ,4 ,5 ]
95+ }
96+ ],
97+ "requestBody" : {
98+ "content" : {
99+ "application/json" : {
100+ "schema" : {
101+ "type" : " object" ,
102+ "properties" : {
103+ "someTypeId" : {
104+ "type" :" integer" ,
105+ "enum" :[1 ,2 ,3 ,4 ,5 ]
106+ }
107+ }
108+ }
109+ }
110+ }
111+ },
112+ "responses" : {}
113+ }
114+ }
83115 }
84116}
Original file line number Diff line number Diff line change @@ -90,3 +90,11 @@ export enum SomeInterestEnum {
9090 ASDds = "ASDds" ,
9191 HSDFDS = "HSDFDS" ,
9292}
93+
94+ export interface PostFooPayload {
95+ someTypeId ?: 1 | 2 | 3 | 4 | 5 ;
96+ }
97+
98+ export interface PostFooParams {
99+ testKek : 1 | 2 | 3 | 4 | 5 ;
100+ }
Original file line number Diff line number Diff line change @@ -13,6 +13,10 @@ schemas.forEach(({ absolutePath, apiFileName }) => {
1313 name : apiFileName ,
1414 input : absolutePath ,
1515 output : resolve ( __dirname , "./" ) ,
16+ extractRequestParams : true ,
17+ extractRequestBody : true ,
18+ extractResponseBody : true ,
19+ extractResponseError : true ,
1620 generateClient : false ,
1721 } ) . then ( ( ) => {
1822 validateGeneratedModule ( resolve ( __dirname , `./${ apiFileName } ` ) ) ;
You can’t perform that action at this time.
0 commit comments