Skip to content

Commit 0a81ae6

Browse files
committed
Merge remote-tracking branch 'origin/main' into feature_refs_in_paths
2 parents 90e0267 + e027a45 commit 0a81ae6

File tree

7 files changed

+1825
-86
lines changed

7 files changed

+1825
-86
lines changed

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
# swagger-typescript-api
22

3+
## 13.2.14
4+
5+
### Patch Changes
6+
7+
- [#1398](https://github.com/acacode/swagger-typescript-api/pull/1398) [`d987aee`](https://github.com/acacode/swagger-typescript-api/commit/d987aee6a2f7dbf6edba73b58a2df2fceb32a876) Thanks [@k1rd3rf](https://github.com/k1rd3rf)! - Fix modular template to always generate class property syntax.
8+
9+
The modular template was incorrectly using object method syntax (`:` and
10+
`,`) when route.namespace was present, introduced by PR #1326. This
11+
caused TypeScript syntax errors in generated code.
12+
13+
The modular template should always generate class properties with arrow
14+
functions (`=` and `;`), regardless of namespace presence.
15+
16+
This resolves the issue reported in #1366 where version 13.2.8 generated
17+
invalid TypeScript code with modular templates.
18+
319
## 13.2.13
420

521
### Patch Changes

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "swagger-typescript-api",
3-
"version": "13.2.13",
3+
"version": "13.2.14",
44
"description": "Generate the API client for Fetch or Axios from an OpenAPI Specification",
55
"homepage": "https://github.com/acacode/swagger-typescript-api",
66
"bugs": "https://github.com/acacode/swagger-typescript-api/issues",
@@ -48,32 +48,32 @@
4848
"dependencies": {
4949
"@apidevtools/swagger-parser": "12.0.0",
5050
"@biomejs/js-api": "3.0.0",
51-
"@biomejs/wasm-nodejs": "2.2.4",
51+
"@biomejs/wasm-nodejs": "2.2.5",
5252
"@types/lodash": "^4.17.20",
5353
"@types/swagger-schema-official": "^2.0.25",
5454
"c12": "^3.3.0",
5555
"citty": "^0.1.6",
5656
"consola": "^3.4.2",
5757
"eta": "^4.0.1",
5858
"lodash": "^4.17.21",
59-
"nanoid": "^5.1.5",
59+
"nanoid": "^5.1.6",
6060
"openapi-types": "^12.1.3",
6161
"swagger-schema-official": "2.0.0-bab6bed",
6262
"swagger2openapi": "^7.0.8",
63-
"typescript": "~5.9.2",
63+
"typescript": "~5.9.3",
6464
"yaml": "^2.8.1",
6565
"yummies": "5.7.0"
6666
},
6767
"devDependencies": {
68-
"@biomejs/biome": "2.2.4",
68+
"@biomejs/biome": "2.2.5",
6969
"@changesets/changelog-github": "0.5.1",
7070
"@changesets/cli": "2.29.7",
7171
"@tsconfig/node20": "20.1.6",
7272
"@tsconfig/strictest": "2.0.6",
73-
"@types/node": "24.5.2",
73+
"@types/node": "24.6.2",
7474
"@types/swagger2openapi": "7.0.4",
7575
"axios": "1.12.2",
76-
"tsdown": "0.15.4",
76+
"tsdown": "0.15.6",
7777
"typedoc": "0.28.13",
7878
"vitest": "3.2.4"
7979
},

templates/modular/procedure-call.ejs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ const isValidIdentifier = (name) => /^[A-Za-z_$][A-Za-z0-9_$]*$/.test(name);
9090
<%~ routeDocs.lines %>
9191

9292
*/
93-
<% if (isValidIdentifier(route.routeName.usage)) { %><%~ route.routeName.usage %><%~ route.namespace ? ': ' : ' = ' %><% } else { %>"<%~ route.routeName.usage %>"<%~ route.namespace ? ': ' : ' = ' %><% } %>(<%~ wrapperArgs %>)<%~ config.toJS ? `: ${describeReturnType()}` : "" %> =>
93+
<% if (isValidIdentifier(route.routeName.usage)) { %><%~ route.routeName.usage %><% } else { %>"<%~ route.routeName.usage %>"<% } %> = (<%~ wrapperArgs %>)<%~ config.toJS ? `: ${describeReturnType()}` : "" %> =>
9494
<%~ config.singleHttpClient ? 'this.http.request' : 'this.request' %><<%~ type %>, <%~ errorType %>>({
9595
path: `<%~ path %>`,
9696
method: '<%~ _.upperCase(method) %>',
@@ -100,4 +100,4 @@ const isValidIdentifier = (name) => /^[A-Za-z_$][A-Za-z0-9_$]*$/.test(name);
100100
<%~ bodyContentKindTmpl ? `type: ${bodyContentKindTmpl},` : '' %>
101101
<%~ responseFormatTmpl ? `format: ${responseFormatTmpl},` : '' %>
102102
...<%~ _.get(requestConfigParam, "name") %>,
103-
})<%~ route.namespace ? ',' : '' %>
103+
})

0 commit comments

Comments
 (0)