From 91177cd536bc81856389f90109404febe664e7fd Mon Sep 17 00:00:00 2001 From: Urs Keller Date: Fri, 13 May 2016 23:04:43 +0200 Subject: [PATCH] typescript-angular2 query string fix --- .../src/main/resources/typescript-angular2/api.mustache | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 efc6e00c633..817afd33f34 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}}