Skip to content

Commit 49666e8

Browse files
authored
bump: up version to 6.1.2; fix: problems with using --axios and --modular option together (acacode#187)
Fixes (critical): - Problems with using both `--axios` and `--modular` options together (TS, `organizeImports` crashed the codegeneration)
1 parent b5d3d50 commit 49666e8

File tree

10 files changed

+36
-2
lines changed

10 files changed

+36
-2
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# next release
22

3+
# 6.1.2
4+
5+
Fixes:
6+
- Problems with using both `--axios` and `--modular` options together (TS, `organizeImports` crashed the codegeneration)
7+
38
# 6.1.1
49

510
Fixes:

package-lock.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "swagger-typescript-api",
3-
"version": "6.1.1",
3+
"version": "6.1.2",
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/base/http-clients/axios-http-client.eta

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<%
22
const { apiConfig, generateResponses } = it;
33
%>
4+
45
import axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse, ResponseType } from "axios";
56

67
export type QueryParamsType = Record<string | number, any>;

templates/default/api.eta

+2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ const descriptionLines = _.compact([
1313
]);
1414

1515
%>
16+
1617
<% if (config.httpClientType === config.constants.HTTP_CLIENT.AXIOS) { %> import { AxiosRequestConfig, AxiosResponse } from "axios"; <% } %>
18+
1719
<% if (descriptionLines.length) { %>
1820
/**
1921
<% descriptionLines.forEach((descriptionLine) => { %>

templates/modular/api.eta

+2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ const apiClassName = classNameCase(route.moduleName);
55
const routes = route.routes;
66
const dataContracts = _.map(modelTypes, "name");
77
%>
8+
89
<% if (config.httpClientType === config.constants.HTTP_CLIENT.AXIOS) { %> import { AxiosRequestConfig, AxiosResponse } from "axios"; <% } %>
10+
911
import { HttpClient, RequestParams, ContentType } from "./<%~ config.fileNames.httpClient %>";
1012
<% if (dataContracts.length) { %>
1113
import { <%~ dataContracts.join(", ") %> } from "./<%~ config.fileNames.dataContracts %>"

tests/spec/axios/schema.ts

+6
Original file line numberDiff line numberDiff line change
@@ -1518,6 +1518,12 @@ export class HttpClient<SecurityDataType = unknown> {
15181518
};
15191519
}
15201520

1521+
/**
1522+
* @title GitHub
1523+
* @version v3
1524+
* @baseUrl https://api.github.com
1525+
* Powerful collaboration, code review, and code management for open source and private projects.
1526+
*/
15211527
export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDataType> {
15221528
someTest = {
15231529
/**

tests/spec/axiosSingleHttpClient/schema.ts

+6
Original file line numberDiff line numberDiff line change
@@ -1518,6 +1518,12 @@ export class HttpClient<SecurityDataType = unknown> {
15181518
};
15191519
}
15201520

1521+
/**
1522+
* @title GitHub
1523+
* @version v3
1524+
* @baseUrl https://api.github.com
1525+
* Powerful collaboration, code review, and code management for open source and private projects.
1526+
*/
15211527
export class Api<SecurityDataType extends unknown> {
15221528
constructor(private http: HttpClient<SecurityDataType>) {}
15231529

tests/spec/jsAxios/schema.d.ts

+6
Original file line numberDiff line numberDiff line change
@@ -1738,6 +1738,12 @@ export declare class HttpClient<SecurityDataType = unknown> {
17381738
...params
17391739
}: FullRequestParams) => Promise<any>;
17401740
}
1741+
/**
1742+
* @title GitHub
1743+
* @version v3
1744+
* @baseUrl https://api.github.com
1745+
* Powerful collaboration, code review, and code management for open source and private projects.
1746+
*/
17411747
export declare class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDataType> {
17421748
emojis: {
17431749
/**

tests/spec/jsAxios/schema.js

+6
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,12 @@ export class HttpClient {
5151
};
5252
}
5353
}
54+
/**
55+
* @title GitHub
56+
* @version v3
57+
* @baseUrl https://api.github.com
58+
* Powerful collaboration, code review, and code management for open source and private projects.
59+
*/
5460
export class Api extends HttpClient {
5561
constructor() {
5662
super(...arguments);

0 commit comments

Comments
 (0)