Skip to content

Commit 189dec0

Browse files
authored
Release 9.1.2 (acacode#265)
* fix: typescript problem linked with --single-http-client * bump: up version to 9.1.2
1 parent 7db7785 commit 189dec0

File tree

7 files changed

+27
-7
lines changed

7 files changed

+27
-7
lines changed

CHANGELOG.md

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

3+
# 9.1.2
4+
5+
Fixes:
6+
- Bug with --single-http-client and private `http` property
7+
38
# 9.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": "9.1.1",
3+
"version": "9.1.2",
44
"description": "Generate typescript/javascript api from swagger schema",
55
"scripts": {
66
"cli:json": "node index.js -r -d -p ./swagger-test-cli.json -n swagger-test-cli.ts",

templates/default/api.eta

+5-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,11 @@ const descriptionLines = _.compact([
3939
export class Api<SecurityDataType extends unknown><% if (!config.singleHttpClient) { %> extends HttpClient<SecurityDataType> <% } %> {
4040

4141
<% if(config.singleHttpClient) { %>
42-
constructor (private http: HttpClient<SecurityDataType>) {}
42+
http: HttpClient<SecurityDataType>;
43+
44+
constructor (http: HttpClient<SecurityDataType>) {
45+
this.http = http;
46+
}
4347
<% } %>
4448

4549

templates/modular/api.eta

+5-2
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,12 @@ import { <%~ dataContracts.join(", ") %> } from "./<%~ config.fileNames.dataCont
1414
<% } %>
1515

1616
export class <%= apiClassName %><SecurityDataType = unknown><% if (!config.singleHttpClient) { %> extends HttpClient<SecurityDataType> <% } %> {
17-
1817
<% if(config.singleHttpClient) { %>
19-
constructor (private http: HttpClient<SecurityDataType>) {}
18+
http: HttpClient<SecurityDataType>;
19+
20+
constructor (http: HttpClient<SecurityDataType>) {
21+
this.http = http;
22+
}
2023
<% } %>
2124

2225
<% routes.forEach((route) => { %>

tests/spec/axiosSingleHttpClient/schema.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -1574,7 +1574,11 @@ export class HttpClient<SecurityDataType = unknown> {
15741574
* Powerful collaboration, code review, and code management for open source and private projects.
15751575
*/
15761576
export class Api<SecurityDataType extends unknown> {
1577-
constructor(private http: HttpClient<SecurityDataType>) {}
1577+
http: HttpClient<SecurityDataType>;
1578+
1579+
constructor(http: HttpClient<SecurityDataType>) {
1580+
this.http = http;
1581+
}
15781582

15791583
someTest = {
15801584
/**

tests/spec/singleHttpClient/schema.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,11 @@ export class HttpClient<SecurityDataType = unknown> {
228228
* Strong authentication, without the passwords.
229229
*/
230230
export class Api<SecurityDataType extends unknown> {
231-
constructor(private http: HttpClient<SecurityDataType>) {}
231+
http: HttpClient<SecurityDataType>;
232+
233+
constructor(http: HttpClient<SecurityDataType>) {
234+
this.http = http;
235+
}
232236

233237
key = {
234238
/**

0 commit comments

Comments
 (0)