diff --git a/.changeset/fix-operationid-starting-with-number.md b/.changeset/fix-operationid-starting-with-number.md deleted file mode 100644 index c5449fa6..00000000 --- a/.changeset/fix-operationid-starting-with-number.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -"swagger-typescript-api": patch ---- - -Fix TypeScript generation failure for operationIds starting with numbers - -**What:** Fixed an issue where operationIds starting with numbers (e.g., "123getUser") would cause TypeScript generation to fail due to invalid identifier names. - -**Why:** OperationIds that start with numbers are not valid JavaScript identifiers, causing syntax errors in the generated TypeScript code. - -**How:** Modified the template logic to quote property names for invalid identifiers. OperationIds starting with numbers are now generated as quoted properties (e.g., `"123GetUser": ...`) instead of unquoted invalid identifiers. - -This resolves GitHub issue #952. diff --git a/CHANGELOG.md b/CHANGELOG.md index 2b3690f7..62c23ab9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ # swagger-typescript-api +## 13.2.8 + +### Patch Changes + +- [#1326](https://github.com/acacode/swagger-typescript-api/pull/1326) [`99b5f50`](https://github.com/acacode/swagger-typescript-api/commit/99b5f5055bfdf207d9dfe316ef8ff2490d474443) Thanks [@thejhh](https://github.com/thejhh)! - Fix TypeScript generation failure for operationIds starting with numbers + + **What:** Fixed an issue where operationIds starting with numbers (e.g., "123getUser") would cause TypeScript generation to fail due to invalid identifier names. + + **Why:** OperationIds that start with numbers are not valid JavaScript identifiers, causing syntax errors in the generated TypeScript code. + + **How:** Modified the template logic to quote property names for invalid identifiers. OperationIds starting with numbers are now generated as quoted properties (e.g., `"123GetUser": ...`) instead of unquoted invalid identifiers. + + This resolves GitHub issue #952. + ## 13.2.7 ### Patch Changes diff --git a/package.json b/package.json index 1abf8187..40793d56 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "swagger-typescript-api", - "version": "13.2.7", + "version": "13.2.8", "description": "Generate the API client for Fetch or Axios from an OpenAPI Specification", "homepage": "https://github.com/acacode/swagger-typescript-api", "bugs": "https://github.com/acacode/swagger-typescript-api/issues",