Skip to content

Commit 683311a

Browse files
js2meStynStijnLammens
authored
Release 5.1.5 (#175)
* Don't set multipart/form-data content-type (#173) * dont set multipart/form-data content-type * add ContentType.FormData exception to default template Co-authored-by: stijn.lammens <[email protected]> * bump: up version to 5.1.5; chore: refresh test schemas Co-authored-by: Stijn Lammens <[email protected]> Co-authored-by: stijn.lammens <[email protected]>
1 parent 166ad8d commit 683311a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+62
-57
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "swagger-typescript-api",
3-
"version": "5.1.4",
3+
"version": "5.1.5",
44
"description": "Create typescript api module from swagger schema",
55
"scripts": {
66
"cli:json": "node index.js -r -d -p ./swagger-test-cli.json -n swagger-test-cli.ts --extract-request-params --enum-names-as-values",

templates/default/http-client.eta

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ export class HttpClient<SecurityDataType = unknown> {
171171
{
172172
...requestParams,
173173
headers: {
174-
...(type ? { "Content-Type": type } : {}),
174+
...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
175175
...(requestParams.headers || {}),
176176
},
177177
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,

templates/modular/http-client.eta

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ export class HttpClient<SecurityDataType = unknown> {
171171
{
172172
...requestParams,
173173
headers: {
174-
...(type ? { "Content-Type": type } : {}),
174+
...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
175175
...(requestParams.headers || {}),
176176
},
177177
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,

tests/generated/v2.0/adafruit.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ export class HttpClient<SecurityDataType = unknown> {
320320
return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
321321
...requestParams,
322322
headers: {
323-
...(type ? { "Content-Type": type } : {}),
323+
...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
324324
...(requestParams.headers || {}),
325325
},
326326
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,

tests/generated/v2.0/another-example.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ export class HttpClient<SecurityDataType = unknown> {
296296
return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
297297
...requestParams,
298298
headers: {
299-
...(type ? { "Content-Type": type } : {}),
299+
...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
300300
...(requestParams.headers || {}),
301301
},
302302
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,

tests/generated/v2.0/another-schema.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ export class HttpClient<SecurityDataType = unknown> {
188188
return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
189189
...requestParams,
190190
headers: {
191-
...(type ? { "Content-Type": type } : {}),
191+
...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
192192
...(requestParams.headers || {}),
193193
},
194194
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,

tests/generated/v2.0/api-with-examples.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ export class HttpClient<SecurityDataType = unknown> {
165165
return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
166166
...requestParams,
167167
headers: {
168-
...(type ? { "Content-Type": type } : {}),
168+
...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
169169
...(requestParams.headers || {}),
170170
},
171171
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,

tests/generated/v2.0/authentiq.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ export class HttpClient<SecurityDataType = unknown> {
217217
return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
218218
...requestParams,
219219
headers: {
220-
...(type ? { "Content-Type": type } : {}),
220+
...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
221221
...(requestParams.headers || {}),
222222
},
223223
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,

tests/generated/v2.0/example1.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ export class HttpClient<SecurityDataType = unknown> {
192192
return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
193193
...requestParams,
194194
headers: {
195-
...(type ? { "Content-Type": type } : {}),
195+
...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
196196
...(requestParams.headers || {}),
197197
},
198198
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,

tests/generated/v2.0/file-formdata-example.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ export class HttpClient<SecurityDataType = unknown> {
165165
return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
166166
...requestParams,
167167
headers: {
168-
...(type ? { "Content-Type": type } : {}),
168+
...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
169169
...(requestParams.headers || {}),
170170
},
171171
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,

tests/generated/v2.0/furkot-example.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ export class HttpClient<SecurityDataType = unknown> {
228228
return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
229229
...requestParams,
230230
headers: {
231-
...(type ? { "Content-Type": type } : {}),
231+
...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
232232
...(requestParams.headers || {}),
233233
},
234234
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,

tests/generated/v2.0/giphy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ export class HttpClient<SecurityDataType = unknown> {
447447
return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
448448
...requestParams,
449449
headers: {
450-
...(type ? { "Content-Type": type } : {}),
450+
...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
451451
...(requestParams.headers || {}),
452452
},
453453
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,

tests/generated/v2.0/github-swagger.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1590,7 +1590,7 @@ export class HttpClient<SecurityDataType = unknown> {
15901590
return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
15911591
...requestParams,
15921592
headers: {
1593-
...(type ? { "Content-Type": type } : {}),
1593+
...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
15941594
...(requestParams.headers || {}),
15951595
},
15961596
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,

tests/generated/v2.0/path-args.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ export class HttpClient<SecurityDataType = unknown> {
165165
return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
166166
...requestParams,
167167
headers: {
168-
...(type ? { "Content-Type": type } : {}),
168+
...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
169169
...(requestParams.headers || {}),
170170
},
171171
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,

tests/generated/v2.0/petstore-expanded.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ export class HttpClient<SecurityDataType = unknown> {
202202
return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
203203
...requestParams,
204204
headers: {
205-
...(type ? { "Content-Type": type } : {}),
205+
...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
206206
...(requestParams.headers || {}),
207207
},
208208
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,

tests/generated/v2.0/petstore-minimal.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ export class HttpClient<SecurityDataType = unknown> {
173173
return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
174174
...requestParams,
175175
headers: {
176-
...(type ? { "Content-Type": type } : {}),
176+
...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
177177
...(requestParams.headers || {}),
178178
},
179179
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,

tests/generated/v2.0/petstore-simple.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ export class HttpClient<SecurityDataType = unknown> {
188188
return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
189189
...requestParams,
190190
headers: {
191-
...(type ? { "Content-Type": type } : {}),
191+
...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
192192
...(requestParams.headers || {}),
193193
},
194194
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,

tests/generated/v2.0/petstore-swagger-io.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ export class HttpClient<SecurityDataType = unknown> {
233233
return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
234234
...requestParams,
235235
headers: {
236-
...(type ? { "Content-Type": type } : {}),
236+
...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
237237
...(requestParams.headers || {}),
238238
},
239239
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,

tests/generated/v2.0/petstore-with-external-docs.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ export class HttpClient<SecurityDataType = unknown> {
178178
return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
179179
...requestParams,
180180
headers: {
181-
...(type ? { "Content-Type": type } : {}),
181+
...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
182182
...(requestParams.headers || {}),
183183
},
184184
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,

tests/generated/v2.0/petstore.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ export class HttpClient<SecurityDataType = unknown> {
180180
return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
181181
...requestParams,
182182
headers: {
183-
...(type ? { "Content-Type": type } : {}),
183+
...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
184184
...(requestParams.headers || {}),
185185
},
186186
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,

tests/generated/v2.0/query-path-param.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ export class HttpClient<SecurityDataType = unknown> {
165165
return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
166166
...requestParams,
167167
headers: {
168-
...(type ? { "Content-Type": type } : {}),
168+
...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
169169
...(requestParams.headers || {}),
170170
},
171171
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,

tests/generated/v2.0/uber.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ export class HttpClient<SecurityDataType = unknown> {
260260
return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
261261
...requestParams,
262262
headers: {
263-
...(type ? { "Content-Type": type } : {}),
263+
...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
264264
...(requestParams.headers || {}),
265265
},
266266
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,

tests/generated/v3.0/additional-properties.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ export class HttpClient<SecurityDataType = unknown> {
172172
return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
173173
...requestParams,
174174
headers: {
175-
...(type ? { "Content-Type": type } : {}),
175+
...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
176176
...(requestParams.headers || {}),
177177
},
178178
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,

tests/generated/v3.0/additional-properties2.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ export class HttpClient<SecurityDataType = unknown> {
169169
return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
170170
...requestParams,
171171
headers: {
172-
...(type ? { "Content-Type": type } : {}),
172+
...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
173173
...(requestParams.headers || {}),
174174
},
175175
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,

tests/generated/v3.0/allof-example.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ export class HttpClient<SecurityDataType = unknown> {
173173
return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
174174
...requestParams,
175175
headers: {
176-
...(type ? { "Content-Type": type } : {}),
176+
...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
177177
...(requestParams.headers || {}),
178178
},
179179
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,

tests/generated/v3.0/anyof-example.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ export class HttpClient<SecurityDataType = unknown> {
175175
return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
176176
...requestParams,
177177
headers: {
178-
...(type ? { "Content-Type": type } : {}),
178+
...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
179179
...(requestParams.headers || {}),
180180
},
181181
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,

tests/generated/v3.0/api-with-examples.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ export class HttpClient<SecurityDataType = unknown> {
165165
return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
166166
...requestParams,
167167
headers: {
168-
...(type ? { "Content-Type": type } : {}),
168+
...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
169169
...(requestParams.headers || {}),
170170
},
171171
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,

tests/generated/v3.0/callback-example.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ export class HttpClient<SecurityDataType = unknown> {
165165
return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
166166
...requestParams,
167167
headers: {
168-
...(type ? { "Content-Type": type } : {}),
168+
...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
169169
...(requestParams.headers || {}),
170170
},
171171
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,

tests/generated/v3.0/components-responses.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ export class HttpClient<SecurityDataType = unknown> {
165165
return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
166166
...requestParams,
167167
headers: {
168-
...(type ? { "Content-Type": type } : {}),
168+
...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
169169
...(requestParams.headers || {}),
170170
},
171171
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,

tests/generated/v3.0/explode-param-3.0.1.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ export class HttpClient<SecurityDataType = unknown> {
181181
return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
182182
...requestParams,
183183
headers: {
184-
...(type ? { "Content-Type": type } : {}),
184+
...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
185185
...(requestParams.headers || {}),
186186
},
187187
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,

tests/generated/v3.0/full-swagger-scheme.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9109,7 +9109,7 @@ export class HttpClient<SecurityDataType = unknown> {
91099109
return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
91109110
...requestParams,
91119111
headers: {
9112-
...(type ? { "Content-Type": type } : {}),
9112+
...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
91139113
...(requestParams.headers || {}),
91149114
},
91159115
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,

tests/generated/v3.0/link-example.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ export class HttpClient<SecurityDataType = unknown> {
182182
return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
183183
...requestParams,
184184
headers: {
185-
...(type ? { "Content-Type": type } : {}),
185+
...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
186186
...(requestParams.headers || {}),
187187
},
188188
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,

tests/generated/v3.0/no-definitions-schema.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ export class HttpClient<SecurityDataType = unknown> {
178178
return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
179179
...requestParams,
180180
headers: {
181-
...(type ? { "Content-Type": type } : {}),
181+
...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
182182
...(requestParams.headers || {}),
183183
},
184184
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,

tests/generated/v3.0/nullable-refs.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ export class HttpClient<SecurityDataType = unknown> {
179179
return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
180180
...requestParams,
181181
headers: {
182-
...(type ? { "Content-Type": type } : {}),
182+
...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
183183
...(requestParams.headers || {}),
184184
},
185185
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,

tests/generated/v3.0/oneof-example.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ export class HttpClient<SecurityDataType = unknown> {
175175
return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
176176
...requestParams,
177177
headers: {
178-
...(type ? { "Content-Type": type } : {}),
178+
...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
179179
...(requestParams.headers || {}),
180180
},
181181
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,

tests/generated/v3.0/personal-api-example.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ export class HttpClient<SecurityDataType = unknown> {
366366
return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
367367
...requestParams,
368368
headers: {
369-
...(type ? { "Content-Type": type } : {}),
369+
...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
370370
...(requestParams.headers || {}),
371371
},
372372
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,

tests/generated/v3.0/petstore-expanded.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ export class HttpClient<SecurityDataType = unknown> {
178178
return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
179179
...requestParams,
180180
headers: {
181-
...(type ? { "Content-Type": type } : {}),
181+
...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
182182
...(requestParams.headers || {}),
183183
},
184184
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,

tests/generated/v3.0/petstore.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ export class HttpClient<SecurityDataType = unknown> {
182182
return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
183183
...requestParams,
184184
headers: {
185-
...(type ? { "Content-Type": type } : {}),
185+
...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
186186
...(requestParams.headers || {}),
187187
},
188188
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,

tests/generated/v3.0/recursive-schema.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ export class HttpClient<SecurityDataType = unknown> {
179179
return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
180180
...requestParams,
181181
headers: {
182-
...(type ? { "Content-Type": type } : {}),
182+
...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
183183
...(requestParams.headers || {}),
184184
},
185185
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,

tests/generated/v3.0/responses.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ export class HttpClient<SecurityDataType = unknown> {
165165
return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
166166
...requestParams,
167167
headers: {
168-
...(type ? { "Content-Type": type } : {}),
168+
...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
169169
...(requestParams.headers || {}),
170170
},
171171
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,

tests/generated/v3.0/swaggerhub-template.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ export class HttpClient<SecurityDataType = unknown> {
165165
return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
166166
...requestParams,
167167
headers: {
168-
...(type ? { "Content-Type": type } : {}),
168+
...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
169169
...(requestParams.headers || {}),
170170
},
171171
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,

tests/generated/v3.0/tsoa-odd-types-3.0.2.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ export class HttpClient<SecurityDataType = unknown> {
286286
return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
287287
...requestParams,
288288
headers: {
289-
...(type ? { "Content-Type": type } : {}),
289+
...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
290290
...(requestParams.headers || {}),
291291
},
292292
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,

0 commit comments

Comments
 (0)