Skip to content

Commit

Permalink
Release 8.0.2 (#225)
Browse files Browse the repository at this point in the history
* bump: up version to 8.0.2; fix: `format` option in `fetch` http client
  • Loading branch information
js2me authored Apr 5, 2021
1 parent b226db3 commit 31e63c2
Show file tree
Hide file tree
Showing 61 changed files with 65 additions and 60 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# next release

# 8.0.2

Fixes:
- Wrong working the `format` option in `fetch` http client

# 8.0.1

Fixes:
Expand Down
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": "8.0.1",
"version": "8.0.2",
"description": "Generate typescript/javascript api from swagger schema",
"scripts": {
"cli:json": "node index.js -r -d -p ./swagger-test-cli.json -n swagger-test-cli.ts",
Expand Down
2 changes: 1 addition & 1 deletion templates/base/http-clients/fetch-http-client.eta
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ export class HttpClient<SecurityDataType = unknown> {
const requestParams = this.mergeRequestParams(params, secureParams);
const queryString = query && this.toQueryString(query);
const payloadFormatter = this.contentFormatters[type || ContentType.Json];
const responseFormat = format && requestParams.format;
const responseFormat = format || requestParams.format;

return this.customFetch(
`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`,
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 @@ -321,7 +321,7 @@ export class HttpClient<SecurityDataType = unknown> {
const requestParams = this.mergeRequestParams(params, secureParams);
const queryString = query && this.toQueryString(query);
const payloadFormatter = this.contentFormatters[type || ContentType.Json];
const responseFormat = format && requestParams.format;
const responseFormat = format || requestParams.format;

return this.customFetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
...requestParams,
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 @@ -297,7 +297,7 @@ export class HttpClient<SecurityDataType = unknown> {
const requestParams = this.mergeRequestParams(params, secureParams);
const queryString = query && this.toQueryString(query);
const payloadFormatter = this.contentFormatters[type || ContentType.Json];
const responseFormat = format && requestParams.format;
const responseFormat = format || requestParams.format;

return this.customFetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
...requestParams,
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 @@ -189,7 +189,7 @@ export class HttpClient<SecurityDataType = unknown> {
const requestParams = this.mergeRequestParams(params, secureParams);
const queryString = query && this.toQueryString(query);
const payloadFormatter = this.contentFormatters[type || ContentType.Json];
const responseFormat = format && requestParams.format;
const responseFormat = format || requestParams.format;

return this.customFetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
...requestParams,
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 @@ -166,7 +166,7 @@ export class HttpClient<SecurityDataType = unknown> {
const requestParams = this.mergeRequestParams(params, secureParams);
const queryString = query && this.toQueryString(query);
const payloadFormatter = this.contentFormatters[type || ContentType.Json];
const responseFormat = format && requestParams.format;
const responseFormat = format || requestParams.format;

return this.customFetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
...requestParams,
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 @@ -218,7 +218,7 @@ export class HttpClient<SecurityDataType = unknown> {
const requestParams = this.mergeRequestParams(params, secureParams);
const queryString = query && this.toQueryString(query);
const payloadFormatter = this.contentFormatters[type || ContentType.Json];
const responseFormat = format && requestParams.format;
const responseFormat = format || requestParams.format;

return this.customFetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
...requestParams,
Expand Down
2 changes: 1 addition & 1 deletion tests/generated/v2.0/enums.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ export class HttpClient<SecurityDataType = unknown> {
const requestParams = this.mergeRequestParams(params, secureParams);
const queryString = query && this.toQueryString(query);
const payloadFormatter = this.contentFormatters[type || ContentType.Json];
const responseFormat = format && requestParams.format;
const responseFormat = format || requestParams.format;

return this.customFetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
...requestParams,
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 @@ -193,7 +193,7 @@ export class HttpClient<SecurityDataType = unknown> {
const requestParams = this.mergeRequestParams(params, secureParams);
const queryString = query && this.toQueryString(query);
const payloadFormatter = this.contentFormatters[type || ContentType.Json];
const responseFormat = format && requestParams.format;
const responseFormat = format || requestParams.format;

return this.customFetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
...requestParams,
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 @@ -166,7 +166,7 @@ export class HttpClient<SecurityDataType = unknown> {
const requestParams = this.mergeRequestParams(params, secureParams);
const queryString = query && this.toQueryString(query);
const payloadFormatter = this.contentFormatters[type || ContentType.Json];
const responseFormat = format && requestParams.format;
const responseFormat = format || requestParams.format;

return this.customFetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
...requestParams,
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 @@ -229,7 +229,7 @@ export class HttpClient<SecurityDataType = unknown> {
const requestParams = this.mergeRequestParams(params, secureParams);
const queryString = query && this.toQueryString(query);
const payloadFormatter = this.contentFormatters[type || ContentType.Json];
const responseFormat = format && requestParams.format;
const responseFormat = format || requestParams.format;

return this.customFetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
...requestParams,
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 @@ -448,7 +448,7 @@ export class HttpClient<SecurityDataType = unknown> {
const requestParams = this.mergeRequestParams(params, secureParams);
const queryString = query && this.toQueryString(query);
const payloadFormatter = this.contentFormatters[type || ContentType.Json];
const responseFormat = format && requestParams.format;
const responseFormat = format || requestParams.format;

return this.customFetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
...requestParams,
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 @@ -1601,7 +1601,7 @@ export class HttpClient<SecurityDataType = unknown> {
const requestParams = this.mergeRequestParams(params, secureParams);
const queryString = query && this.toQueryString(query);
const payloadFormatter = this.contentFormatters[type || ContentType.Json];
const responseFormat = format && requestParams.format;
const responseFormat = format || requestParams.format;

return this.customFetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
...requestParams,
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 @@ -166,7 +166,7 @@ export class HttpClient<SecurityDataType = unknown> {
const requestParams = this.mergeRequestParams(params, secureParams);
const queryString = query && this.toQueryString(query);
const payloadFormatter = this.contentFormatters[type || ContentType.Json];
const responseFormat = format && requestParams.format;
const responseFormat = format || requestParams.format;

return this.customFetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
...requestParams,
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 @@ -203,7 +203,7 @@ export class HttpClient<SecurityDataType = unknown> {
const requestParams = this.mergeRequestParams(params, secureParams);
const queryString = query && this.toQueryString(query);
const payloadFormatter = this.contentFormatters[type || ContentType.Json];
const responseFormat = format && requestParams.format;
const responseFormat = format || requestParams.format;

return this.customFetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
...requestParams,
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 @@ -174,7 +174,7 @@ export class HttpClient<SecurityDataType = unknown> {
const requestParams = this.mergeRequestParams(params, secureParams);
const queryString = query && this.toQueryString(query);
const payloadFormatter = this.contentFormatters[type || ContentType.Json];
const responseFormat = format && requestParams.format;
const responseFormat = format || requestParams.format;

return this.customFetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
...requestParams,
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 @@ -189,7 +189,7 @@ export class HttpClient<SecurityDataType = unknown> {
const requestParams = this.mergeRequestParams(params, secureParams);
const queryString = query && this.toQueryString(query);
const payloadFormatter = this.contentFormatters[type || ContentType.Json];
const responseFormat = format && requestParams.format;
const responseFormat = format || requestParams.format;

return this.customFetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
...requestParams,
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 @@ -234,7 +234,7 @@ export class HttpClient<SecurityDataType = unknown> {
const requestParams = this.mergeRequestParams(params, secureParams);
const queryString = query && this.toQueryString(query);
const payloadFormatter = this.contentFormatters[type || ContentType.Json];
const responseFormat = format && requestParams.format;
const responseFormat = format || requestParams.format;

return this.customFetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
...requestParams,
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 @@ -179,7 +179,7 @@ export class HttpClient<SecurityDataType = unknown> {
const requestParams = this.mergeRequestParams(params, secureParams);
const queryString = query && this.toQueryString(query);
const payloadFormatter = this.contentFormatters[type || ContentType.Json];
const responseFormat = format && requestParams.format;
const responseFormat = format || requestParams.format;

return this.customFetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
...requestParams,
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 @@ -181,7 +181,7 @@ export class HttpClient<SecurityDataType = unknown> {
const requestParams = this.mergeRequestParams(params, secureParams);
const queryString = query && this.toQueryString(query);
const payloadFormatter = this.contentFormatters[type || ContentType.Json];
const responseFormat = format && requestParams.format;
const responseFormat = format || requestParams.format;

return this.customFetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
...requestParams,
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 @@ -166,7 +166,7 @@ export class HttpClient<SecurityDataType = unknown> {
const requestParams = this.mergeRequestParams(params, secureParams);
const queryString = query && this.toQueryString(query);
const payloadFormatter = this.contentFormatters[type || ContentType.Json];
const responseFormat = format && requestParams.format;
const responseFormat = format || requestParams.format;

return this.customFetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
...requestParams,
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 @@ -261,7 +261,7 @@ export class HttpClient<SecurityDataType = unknown> {
const requestParams = this.mergeRequestParams(params, secureParams);
const queryString = query && this.toQueryString(query);
const payloadFormatter = this.contentFormatters[type || ContentType.Json];
const responseFormat = format && requestParams.format;
const responseFormat = format || requestParams.format;

return this.customFetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
...requestParams,
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 @@ -173,7 +173,7 @@ export class HttpClient<SecurityDataType = unknown> {
const requestParams = this.mergeRequestParams(params, secureParams);
const queryString = query && this.toQueryString(query);
const payloadFormatter = this.contentFormatters[type || ContentType.Json];
const responseFormat = format && requestParams.format;
const responseFormat = format || requestParams.format;

return this.customFetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
...requestParams,
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 @@ -170,7 +170,7 @@ export class HttpClient<SecurityDataType = unknown> {
const requestParams = this.mergeRequestParams(params, secureParams);
const queryString = query && this.toQueryString(query);
const payloadFormatter = this.contentFormatters[type || ContentType.Json];
const responseFormat = format && requestParams.format;
const responseFormat = format || requestParams.format;

return this.customFetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
...requestParams,
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 @@ -174,7 +174,7 @@ export class HttpClient<SecurityDataType = unknown> {
const requestParams = this.mergeRequestParams(params, secureParams);
const queryString = query && this.toQueryString(query);
const payloadFormatter = this.contentFormatters[type || ContentType.Json];
const responseFormat = format && requestParams.format;
const responseFormat = format || requestParams.format;

return this.customFetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
...requestParams,
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 @@ -176,7 +176,7 @@ export class HttpClient<SecurityDataType = unknown> {
const requestParams = this.mergeRequestParams(params, secureParams);
const queryString = query && this.toQueryString(query);
const payloadFormatter = this.contentFormatters[type || ContentType.Json];
const responseFormat = format && requestParams.format;
const responseFormat = format || requestParams.format;

return this.customFetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
...requestParams,
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 @@ -166,7 +166,7 @@ export class HttpClient<SecurityDataType = unknown> {
const requestParams = this.mergeRequestParams(params, secureParams);
const queryString = query && this.toQueryString(query);
const payloadFormatter = this.contentFormatters[type || ContentType.Json];
const responseFormat = format && requestParams.format;
const responseFormat = format || requestParams.format;

return this.customFetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
...requestParams,
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 @@ -166,7 +166,7 @@ export class HttpClient<SecurityDataType = unknown> {
const requestParams = this.mergeRequestParams(params, secureParams);
const queryString = query && this.toQueryString(query);
const payloadFormatter = this.contentFormatters[type || ContentType.Json];
const responseFormat = format && requestParams.format;
const responseFormat = format || requestParams.format;

return this.customFetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
...requestParams,
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 @@ -166,7 +166,7 @@ export class HttpClient<SecurityDataType = unknown> {
const requestParams = this.mergeRequestParams(params, secureParams);
const queryString = query && this.toQueryString(query);
const payloadFormatter = this.contentFormatters[type || ContentType.Json];
const responseFormat = format && requestParams.format;
const responseFormat = format || requestParams.format;

return this.customFetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
...requestParams,
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 @@ -186,7 +186,7 @@ export class HttpClient<SecurityDataType = unknown> {
const requestParams = this.mergeRequestParams(params, secureParams);
const queryString = query && this.toQueryString(query);
const payloadFormatter = this.contentFormatters[type || ContentType.Json];
const responseFormat = format && requestParams.format;
const responseFormat = format || requestParams.format;

return this.customFetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
...requestParams,
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 @@ -9110,7 +9110,7 @@ export class HttpClient<SecurityDataType = unknown> {
const requestParams = this.mergeRequestParams(params, secureParams);
const queryString = query && this.toQueryString(query);
const payloadFormatter = this.contentFormatters[type || ContentType.Json];
const responseFormat = format && requestParams.format;
const responseFormat = format || requestParams.format;

return this.customFetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
...requestParams,
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 @@ -183,7 +183,7 @@ export class HttpClient<SecurityDataType = unknown> {
const requestParams = this.mergeRequestParams(params, secureParams);
const queryString = query && this.toQueryString(query);
const payloadFormatter = this.contentFormatters[type || ContentType.Json];
const responseFormat = format && requestParams.format;
const responseFormat = format || requestParams.format;

return this.customFetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
...requestParams,
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 @@ -179,7 +179,7 @@ export class HttpClient<SecurityDataType = unknown> {
const requestParams = this.mergeRequestParams(params, secureParams);
const queryString = query && this.toQueryString(query);
const payloadFormatter = this.contentFormatters[type || ContentType.Json];
const responseFormat = format && requestParams.format;
const responseFormat = format || requestParams.format;

return this.customFetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
...requestParams,
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 @@ -180,7 +180,7 @@ export class HttpClient<SecurityDataType = unknown> {
const requestParams = this.mergeRequestParams(params, secureParams);
const queryString = query && this.toQueryString(query);
const payloadFormatter = this.contentFormatters[type || ContentType.Json];
const responseFormat = format && requestParams.format;
const responseFormat = format || requestParams.format;

return this.customFetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
...requestParams,
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 @@ -176,7 +176,7 @@ export class HttpClient<SecurityDataType = unknown> {
const requestParams = this.mergeRequestParams(params, secureParams);
const queryString = query && this.toQueryString(query);
const payloadFormatter = this.contentFormatters[type || ContentType.Json];
const responseFormat = format && requestParams.format;
const responseFormat = format || requestParams.format;

return this.customFetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
...requestParams,
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 @@ -367,7 +367,7 @@ export class HttpClient<SecurityDataType = unknown> {
const requestParams = this.mergeRequestParams(params, secureParams);
const queryString = query && this.toQueryString(query);
const payloadFormatter = this.contentFormatters[type || ContentType.Json];
const responseFormat = format && requestParams.format;
const responseFormat = format || requestParams.format;

return this.customFetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
...requestParams,
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 @@ -179,7 +179,7 @@ export class HttpClient<SecurityDataType = unknown> {
const requestParams = this.mergeRequestParams(params, secureParams);
const queryString = query && this.toQueryString(query);
const payloadFormatter = this.contentFormatters[type || ContentType.Json];
const responseFormat = format && requestParams.format;
const responseFormat = format || requestParams.format;

return this.customFetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
...requestParams,
Expand Down
Loading

0 comments on commit 31e63c2

Please sign in to comment.