From 5a0208778509d4d0ba66c7cedc1841c3ee0c8a2a Mon Sep 17 00:00:00 2001 From: Ante Grbesic Date: Fri, 24 Jul 2026 11:16:34 +0200 Subject: [PATCH 1/2] fix(typescript-fetch): alias url import to avoid shadowing by url-named params A parameter literally named `url` (e.g. a webhook/callback query param) previously shadowed the module-level `import * as url from "url"` within the generated method, breaking url.parse/url.format and failing to compile under tsc. Aliasing the import to `nodeUrl` removes the collision without changing any generated public API (param names, FetchArgs.url, etc. are unaffected). Fixes #12755 --- .../src/main/resources/typescript-fetch/api.mustache | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/typescript-fetch/api.mustache b/modules/swagger-codegen/src/main/resources/typescript-fetch/api.mustache index f9452e034aa..c2eb8a70bdd 100644 --- a/modules/swagger-codegen/src/main/resources/typescript-fetch/api.mustache +++ b/modules/swagger-codegen/src/main/resources/typescript-fetch/api.mustache @@ -2,7 +2,7 @@ // tslint:disable {{>licenseInfo}} -import * as url from "url"; +import * as nodeUrl from "url"; import * as portableFetch from "portable-fetch"; import { Configuration } from "./configuration"; @@ -101,7 +101,7 @@ export const {{classname}}FetchParamCreator = function (configuration?: Configur {{/allParams}} const localVarPath = `{{{path}}}`{{#pathParams}} .replace(`{${"{{baseName}}"}}`, encodeURIComponent(String({{paramName}}))){{/pathParams}}; - const localVarUrlObj = url.parse(localVarPath, true); + const localVarUrlObj = nodeUrl.parse(localVarPath, true); const localVarRequestOptions = Object.assign({ method: '{{httpMethod}}' }, options); const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; @@ -235,7 +235,7 @@ export const {{classname}}FetchParamCreator = function (configuration?: Configur {{/bodyParam}} return { - url: url.format(localVarUrlObj), + url: nodeUrl.format(localVarUrlObj), options: localVarRequestOptions, }; }, From f1c6eff878adfbf5702bd339b9d67871ddf1f8e9 Mon Sep 17 00:00:00 2001 From: Ante Grbesic Date: Fri, 24 Jul 2026 11:25:57 +0200 Subject: [PATCH 2/2] Alias url import as _nodeUrl to avoid shadowing --- .../src/main/resources/typescript-fetch/api.mustache | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/typescript-fetch/api.mustache b/modules/swagger-codegen/src/main/resources/typescript-fetch/api.mustache index c2eb8a70bdd..852b011684b 100644 --- a/modules/swagger-codegen/src/main/resources/typescript-fetch/api.mustache +++ b/modules/swagger-codegen/src/main/resources/typescript-fetch/api.mustache @@ -2,7 +2,7 @@ // tslint:disable {{>licenseInfo}} -import * as nodeUrl from "url"; +import * as _nodeUrl from "url"; import * as portableFetch from "portable-fetch"; import { Configuration } from "./configuration"; @@ -101,7 +101,7 @@ export const {{classname}}FetchParamCreator = function (configuration?: Configur {{/allParams}} const localVarPath = `{{{path}}}`{{#pathParams}} .replace(`{${"{{baseName}}"}}`, encodeURIComponent(String({{paramName}}))){{/pathParams}}; - const localVarUrlObj = nodeUrl.parse(localVarPath, true); + const localVarUrlObj = _nodeUrl.parse(localVarPath, true); const localVarRequestOptions = Object.assign({ method: '{{httpMethod}}' }, options); const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; @@ -235,7 +235,7 @@ export const {{classname}}FetchParamCreator = function (configuration?: Configur {{/bodyParam}} return { - url: nodeUrl.format(localVarUrlObj), + url: _nodeUrl.format(localVarUrlObj), options: localVarRequestOptions, }; },