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,

0 commit comments

Comments
 (0)