Skip to content

Commit 6a186b3

Browse files
Version Packages
1 parent c31c5fa commit 6a186b3

4 files changed

Lines changed: 29 additions & 29 deletions

File tree

.changeset/extract-request-params-schema-collision.md

Lines changed: 0 additions & 14 deletions
This file was deleted.

.changeset/import-file-extension-and-type-only-imports.md

Lines changed: 0 additions & 14 deletions
This file was deleted.

CHANGELOG.md

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

3+
## 13.13.0
4+
5+
### Minor Changes
6+
7+
- [#1830](https://github.com/acacode/swagger-typescript-api/pull/1830) [`e7b418d`](https://github.com/acacode/swagger-typescript-api/commit/e7b418dae818d02ae22cb64085ab12530b2f233d) Thanks [@Upgrade220](https://github.com/Upgrade220)! - Add `importFileExtension` and `typeOnlyImports` options
8+
9+
`importFileExtension` (`""` | `".js"` | `".ts"`) appends a file extension to
10+
generated relative imports, for projects using `moduleResolution: node16`/`nodenext`
11+
(`.js`) or `allowImportingTsExtensions` (`.ts`).
12+
13+
`typeOnlyImports` emits `import type` for type-only imports (and inline `type` on
14+
mixed imports such as the http-client import, where `HttpClient` stays a value
15+
import) for projects using `verbatimModuleSyntax` / `isolatedModules`. `ContentType`
16+
is only marked `type` for `enumStyle: "union"`, where it is a pure type.
17+
18+
### Patch Changes
19+
20+
- [#1835](https://github.com/acacode/swagger-typescript-api/pull/1835) [`18023ad`](https://github.com/acacode/swagger-typescript-api/commit/18023adb7570114708c80eea01b7c8a843a064a7) Thanks [@ryanb93](https://github.com/ryanb93)! - Fix `extractRequestParams` overwriting a component schema whose name matches `<operationId>Params`.
21+
22+
Since path-only routes started producing an extracted params type (13.2.9), a spec with an operation
23+
`getOrder` and a component schema `GetOrderParams` (for example the operation's request body) would have
24+
the model silently replaced by the route's path/query params, so the generated method typed its `data`
25+
argument as the path params instead of the body.
26+
27+
`createRequestParamsSchema` now goes through the same schema-key collision guard already used by
28+
`extractResponseBody` and `extractResponseError`, so the existing model keeps its name and the route
29+
params fall back to the next free name (`GetOrderParams1`).
30+
331
## 13.12.6
432

533
### Patch Changes

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": "13.12.6",
3+
"version": "13.13.0",
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",

0 commit comments

Comments
 (0)