File tree Expand file tree Collapse file tree 25 files changed +320
-320
lines changed
templates/base/http-clients
another-query-params/__snapshots__
custom-extensions/__snapshots__
defaultAsSuccess/__snapshots__
defaultResponse/__snapshots__
dot-path-params/__snapshots__
enumNamesAsValues/__snapshots__
extractRequestBody/__snapshots__
extractResponseBody/__snapshots__
moduleNameFirstTag/__snapshots__
moduleNameIndex/__snapshots__
on-insert-path-param/__snapshots__
singleHttpClient/__snapshots__
sortTypes-false/__snapshots__
typeSuffixPrefix/__snapshots__ Expand file tree Collapse file tree 25 files changed +320
-320
lines changed Original file line number Diff line number Diff line change @@ -104,9 +104,9 @@ export class HttpClient<SecurityDataType = unknown> {
104
104
private contentFormatters: Record<ContentType , (input: any) => any> = {
105
105
[ContentType.Json]: (input:any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input,
106
106
[ContentType.Text]: (input:any) => input !== null && typeof input !== "string" ? JSON.stringify(input) : input,
107
- [ContentType.FormData]: (input: FormData ) =>
108
- (Array.from(input. keys()) || [] ).reduce((formData, key) => {
109
- const property = input.get( key) ;
107
+ [ContentType.FormData]: (input: any ) =>
108
+ Object. keys(input || {} ).reduce((formData, key) => {
109
+ const property = input[ key] ;
110
110
formData.append(
111
111
key,
112
112
property instanceof Blob ?
Load Diff Large diffs are not rendered by default.
Load Diff Large diffs are not rendered by default.
Original file line number Diff line number Diff line change @@ -138,9 +138,9 @@ export class HttpClient<SecurityDataType = unknown> {
138
138
[ContentType .Json ]: (input : any ) =>
139
139
input !== null && (typeof input === " object" || typeof input === " string" ) ? JSON .stringify (input ) : input ,
140
140
[ContentType .Text ]: (input : any ) => (input !== null && typeof input !== " string" ? JSON .stringify (input ) : input ),
141
- [ContentType .FormData ]: (input : FormData ) =>
142
- ( Array . from ( input . keys ()) || [] ).reduce ((formData , key ) => {
143
- const property = input . get ( key ) ;
141
+ [ContentType .FormData ]: (input : any ) =>
142
+ Object . keys (input || {} ).reduce ((formData , key ) => {
143
+ const property = input [ key ] ;
144
144
formData .append (
145
145
key ,
146
146
property instanceof Blob
Original file line number Diff line number Diff line change @@ -110,9 +110,9 @@ export class HttpClient<SecurityDataType = unknown> {
110
110
[ContentType .Json ]: (input : any ) =>
111
111
input !== null && (typeof input === " object" || typeof input === " string" ) ? JSON .stringify (input ) : input ,
112
112
[ContentType .Text ]: (input : any ) => (input !== null && typeof input !== " string" ? JSON .stringify (input ) : input ),
113
- [ContentType .FormData ]: (input : FormData ) =>
114
- ( Array . from ( input . keys ()) || [] ).reduce ((formData , key ) => {
115
- const property = input . get ( key ) ;
113
+ [ContentType .FormData ]: (input : any ) =>
114
+ Object . keys (input || {} ).reduce ((formData , key ) => {
115
+ const property = input [ key ] ;
116
116
formData .append (
117
117
key ,
118
118
property instanceof Blob
Original file line number Diff line number Diff line change @@ -150,9 +150,9 @@ export class HttpClient<SecurityDataType = unknown> {
150
150
[ContentType .Json ]: (input : any ) =>
151
151
input !== null && (typeof input === " object" || typeof input === " string" ) ? JSON .stringify (input ) : input ,
152
152
[ContentType .Text ]: (input : any ) => (input !== null && typeof input !== " string" ? JSON .stringify (input ) : input ),
153
- [ContentType .FormData ]: (input : FormData ) =>
154
- ( Array . from ( input . keys ()) || [] ).reduce ((formData , key ) => {
155
- const property = input . get ( key ) ;
153
+ [ContentType .FormData ]: (input : any ) =>
154
+ Object . keys (input || {} ).reduce ((formData , key ) => {
155
+ const property = input [ key ] ;
156
156
formData .append (
157
157
key ,
158
158
property instanceof Blob
Original file line number Diff line number Diff line change @@ -110,9 +110,9 @@ export class HttpClient<SecurityDataType = unknown> {
110
110
[ContentType .Json ]: (input : any ) =>
111
111
input !== null && (typeof input === " object" || typeof input === " string" ) ? JSON .stringify (input ) : input ,
112
112
[ContentType .Text ]: (input : any ) => (input !== null && typeof input !== " string" ? JSON .stringify (input ) : input ),
113
- [ContentType .FormData ]: (input : FormData ) =>
114
- ( Array . from ( input . keys ()) || [] ).reduce ((formData , key ) => {
115
- const property = input . get ( key ) ;
113
+ [ContentType .FormData ]: (input : any ) =>
114
+ Object . keys (input || {} ).reduce ((formData , key ) => {
115
+ const property = input [ key ] ;
116
116
formData .append (
117
117
key ,
118
118
property instanceof Blob
Original file line number Diff line number Diff line change @@ -110,9 +110,9 @@ export class HttpClient<SecurityDataType = unknown> {
110
110
[ContentType .Json ]: (input : any ) =>
111
111
input !== null && (typeof input === " object" || typeof input === " string" ) ? JSON .stringify (input ) : input ,
112
112
[ContentType .Text ]: (input : any ) => (input !== null && typeof input !== " string" ? JSON .stringify (input ) : input ),
113
- [ContentType .FormData ]: (input : FormData ) =>
114
- ( Array . from ( input . keys ()) || [] ).reduce ((formData , key ) => {
115
- const property = input . get ( key ) ;
113
+ [ContentType .FormData ]: (input : any ) =>
114
+ Object . keys (input || {} ).reduce ((formData , key ) => {
115
+ const property = input [ key ] ;
116
116
formData .append (
117
117
key ,
118
118
property instanceof Blob
Original file line number Diff line number Diff line change @@ -112,9 +112,9 @@ export class HttpClient<SecurityDataType = unknown> {
112
112
[ContentType .Json ]: (input : any ) =>
113
113
input !== null && (typeof input === " object" || typeof input === " string" ) ? JSON .stringify (input ) : input ,
114
114
[ContentType .Text ]: (input : any ) => (input !== null && typeof input !== " string" ? JSON .stringify (input ) : input ),
115
- [ContentType .FormData ]: (input : FormData ) =>
116
- ( Array . from ( input . keys ()) || [] ).reduce ((formData , key ) => {
117
- const property = input . get ( key ) ;
115
+ [ContentType .FormData ]: (input : any ) =>
116
+ Object . keys (input || {} ).reduce ((formData , key ) => {
117
+ const property = input [ key ] ;
118
118
formData .append (
119
119
key ,
120
120
property instanceof Blob
Original file line number Diff line number Diff line change @@ -302,9 +302,9 @@ export class HttpClient<SecurityDataType = unknown> {
302
302
[ContentType .Json ]: (input : any ) =>
303
303
input !== null && (typeof input === " object" || typeof input === " string" ) ? JSON .stringify (input ) : input ,
304
304
[ContentType .Text ]: (input : any ) => (input !== null && typeof input !== " string" ? JSON .stringify (input ) : input ),
305
- [ContentType .FormData ]: (input : FormData ) =>
306
- ( Array . from ( input . keys ()) || [] ).reduce ((formData , key ) => {
307
- const property = input . get ( key ) ;
305
+ [ContentType .FormData ]: (input : any ) =>
306
+ Object . keys (input || {} ).reduce ((formData , key ) => {
307
+ const property = input [ key ] ;
308
308
formData .append (
309
309
key ,
310
310
property instanceof Blob
Original file line number Diff line number Diff line change @@ -263,9 +263,9 @@ export class HttpClient<SecurityDataType = unknown> {
263
263
[ContentType .Json ]: (input : any ) =>
264
264
input !== null && (typeof input === " object" || typeof input === " string" ) ? JSON .stringify (input ) : input ,
265
265
[ContentType .Text ]: (input : any ) => (input !== null && typeof input !== " string" ? JSON .stringify (input ) : input ),
266
- [ContentType .FormData ]: (input : FormData ) =>
267
- ( Array . from ( input . keys ()) || [] ).reduce ((formData , key ) => {
268
- const property = input . get ( key ) ;
266
+ [ContentType .FormData ]: (input : any ) =>
267
+ Object . keys (input || {} ).reduce ((formData , key ) => {
268
+ const property = input [ key ] ;
269
269
formData .append (
270
270
key ,
271
271
property instanceof Blob
Original file line number Diff line number Diff line change @@ -185,9 +185,9 @@ export class HttpClient<SecurityDataType = unknown> {
185
185
[ContentType .Json ]: (input : any ) =>
186
186
input !== null && (typeof input === " object" || typeof input === " string" ) ? JSON .stringify (input ) : input ,
187
187
[ContentType .Text ]: (input : any ) => (input !== null && typeof input !== " string" ? JSON .stringify (input ) : input ),
188
- [ContentType .FormData ]: (input : FormData ) =>
189
- ( Array . from ( input . keys ()) || [] ).reduce ((formData , key ) => {
190
- const property = input . get ( key ) ;
188
+ [ContentType .FormData ]: (input : any ) =>
189
+ Object . keys (input || {} ).reduce ((formData , key ) => {
190
+ const property = input [ key ] ;
191
191
formData .append (
192
192
key ,
193
193
property instanceof Blob
Original file line number Diff line number Diff line change @@ -265,9 +265,9 @@ export class HttpClient<SecurityDataType = unknown> {
265
265
[ContentType .Json ]: (input : any ) =>
266
266
input !== null && (typeof input === " object" || typeof input === " string" ) ? JSON .stringify (input ) : input ,
267
267
[ContentType .Text ]: (input : any ) => (input !== null && typeof input !== " string" ? JSON .stringify (input ) : input ),
268
- [ContentType .FormData ]: (input : FormData ) =>
269
- ( Array . from ( input . keys ()) || [] ).reduce ((formData , key ) => {
270
- const property = input . get ( key ) ;
268
+ [ContentType .FormData ]: (input : any ) =>
269
+ Object . keys (input || {} ).reduce ((formData , key ) => {
270
+ const property = input [ key ] ;
271
271
formData .append (
272
272
key ,
273
273
property instanceof Blob
Original file line number Diff line number Diff line change @@ -260,9 +260,9 @@ export class HttpClient<SecurityDataType = unknown> {
260
260
[ContentType .Json ]: (input : any ) =>
261
261
input !== null && (typeof input === " object" || typeof input === " string" ) ? JSON .stringify (input ) : input ,
262
262
[ContentType .Text ]: (input : any ) => (input !== null && typeof input !== " string" ? JSON .stringify (input ) : input ),
263
- [ContentType .FormData ]: (input : FormData ) =>
264
- ( Array . from ( input . keys ()) || [] ).reduce ((formData , key ) => {
265
- const property = input . get ( key ) ;
263
+ [ContentType .FormData ]: (input : any ) =>
264
+ Object . keys (input || {} ).reduce ((formData , key ) => {
265
+ const property = input [ key ] ;
266
266
formData .append (
267
267
key ,
268
268
property instanceof Blob
Original file line number Diff line number Diff line change @@ -64,8 +64,8 @@ export class HttpClient {
64
64
input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input,
65
65
[ContentType.Text]: (input) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input),
66
66
[ContentType.FormData]: (input) =>
67
- (Array.from(input. keys()) || [] ).reduce((formData, key) => {
68
- const property = input.get( key) ;
67
+ Object. keys(input || {} ).reduce((formData, key) => {
68
+ const property = input[ key] ;
69
69
formData.append(
70
70
key,
71
71
property instanceof Blob
Original file line number Diff line number Diff line change @@ -235,9 +235,9 @@ export class HttpClient<SecurityDataType = unknown> {
235
235
[ContentType .Json ]: (input : any ) =>
236
236
input !== null && (typeof input === " object" || typeof input === " string" ) ? JSON .stringify (input ) : input ,
237
237
[ContentType .Text ]: (input : any ) => (input !== null && typeof input !== " string" ? JSON .stringify (input ) : input ),
238
- [ContentType .FormData ]: (input : FormData ) =>
239
- ( Array . from ( input . keys ()) || [] ).reduce ((formData , key ) => {
240
- const property = input . get ( key ) ;
238
+ [ContentType .FormData ]: (input : any ) =>
239
+ Object . keys (input || {} ).reduce ((formData , key ) => {
240
+ const property = input [ key ] ;
241
241
formData .append (
242
242
key ,
243
243
property instanceof Blob
Original file line number Diff line number Diff line change @@ -235,9 +235,9 @@ export class HttpClient<SecurityDataType = unknown> {
235
235
[ContentType .Json ]: (input : any ) =>
236
236
input !== null && (typeof input === " object" || typeof input === " string" ) ? JSON .stringify (input ) : input ,
237
237
[ContentType .Text ]: (input : any ) => (input !== null && typeof input !== " string" ? JSON .stringify (input ) : input ),
238
- [ContentType .FormData ]: (input : FormData ) =>
239
- ( Array . from ( input . keys ()) || [] ).reduce ((formData , key ) => {
240
- const property = input . get ( key ) ;
238
+ [ContentType .FormData ]: (input : any ) =>
239
+ Object . keys (input || {} ).reduce ((formData , key ) => {
240
+ const property = input [ key ] ;
241
241
formData .append (
242
242
key ,
243
243
property instanceof Blob
Original file line number Diff line number Diff line change @@ -110,9 +110,9 @@ export class HttpClient<SecurityDataType = unknown> {
110
110
[ContentType .Json ]: (input : any ) =>
111
111
input !== null && (typeof input === " object" || typeof input === " string" ) ? JSON .stringify (input ) : input ,
112
112
[ContentType .Text ]: (input : any ) => (input !== null && typeof input !== " string" ? JSON .stringify (input ) : input ),
113
- [ContentType .FormData ]: (input : FormData ) =>
114
- ( Array . from ( input . keys ()) || [] ).reduce ((formData , key ) => {
115
- const property = input . get ( key ) ;
113
+ [ContentType .FormData ]: (input : any ) =>
114
+ Object . keys (input || {} ).reduce ((formData , key ) => {
115
+ const property = input [ key ] ;
116
116
formData .append (
117
117
key ,
118
118
property instanceof Blob
Original file line number Diff line number Diff line change @@ -1867,9 +1867,9 @@ export class HttpClient<SecurityDataType = unknown> {
1867
1867
[ContentType.Json]: (input: any) =>
1868
1868
input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input,
1869
1869
[ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input),
1870
- [ContentType.FormData]: (input: FormData ) =>
1871
- (Array.from(input. keys()) || [] ).reduce((formData, key) => {
1872
- const property = input.get( key) ;
1870
+ [ContentType.FormData]: (input: any ) =>
1871
+ Object. keys(input || {} ).reduce((formData, key) => {
1872
+ const property = input[ key] ;
1873
1873
formData.append(
1874
1874
key,
1875
1875
property instanceof Blob
Original file line number Diff line number Diff line change @@ -150,9 +150,9 @@ export class HttpClient<SecurityDataType = unknown> {
150
150
[ContentType .Json ]: (input : any ) =>
151
151
input !== null && (typeof input === " object" || typeof input === " string" ) ? JSON .stringify (input ) : input ,
152
152
[ContentType .Text ]: (input : any ) => (input !== null && typeof input !== " string" ? JSON .stringify (input ) : input ),
153
- [ContentType .FormData ]: (input : FormData ) =>
154
- ( Array . from ( input . keys ()) || [] ).reduce ((formData , key ) => {
155
- const property = input . get ( key ) ;
153
+ [ContentType .FormData ]: (input : any ) =>
154
+ Object . keys (input || {} ).reduce ((formData , key ) => {
155
+ const property = input [ key ] ;
156
156
formData .append (
157
157
key ,
158
158
property instanceof Blob
Original file line number Diff line number Diff line change @@ -110,9 +110,9 @@ export class HttpClient<SecurityDataType = unknown> {
110
110
[ContentType .Json ]: (input : any ) =>
111
111
input !== null && (typeof input === " object" || typeof input === " string" ) ? JSON .stringify (input ) : input ,
112
112
[ContentType .Text ]: (input : any ) => (input !== null && typeof input !== " string" ? JSON .stringify (input ) : input ),
113
- [ContentType .FormData ]: (input : FormData ) =>
114
- ( Array . from ( input . keys ()) || [] ).reduce ((formData , key ) => {
115
- const property = input . get ( key ) ;
113
+ [ContentType .FormData ]: (input : any ) =>
114
+ Object . keys (input || {} ).reduce ((formData , key ) => {
115
+ const property = input [ key ] ;
116
116
formData .append (
117
117
key ,
118
118
property instanceof Blob
Original file line number Diff line number Diff line change @@ -1867,9 +1867,9 @@ export class HttpClient<SecurityDataType = unknown> {
1867
1867
[ContentType.Json]: (input: any) =>
1868
1868
input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input,
1869
1869
[ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input),
1870
- [ContentType.FormData]: (input: FormData ) =>
1871
- (Array.from(input. keys()) || [] ).reduce((formData, key) => {
1872
- const property = input.get( key) ;
1870
+ [ContentType.FormData]: (input: any ) =>
1871
+ Object. keys(input || {} ).reduce((formData, key) => {
1872
+ const property = input[ key] ;
1873
1873
formData.append(
1874
1874
key,
1875
1875
property instanceof Blob
Original file line number Diff line number Diff line change @@ -1867,9 +1867,9 @@ export class HttpClient<SecurityDataType = unknown> {
1867
1867
[ContentType.Json]: (input: any) =>
1868
1868
input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input,
1869
1869
[ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input),
1870
- [ContentType.FormData]: (input: FormData ) =>
1871
- (Array.from(input. keys()) || [] ).reduce((formData, key) => {
1872
- const property = input.get( key) ;
1870
+ [ContentType.FormData]: (input: any ) =>
1871
+ Object. keys(input || {} ).reduce((formData, key) => {
1872
+ const property = input[ key] ;
1873
1873
formData.append(
1874
1874
key,
1875
1875
property instanceof Blob
Original file line number Diff line number Diff line change @@ -1867,9 +1867,9 @@ export class HttpClient<SecurityDataType = unknown> {
1867
1867
[ContentType.Json]: (input: any) =>
1868
1868
input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input,
1869
1869
[ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input),
1870
- [ContentType.FormData]: (input: FormData ) =>
1871
- (Array.from(input. keys()) || [] ).reduce((formData, key) => {
1872
- const property = input.get( key) ;
1870
+ [ContentType.FormData]: (input: any ) =>
1871
+ Object. keys(input || {} ).reduce((formData, key) => {
1872
+ const property = input[ key] ;
1873
1873
formData.append(
1874
1874
key,
1875
1875
property instanceof Blob
Original file line number Diff line number Diff line change @@ -122,9 +122,9 @@ export class HttpClient<SecurityDataType = unknown> {
122
122
[ContentType .Json ]: (input : any ) =>
123
123
input !== null && (typeof input === " object" || typeof input === " string" ) ? JSON .stringify (input ) : input ,
124
124
[ContentType .Text ]: (input : any ) => (input !== null && typeof input !== " string" ? JSON .stringify (input ) : input ),
125
- [ContentType .FormData ]: (input : FormData ) =>
126
- ( Array . from ( input . keys ()) || [] ).reduce ((formData , key ) => {
127
- const property = input . get ( key ) ;
125
+ [ContentType .FormData ]: (input : any ) =>
126
+ Object . keys (input || {} ).reduce ((formData , key ) => {
127
+ const property = input [ key ] ;
128
128
formData .append (
129
129
key ,
130
130
property instanceof Blob
You can’t perform that action at this time.
0 commit comments