diff --git a/modules/swagger-codegen/src/main/resources/typescript-angular2/api.mustache b/modules/swagger-codegen/src/main/resources/typescript-angular2/api.mustache index efc6e00c6333..817afd33f345 100644 --- a/modules/swagger-codegen/src/main/resources/typescript-angular2/api.mustache +++ b/modules/swagger-codegen/src/main/resources/typescript-angular2/api.mustache @@ -35,7 +35,7 @@ export class {{classname}} { const path = this.basePath + '{{path}}'{{#pathParams}} .replace('{' + '{{baseName}}' + '}', String({{paramName}})){{/pathParams}}; - let queryParameters: any = ""; // This should probably be an object in the future + let queryParameters = new URLSearchParams(); let headerParams = this.defaultHeaders; {{#hasFormParams}} let formParams = new URLSearchParams(); @@ -51,7 +51,7 @@ export class {{classname}} { {{/allParams}} {{#queryParams}} if ({{paramName}} !== undefined) { - queryParameters['{{baseName}}'] = {{paramName}}; + queryParameters.set('{{baseName}}', {{paramName}}); } {{/queryParams}}