diff --git a/modules/openapi-generator/src/main/resources/typescript/api/api.mustache b/modules/openapi-generator/src/main/resources/typescript/api/api.mustache index 0ad7fa1ca6863..0ce9c09537e19 100644 --- a/modules/openapi-generator/src/main/resources/typescript/api/api.mustache +++ b/modules/openapi-generator/src/main/resources/typescript/api/api.mustache @@ -78,9 +78,7 @@ export class {{classname}}RequestFactory extends BaseAPIRequestFactory { } {{/isArray}} {{^isArray}} - for (const key of Object.keys(serializedParams)) { - requestContext.setQueryParam(key, serializedParams[key]); - } + requestContext.setQueryParam("{{baseName}}", serializedParams); {{/isArray}} {{/isExplode}} {{^isExplode}} diff --git a/samples/openapi3/client/petstore/typescript/builds/explode-query/apis/FakeApi.ts b/samples/openapi3/client/petstore/typescript/builds/explode-query/apis/FakeApi.ts index 3658e77fcbec7..48aa0480b0c69 100644 --- a/samples/openapi3/client/petstore/typescript/builds/explode-query/apis/FakeApi.ts +++ b/samples/openapi3/client/petstore/typescript/builds/explode-query/apis/FakeApi.ts @@ -1038,9 +1038,7 @@ export class FakeApiRequestFactory extends BaseAPIRequestFactory { // Query Params if (language !== undefined) { const serializedParams = ObjectSerializer.serialize(language, "{ [key: string]: string; }", "string"); - for (const key of Object.keys(serializedParams)) { - requestContext.setQueryParam(key, serializedParams[key]); - } + requestContext.setQueryParam("language", serializedParams); } // Query Params