Skip to content

Commit d533512

Browse files
authored
Release 5.1.4 (#169)
* fix: header overwrite in default API template * chore: refresh test schemas generated apis * bump: up version to 5.1.4 Co-authored-by: @emilecantin
1 parent 9a61d94 commit d533512

Some content is hidden

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

57 files changed

+61
-56
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# next release
22

3+
# 5.1.4
4+
5+
Fixes:
6+
- header overwrite in `default` and `modular` API templates (thanks @emilecantin)
7+
38
# 5.1.3
49

510
Fixes:

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.3",
3+
"version": "5.1.4",
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
@@ -169,11 +169,11 @@ export class HttpClient<SecurityDataType = unknown> {
169169
return fetch(
170170
`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`,
171171
{
172+
...requestParams,
172173
headers: {
173174
...(type ? { "Content-Type": type } : {}),
174175
...(requestParams.headers || {}),
175176
},
176-
...requestParams,
177177
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,
178178
body: typeof body === "undefined" || body === null ? null : payloadFormatter(body),
179179
}

tests/generated/v2.0/adafruit.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,11 +318,11 @@ export class HttpClient<SecurityDataType = unknown> {
318318
const payloadFormatter = this.contentFormatters[type || ContentType.Json];
319319

320320
return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
321+
...requestParams,
321322
headers: {
322323
...(type ? { "Content-Type": type } : {}),
323324
...(requestParams.headers || {}),
324325
},
325-
...requestParams,
326326
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,
327327
body: typeof body === "undefined" || body === null ? null : payloadFormatter(body),
328328
}).then(async (response) => {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,11 +294,11 @@ export class HttpClient<SecurityDataType = unknown> {
294294
const payloadFormatter = this.contentFormatters[type || ContentType.Json];
295295

296296
return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
297+
...requestParams,
297298
headers: {
298299
...(type ? { "Content-Type": type } : {}),
299300
...(requestParams.headers || {}),
300301
},
301-
...requestParams,
302302
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,
303303
body: typeof body === "undefined" || body === null ? null : payloadFormatter(body),
304304
}).then(async (response) => {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,11 +186,11 @@ export class HttpClient<SecurityDataType = unknown> {
186186
const payloadFormatter = this.contentFormatters[type || ContentType.Json];
187187

188188
return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
189+
...requestParams,
189190
headers: {
190191
...(type ? { "Content-Type": type } : {}),
191192
...(requestParams.headers || {}),
192193
},
193-
...requestParams,
194194
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,
195195
body: typeof body === "undefined" || body === null ? null : payloadFormatter(body),
196196
}).then(async (response) => {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,11 +163,11 @@ export class HttpClient<SecurityDataType = unknown> {
163163
const payloadFormatter = this.contentFormatters[type || ContentType.Json];
164164

165165
return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
166+
...requestParams,
166167
headers: {
167168
...(type ? { "Content-Type": type } : {}),
168169
...(requestParams.headers || {}),
169170
},
170-
...requestParams,
171171
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,
172172
body: typeof body === "undefined" || body === null ? null : payloadFormatter(body),
173173
}).then(async (response) => {

tests/generated/v2.0/authentiq.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,11 +215,11 @@ export class HttpClient<SecurityDataType = unknown> {
215215
const payloadFormatter = this.contentFormatters[type || ContentType.Json];
216216

217217
return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
218+
...requestParams,
218219
headers: {
219220
...(type ? { "Content-Type": type } : {}),
220221
...(requestParams.headers || {}),
221222
},
222-
...requestParams,
223223
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,
224224
body: typeof body === "undefined" || body === null ? null : payloadFormatter(body),
225225
}).then(async (response) => {

tests/generated/v2.0/example1.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,11 +190,11 @@ export class HttpClient<SecurityDataType = unknown> {
190190
const payloadFormatter = this.contentFormatters[type || ContentType.Json];
191191

192192
return fetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
193+
...requestParams,
193194
headers: {
194195
...(type ? { "Content-Type": type } : {}),
195196
...(requestParams.headers || {}),
196197
},
197-
...requestParams,
198198
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,
199199
body: typeof body === "undefined" || body === null ? null : payloadFormatter(body),
200200
}).then(async (response) => {

0 commit comments

Comments
 (0)