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)
6
6
feat: ` --sort-routes ` option, ability to sort routes;
7
7
fix: critical bugs based with extract types and enums
8
8
fix: 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;
10
10
fix: 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
12
13
fix: non-object custom spec extensions (#500 )
13
14
fix(docs): input instead of output in readme
14
15
internal: remove redundant internal scripts
@@ -28,7 +29,7 @@ fix: problem with filtering primitive in complex types (#459)
28
29
feat: add discriminator property support (#456 )
29
30
internal: prepare code + templates for async code execution (next plans)
30
31
fix: 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:
32
33
``` ts
33
34
const { Translator } = require (" swagger-typescript-api/src/translators/translator" );
34
35
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 {
90
90
ASDds = "ASDds" ,
91
91
HSDFDS = "HSDFDS" ,
92
92
}
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 80
80
" HSDFDS"
81
81
]
82
82
}
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
+ }
83
115
}
84
116
}
Original file line number Diff line number Diff line change @@ -90,3 +90,11 @@ export enum SomeInterestEnum {
90
90
ASDds = "ASDds" ,
91
91
HSDFDS = "HSDFDS" ,
92
92
}
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 }) => {
13
13
name : apiFileName ,
14
14
input : absolutePath ,
15
15
output : resolve ( __dirname , "./" ) ,
16
+ extractRequestParams : true ,
17
+ extractRequestBody : true ,
18
+ extractResponseBody : true ,
19
+ extractResponseError : true ,
16
20
generateClient : false ,
17
21
} ) . then ( ( ) => {
18
22
validateGeneratedModule ( resolve ( __dirname , `./${ apiFileName } ` ) ) ;
You can’t perform that action at this time.
0 commit comments