Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# next release

# 5.1.5

Fixes:
- ContentType.FormData no longer sets the correct boundary (issue #172, thanks @Styn)

# 5.1.4

Fixes:
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "swagger-typescript-api",
"version": "5.1.4",
"version": "5.1.5",
"description": "Create typescript api module from swagger schema",
"scripts": {
"cli:json": "node index.js -r -d -p ./swagger-test-cli.json -n swagger-test-cli.ts --extract-request-params --enum-names-as-values",
Expand Down
2 changes: 1 addition & 1 deletion templates/default/http-client.eta
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ export class HttpClient<SecurityDataType = unknown> {
{
...requestParams,
headers: {
...(type ? { "Content-Type": type } : {}),
...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
...(requestParams.headers || {}),
},
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,
Expand Down
2 changes: 1 addition & 1 deletion templates/modular/http-client.eta
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ export class HttpClient<SecurityDataType = unknown> {
{
...requestParams,
headers: {
...(type ? { "Content-Type": type } : {}),
...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
...(requestParams.headers || {}),
},
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,
Expand Down
2 changes: 1 addition & 1 deletion tests/generated/v2.0/adafruit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ export class HttpClient<SecurityDataType = unknown> {
return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
...requestParams,
headers: {
...(type ? { "Content-Type": type } : {}),
...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
...(requestParams.headers || {}),
},
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,
Expand Down
2 changes: 1 addition & 1 deletion tests/generated/v2.0/another-example.ts
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ export class HttpClient<SecurityDataType = unknown> {
return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
...requestParams,
headers: {
...(type ? { "Content-Type": type } : {}),
...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
...(requestParams.headers || {}),
},
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,
Expand Down
2 changes: 1 addition & 1 deletion tests/generated/v2.0/another-schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ export class HttpClient<SecurityDataType = unknown> {
return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
...requestParams,
headers: {
...(type ? { "Content-Type": type } : {}),
...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
...(requestParams.headers || {}),
},
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,
Expand Down
2 changes: 1 addition & 1 deletion tests/generated/v2.0/api-with-examples.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ export class HttpClient<SecurityDataType = unknown> {
return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
...requestParams,
headers: {
...(type ? { "Content-Type": type } : {}),
...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
...(requestParams.headers || {}),
},
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,
Expand Down
2 changes: 1 addition & 1 deletion tests/generated/v2.0/authentiq.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ export class HttpClient<SecurityDataType = unknown> {
return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
...requestParams,
headers: {
...(type ? { "Content-Type": type } : {}),
...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
...(requestParams.headers || {}),
},
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,
Expand Down
2 changes: 1 addition & 1 deletion tests/generated/v2.0/example1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ export class HttpClient<SecurityDataType = unknown> {
return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
...requestParams,
headers: {
...(type ? { "Content-Type": type } : {}),
...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
...(requestParams.headers || {}),
},
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,
Expand Down
2 changes: 1 addition & 1 deletion tests/generated/v2.0/file-formdata-example.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ export class HttpClient<SecurityDataType = unknown> {
return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
...requestParams,
headers: {
...(type ? { "Content-Type": type } : {}),
...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
...(requestParams.headers || {}),
},
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,
Expand Down
2 changes: 1 addition & 1 deletion tests/generated/v2.0/furkot-example.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ export class HttpClient<SecurityDataType = unknown> {
return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
...requestParams,
headers: {
...(type ? { "Content-Type": type } : {}),
...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
...(requestParams.headers || {}),
},
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,
Expand Down
2 changes: 1 addition & 1 deletion tests/generated/v2.0/giphy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ export class HttpClient<SecurityDataType = unknown> {
return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
...requestParams,
headers: {
...(type ? { "Content-Type": type } : {}),
...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
...(requestParams.headers || {}),
},
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,
Expand Down
2 changes: 1 addition & 1 deletion tests/generated/v2.0/github-swagger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1590,7 +1590,7 @@ export class HttpClient<SecurityDataType = unknown> {
return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
...requestParams,
headers: {
...(type ? { "Content-Type": type } : {}),
...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
...(requestParams.headers || {}),
},
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,
Expand Down
2 changes: 1 addition & 1 deletion tests/generated/v2.0/path-args.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ export class HttpClient<SecurityDataType = unknown> {
return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
...requestParams,
headers: {
...(type ? { "Content-Type": type } : {}),
...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
...(requestParams.headers || {}),
},
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,
Expand Down
2 changes: 1 addition & 1 deletion tests/generated/v2.0/petstore-expanded.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ export class HttpClient<SecurityDataType = unknown> {
return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
...requestParams,
headers: {
...(type ? { "Content-Type": type } : {}),
...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
...(requestParams.headers || {}),
},
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,
Expand Down
2 changes: 1 addition & 1 deletion tests/generated/v2.0/petstore-minimal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ export class HttpClient<SecurityDataType = unknown> {
return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
...requestParams,
headers: {
...(type ? { "Content-Type": type } : {}),
...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
...(requestParams.headers || {}),
},
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,
Expand Down
2 changes: 1 addition & 1 deletion tests/generated/v2.0/petstore-simple.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ export class HttpClient<SecurityDataType = unknown> {
return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
...requestParams,
headers: {
...(type ? { "Content-Type": type } : {}),
...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
...(requestParams.headers || {}),
},
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,
Expand Down
2 changes: 1 addition & 1 deletion tests/generated/v2.0/petstore-swagger-io.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ export class HttpClient<SecurityDataType = unknown> {
return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
...requestParams,
headers: {
...(type ? { "Content-Type": type } : {}),
...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
...(requestParams.headers || {}),
},
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,
Expand Down
2 changes: 1 addition & 1 deletion tests/generated/v2.0/petstore-with-external-docs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ export class HttpClient<SecurityDataType = unknown> {
return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
...requestParams,
headers: {
...(type ? { "Content-Type": type } : {}),
...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
...(requestParams.headers || {}),
},
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,
Expand Down
2 changes: 1 addition & 1 deletion tests/generated/v2.0/petstore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ export class HttpClient<SecurityDataType = unknown> {
return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
...requestParams,
headers: {
...(type ? { "Content-Type": type } : {}),
...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
...(requestParams.headers || {}),
},
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,
Expand Down
2 changes: 1 addition & 1 deletion tests/generated/v2.0/query-path-param.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ export class HttpClient<SecurityDataType = unknown> {
return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
...requestParams,
headers: {
...(type ? { "Content-Type": type } : {}),
...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
...(requestParams.headers || {}),
},
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,
Expand Down
2 changes: 1 addition & 1 deletion tests/generated/v2.0/uber.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ export class HttpClient<SecurityDataType = unknown> {
return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
...requestParams,
headers: {
...(type ? { "Content-Type": type } : {}),
...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
...(requestParams.headers || {}),
},
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,
Expand Down
2 changes: 1 addition & 1 deletion tests/generated/v3.0/additional-properties.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ export class HttpClient<SecurityDataType = unknown> {
return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
...requestParams,
headers: {
...(type ? { "Content-Type": type } : {}),
...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
...(requestParams.headers || {}),
},
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,
Expand Down
2 changes: 1 addition & 1 deletion tests/generated/v3.0/additional-properties2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ export class HttpClient<SecurityDataType = unknown> {
return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
...requestParams,
headers: {
...(type ? { "Content-Type": type } : {}),
...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
...(requestParams.headers || {}),
},
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,
Expand Down
2 changes: 1 addition & 1 deletion tests/generated/v3.0/allof-example.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ export class HttpClient<SecurityDataType = unknown> {
return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
...requestParams,
headers: {
...(type ? { "Content-Type": type } : {}),
...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
...(requestParams.headers || {}),
},
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,
Expand Down
2 changes: 1 addition & 1 deletion tests/generated/v3.0/anyof-example.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ export class HttpClient<SecurityDataType = unknown> {
return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
...requestParams,
headers: {
...(type ? { "Content-Type": type } : {}),
...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
...(requestParams.headers || {}),
},
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,
Expand Down
2 changes: 1 addition & 1 deletion tests/generated/v3.0/api-with-examples.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ export class HttpClient<SecurityDataType = unknown> {
return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
...requestParams,
headers: {
...(type ? { "Content-Type": type } : {}),
...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
...(requestParams.headers || {}),
},
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,
Expand Down
2 changes: 1 addition & 1 deletion tests/generated/v3.0/callback-example.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ export class HttpClient<SecurityDataType = unknown> {
return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
...requestParams,
headers: {
...(type ? { "Content-Type": type } : {}),
...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
...(requestParams.headers || {}),
},
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,
Expand Down
2 changes: 1 addition & 1 deletion tests/generated/v3.0/components-responses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ export class HttpClient<SecurityDataType = unknown> {
return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
...requestParams,
headers: {
...(type ? { "Content-Type": type } : {}),
...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
...(requestParams.headers || {}),
},
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,
Expand Down
2 changes: 1 addition & 1 deletion tests/generated/v3.0/explode-param-3.0.1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ export class HttpClient<SecurityDataType = unknown> {
return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
...requestParams,
headers: {
...(type ? { "Content-Type": type } : {}),
...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
...(requestParams.headers || {}),
},
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,
Expand Down
2 changes: 1 addition & 1 deletion tests/generated/v3.0/full-swagger-scheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9109,7 +9109,7 @@ export class HttpClient<SecurityDataType = unknown> {
return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
...requestParams,
headers: {
...(type ? { "Content-Type": type } : {}),
...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
...(requestParams.headers || {}),
},
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,
Expand Down
2 changes: 1 addition & 1 deletion tests/generated/v3.0/link-example.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ export class HttpClient<SecurityDataType = unknown> {
return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
...requestParams,
headers: {
...(type ? { "Content-Type": type } : {}),
...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
...(requestParams.headers || {}),
},
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,
Expand Down
2 changes: 1 addition & 1 deletion tests/generated/v3.0/no-definitions-schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ export class HttpClient<SecurityDataType = unknown> {
return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
...requestParams,
headers: {
...(type ? { "Content-Type": type } : {}),
...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
...(requestParams.headers || {}),
},
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,
Expand Down
2 changes: 1 addition & 1 deletion tests/generated/v3.0/nullable-refs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ export class HttpClient<SecurityDataType = unknown> {
return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
...requestParams,
headers: {
...(type ? { "Content-Type": type } : {}),
...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
...(requestParams.headers || {}),
},
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,
Expand Down
2 changes: 1 addition & 1 deletion tests/generated/v3.0/oneof-example.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ export class HttpClient<SecurityDataType = unknown> {
return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
...requestParams,
headers: {
...(type ? { "Content-Type": type } : {}),
...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
...(requestParams.headers || {}),
},
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,
Expand Down
2 changes: 1 addition & 1 deletion tests/generated/v3.0/personal-api-example.ts
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ export class HttpClient<SecurityDataType = unknown> {
return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
...requestParams,
headers: {
...(type ? { "Content-Type": type } : {}),
...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
...(requestParams.headers || {}),
},
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,
Expand Down
2 changes: 1 addition & 1 deletion tests/generated/v3.0/petstore-expanded.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ export class HttpClient<SecurityDataType = unknown> {
return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
...requestParams,
headers: {
...(type ? { "Content-Type": type } : {}),
...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
...(requestParams.headers || {}),
},
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,
Expand Down
2 changes: 1 addition & 1 deletion tests/generated/v3.0/petstore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ export class HttpClient<SecurityDataType = unknown> {
return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
...requestParams,
headers: {
...(type ? { "Content-Type": type } : {}),
...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
...(requestParams.headers || {}),
},
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,
Expand Down
2 changes: 1 addition & 1 deletion tests/generated/v3.0/recursive-schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ export class HttpClient<SecurityDataType = unknown> {
return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
...requestParams,
headers: {
...(type ? { "Content-Type": type } : {}),
...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
...(requestParams.headers || {}),
},
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,
Expand Down
2 changes: 1 addition & 1 deletion tests/generated/v3.0/responses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ export class HttpClient<SecurityDataType = unknown> {
return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
...requestParams,
headers: {
...(type ? { "Content-Type": type } : {}),
...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
...(requestParams.headers || {}),
},
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,
Expand Down
2 changes: 1 addition & 1 deletion tests/generated/v3.0/swaggerhub-template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ export class HttpClient<SecurityDataType = unknown> {
return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
...requestParams,
headers: {
...(type ? { "Content-Type": type } : {}),
...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
...(requestParams.headers || {}),
},
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,
Expand Down
2 changes: 1 addition & 1 deletion tests/generated/v3.0/tsoa-odd-types-3.0.2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ export class HttpClient<SecurityDataType = unknown> {
return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
...requestParams,
headers: {
...(type ? { "Content-Type": type } : {}),
...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
...(requestParams.headers || {}),
},
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,
Expand Down
Loading