From 4a89d236192631ee29b1ba871805335910e19b8b Mon Sep 17 00:00:00 2001 From: Esteban Marin Date: Sat, 23 Sep 2017 11:23:45 +0200 Subject: [PATCH] [typescript-angular] apply encodeURIComponent to path-parameter (#6525) * #6524: [typescript-angular] apply encodeURIComponent to path-parameter * #6524: [typescript-angular2] update samples * #6524: [typescript-angularjs] update samples --- .../resources/typescript-angular/api.service.mustache | 2 +- .../src/main/resources/typescript-angularjs/api.mustache | 2 +- .../typescript-angular-v2/default/api/pet.service.ts | 8 ++++---- .../typescript-angular-v2/default/api/store.service.ts | 4 ++-- .../typescript-angular-v2/default/api/user.service.ts | 6 +++--- .../petstore/typescript-angular-v2/npm/api/pet.service.ts | 8 ++++---- .../typescript-angular-v2/npm/api/store.service.ts | 4 ++-- .../typescript-angular-v2/npm/api/user.service.ts | 6 +++--- .../with-interfaces/api/pet.service.ts | 8 ++++---- .../with-interfaces/api/store.service.ts | 4 ++-- .../with-interfaces/api/user.service.ts | 6 +++--- .../client/petstore/typescript-angularjs/api/PetApi.ts | 8 ++++---- .../client/petstore/typescript-angularjs/api/StoreApi.ts | 4 ++-- .../client/petstore/typescript-angularjs/api/UserApi.ts | 6 +++--- 14 files changed, 38 insertions(+), 38 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/typescript-angular/api.service.mustache b/modules/swagger-codegen/src/main/resources/typescript-angular/api.service.mustache index 3c59792963a..376a6d6602f 100644 --- a/modules/swagger-codegen/src/main/resources/typescript-angular/api.service.mustache +++ b/modules/swagger-codegen/src/main/resources/typescript-angular/api.service.mustache @@ -122,7 +122,7 @@ export class {{classname}} { {{/allParams}}*/ public {{nickname}}WithHttpInfo({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}extraHttpRequestParams?: any): Observable { const path = this.basePath + '{{{path}}}'{{#pathParams}} - .replace('${' + '{{baseName}}' + '}', String({{paramName}})){{/pathParams}}; + .replace('${' + '{{baseName}}' + '}', encodeURIComponent(String({{paramName}}))){{/pathParams}}; let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 diff --git a/modules/swagger-codegen/src/main/resources/typescript-angularjs/api.mustache b/modules/swagger-codegen/src/main/resources/typescript-angularjs/api.mustache index 3027c399afb..b6aa0b6ae96 100644 --- a/modules/swagger-codegen/src/main/resources/typescript-angularjs/api.mustache +++ b/modules/swagger-codegen/src/main/resources/typescript-angularjs/api.mustache @@ -33,7 +33,7 @@ export class {{classname}} { {{/allParams}}*/ public {{nickname}} ({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}extraHttpRequestParams?: any ) : ng.IHttpPromise<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}{}{{/returnType}}> { const localVarPath = this.basePath + '{{{path}}}'{{#pathParams}} - .replace('{' + '{{baseName}}' + '}', String({{paramName}})){{/pathParams}}; + .replace('{' + '{{baseName}}' + '}', encodeURIComponent(String({{paramName}}))){{/pathParams}}; let queryParameters: any = {}; let headerParams: any = (Object).assign({}, this.defaultHeaders); diff --git a/samples/client/petstore/typescript-angular-v2/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v2/default/api/pet.service.ts index 25b50dd7546..b1bf4505cc5 100644 --- a/samples/client/petstore/typescript-angular-v2/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v2/default/api/pet.service.ts @@ -274,7 +274,7 @@ export class PetService { */ public deletePetWithHttpInfo(petId: number, apiKey?: string, extraHttpRequestParams?: any): Observable { const path = this.basePath + '/pet/${petId}' - .replace('${' + 'petId' + '}', String(petId)); + .replace('${' + 'petId' + '}', encodeURIComponent(String(petId))); let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -437,7 +437,7 @@ export class PetService { */ public getPetByIdWithHttpInfo(petId: number, extraHttpRequestParams?: any): Observable { const path = this.basePath + '/pet/${petId}' - .replace('${' + 'petId' + '}', String(petId)); + .replace('${' + 'petId' + '}', encodeURIComponent(String(petId))); let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -539,7 +539,7 @@ export class PetService { */ public updatePetWithFormWithHttpInfo(petId: number, name?: string, status?: string, extraHttpRequestParams?: any): Observable { const path = this.basePath + '/pet/${petId}' - .replace('${' + 'petId' + '}', String(petId)); + .replace('${' + 'petId' + '}', encodeURIComponent(String(petId))); let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -615,7 +615,7 @@ export class PetService { */ public uploadFileWithHttpInfo(petId: number, additionalMetadata?: string, file?: Blob, extraHttpRequestParams?: any): Observable { const path = this.basePath + '/pet/${petId}/uploadImage' - .replace('${' + 'petId' + '}', String(petId)); + .replace('${' + 'petId' + '}', encodeURIComponent(String(petId))); let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 diff --git a/samples/client/petstore/typescript-angular-v2/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v2/default/api/store.service.ts index 1dd4980e43b..3610483fd6b 100644 --- a/samples/client/petstore/typescript-angular-v2/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v2/default/api/store.service.ts @@ -149,7 +149,7 @@ export class StoreService { */ public deleteOrderWithHttpInfo(orderId: string, extraHttpRequestParams?: any): Observable { const path = this.basePath + '/store/order/${orderId}' - .replace('${' + 'orderId' + '}', String(orderId)); + .replace('${' + 'orderId' + '}', encodeURIComponent(String(orderId))); let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -231,7 +231,7 @@ export class StoreService { */ public getOrderByIdWithHttpInfo(orderId: number, extraHttpRequestParams?: any): Observable { const path = this.basePath + '/store/order/${orderId}' - .replace('${' + 'orderId' + '}', String(orderId)); + .replace('${' + 'orderId' + '}', encodeURIComponent(String(orderId))); let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 diff --git a/samples/client/petstore/typescript-angular-v2/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v2/default/api/user.service.ts index 4f24303f502..d608c6a4c27 100644 --- a/samples/client/petstore/typescript-angular-v2/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v2/default/api/user.service.ts @@ -347,7 +347,7 @@ export class UserService { */ public deleteUserWithHttpInfo(username: string, extraHttpRequestParams?: any): Observable { const path = this.basePath + '/user/${username}' - .replace('${' + 'username' + '}', String(username)); + .replace('${' + 'username' + '}', encodeURIComponent(String(username))); let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -389,7 +389,7 @@ export class UserService { */ public getUserByNameWithHttpInfo(username: string, extraHttpRequestParams?: any): Observable { const path = this.basePath + '/user/${username}' - .replace('${' + 'username' + '}', String(username)); + .replace('${' + 'username' + '}', encodeURIComponent(String(username))); let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -522,7 +522,7 @@ export class UserService { */ public updateUserWithHttpInfo(username: string, body: User, extraHttpRequestParams?: any): Observable { const path = this.basePath + '/user/${username}' - .replace('${' + 'username' + '}', String(username)); + .replace('${' + 'username' + '}', encodeURIComponent(String(username))); let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 diff --git a/samples/client/petstore/typescript-angular-v2/npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v2/npm/api/pet.service.ts index 25b50dd7546..b1bf4505cc5 100644 --- a/samples/client/petstore/typescript-angular-v2/npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v2/npm/api/pet.service.ts @@ -274,7 +274,7 @@ export class PetService { */ public deletePetWithHttpInfo(petId: number, apiKey?: string, extraHttpRequestParams?: any): Observable { const path = this.basePath + '/pet/${petId}' - .replace('${' + 'petId' + '}', String(petId)); + .replace('${' + 'petId' + '}', encodeURIComponent(String(petId))); let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -437,7 +437,7 @@ export class PetService { */ public getPetByIdWithHttpInfo(petId: number, extraHttpRequestParams?: any): Observable { const path = this.basePath + '/pet/${petId}' - .replace('${' + 'petId' + '}', String(petId)); + .replace('${' + 'petId' + '}', encodeURIComponent(String(petId))); let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -539,7 +539,7 @@ export class PetService { */ public updatePetWithFormWithHttpInfo(petId: number, name?: string, status?: string, extraHttpRequestParams?: any): Observable { const path = this.basePath + '/pet/${petId}' - .replace('${' + 'petId' + '}', String(petId)); + .replace('${' + 'petId' + '}', encodeURIComponent(String(petId))); let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -615,7 +615,7 @@ export class PetService { */ public uploadFileWithHttpInfo(petId: number, additionalMetadata?: string, file?: Blob, extraHttpRequestParams?: any): Observable { const path = this.basePath + '/pet/${petId}/uploadImage' - .replace('${' + 'petId' + '}', String(petId)); + .replace('${' + 'petId' + '}', encodeURIComponent(String(petId))); let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 diff --git a/samples/client/petstore/typescript-angular-v2/npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v2/npm/api/store.service.ts index 1dd4980e43b..3610483fd6b 100644 --- a/samples/client/petstore/typescript-angular-v2/npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v2/npm/api/store.service.ts @@ -149,7 +149,7 @@ export class StoreService { */ public deleteOrderWithHttpInfo(orderId: string, extraHttpRequestParams?: any): Observable { const path = this.basePath + '/store/order/${orderId}' - .replace('${' + 'orderId' + '}', String(orderId)); + .replace('${' + 'orderId' + '}', encodeURIComponent(String(orderId))); let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -231,7 +231,7 @@ export class StoreService { */ public getOrderByIdWithHttpInfo(orderId: number, extraHttpRequestParams?: any): Observable { const path = this.basePath + '/store/order/${orderId}' - .replace('${' + 'orderId' + '}', String(orderId)); + .replace('${' + 'orderId' + '}', encodeURIComponent(String(orderId))); let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 diff --git a/samples/client/petstore/typescript-angular-v2/npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v2/npm/api/user.service.ts index 4f24303f502..d608c6a4c27 100644 --- a/samples/client/petstore/typescript-angular-v2/npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v2/npm/api/user.service.ts @@ -347,7 +347,7 @@ export class UserService { */ public deleteUserWithHttpInfo(username: string, extraHttpRequestParams?: any): Observable { const path = this.basePath + '/user/${username}' - .replace('${' + 'username' + '}', String(username)); + .replace('${' + 'username' + '}', encodeURIComponent(String(username))); let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -389,7 +389,7 @@ export class UserService { */ public getUserByNameWithHttpInfo(username: string, extraHttpRequestParams?: any): Observable { const path = this.basePath + '/user/${username}' - .replace('${' + 'username' + '}', String(username)); + .replace('${' + 'username' + '}', encodeURIComponent(String(username))); let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -522,7 +522,7 @@ export class UserService { */ public updateUserWithHttpInfo(username: string, body: User, extraHttpRequestParams?: any): Observable { const path = this.basePath + '/user/${username}' - .replace('${' + 'username' + '}', String(username)); + .replace('${' + 'username' + '}', encodeURIComponent(String(username))); let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.service.ts b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.service.ts index 10bac669298..775efa6b32d 100644 --- a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.service.ts @@ -275,7 +275,7 @@ export class PetService implements PetServiceInterface { */ public deletePetWithHttpInfo(petId: number, apiKey?: string, extraHttpRequestParams?: any): Observable { const path = this.basePath + '/pet/${petId}' - .replace('${' + 'petId' + '}', String(petId)); + .replace('${' + 'petId' + '}', encodeURIComponent(String(petId))); let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -438,7 +438,7 @@ export class PetService implements PetServiceInterface { */ public getPetByIdWithHttpInfo(petId: number, extraHttpRequestParams?: any): Observable { const path = this.basePath + '/pet/${petId}' - .replace('${' + 'petId' + '}', String(petId)); + .replace('${' + 'petId' + '}', encodeURIComponent(String(petId))); let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -540,7 +540,7 @@ export class PetService implements PetServiceInterface { */ public updatePetWithFormWithHttpInfo(petId: number, name?: string, status?: string, extraHttpRequestParams?: any): Observable { const path = this.basePath + '/pet/${petId}' - .replace('${' + 'petId' + '}', String(petId)); + .replace('${' + 'petId' + '}', encodeURIComponent(String(petId))); let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -616,7 +616,7 @@ export class PetService implements PetServiceInterface { */ public uploadFileWithHttpInfo(petId: number, additionalMetadata?: string, file?: Blob, extraHttpRequestParams?: any): Observable { const path = this.basePath + '/pet/${petId}/uploadImage' - .replace('${' + 'petId' + '}', String(petId)); + .replace('${' + 'petId' + '}', encodeURIComponent(String(petId))); let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.service.ts b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.service.ts index 32577dab35f..2c715fbab7c 100644 --- a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.service.ts @@ -150,7 +150,7 @@ export class StoreService implements StoreServiceInterface { */ public deleteOrderWithHttpInfo(orderId: string, extraHttpRequestParams?: any): Observable { const path = this.basePath + '/store/order/${orderId}' - .replace('${' + 'orderId' + '}', String(orderId)); + .replace('${' + 'orderId' + '}', encodeURIComponent(String(orderId))); let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -232,7 +232,7 @@ export class StoreService implements StoreServiceInterface { */ public getOrderByIdWithHttpInfo(orderId: number, extraHttpRequestParams?: any): Observable { const path = this.basePath + '/store/order/${orderId}' - .replace('${' + 'orderId' + '}', String(orderId)); + .replace('${' + 'orderId' + '}', encodeURIComponent(String(orderId))); let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.service.ts b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.service.ts index 5765c284b3e..0448df9297c 100644 --- a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.service.ts @@ -348,7 +348,7 @@ export class UserService implements UserServiceInterface { */ public deleteUserWithHttpInfo(username: string, extraHttpRequestParams?: any): Observable { const path = this.basePath + '/user/${username}' - .replace('${' + 'username' + '}', String(username)); + .replace('${' + 'username' + '}', encodeURIComponent(String(username))); let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -390,7 +390,7 @@ export class UserService implements UserServiceInterface { */ public getUserByNameWithHttpInfo(username: string, extraHttpRequestParams?: any): Observable { const path = this.basePath + '/user/${username}' - .replace('${' + 'username' + '}', String(username)); + .replace('${' + 'username' + '}', encodeURIComponent(String(username))); let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -523,7 +523,7 @@ export class UserService implements UserServiceInterface { */ public updateUserWithHttpInfo(username: string, body: User, extraHttpRequestParams?: any): Observable { const path = this.basePath + '/user/${username}' - .replace('${' + 'username' + '}', String(username)); + .replace('${' + 'username' + '}', encodeURIComponent(String(username))); let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper()); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 diff --git a/samples/client/petstore/typescript-angularjs/api/PetApi.ts b/samples/client/petstore/typescript-angularjs/api/PetApi.ts index eedcbb36425..a830833d94b 100644 --- a/samples/client/petstore/typescript-angularjs/api/PetApi.ts +++ b/samples/client/petstore/typescript-angularjs/api/PetApi.ts @@ -62,7 +62,7 @@ export class PetApi { */ public deletePet (petId: number, apiKey?: string, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> { const localVarPath = this.basePath + '/pet/{petId}' - .replace('{' + 'petId' + '}', String(petId)); + .replace('{' + 'petId' + '}', encodeURIComponent(String(petId))); let queryParameters: any = {}; let headerParams: any = (Object).assign({}, this.defaultHeaders); @@ -154,7 +154,7 @@ export class PetApi { */ public getPetById (petId: number, extraHttpRequestParams?: any ) : ng.IHttpPromise { const localVarPath = this.basePath + '/pet/{petId}' - .replace('{' + 'petId' + '}', String(petId)); + .replace('{' + 'petId' + '}', encodeURIComponent(String(petId))); let queryParameters: any = {}; let headerParams: any = (Object).assign({}, this.defaultHeaders); @@ -212,7 +212,7 @@ export class PetApi { */ public updatePetWithForm (petId: number, name?: string, status?: string, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> { const localVarPath = this.basePath + '/pet/{petId}' - .replace('{' + 'petId' + '}', String(petId)); + .replace('{' + 'petId' + '}', encodeURIComponent(String(petId))); let queryParameters: any = {}; let headerParams: any = (Object).assign({}, this.defaultHeaders); @@ -251,7 +251,7 @@ export class PetApi { */ public uploadFile (petId: number, additionalMetadata?: string, file?: any, extraHttpRequestParams?: any ) : ng.IHttpPromise { const localVarPath = this.basePath + '/pet/{petId}/uploadImage' - .replace('{' + 'petId' + '}', String(petId)); + .replace('{' + 'petId' + '}', encodeURIComponent(String(petId))); let queryParameters: any = {}; let headerParams: any = (Object).assign({}, this.defaultHeaders); diff --git a/samples/client/petstore/typescript-angularjs/api/StoreApi.ts b/samples/client/petstore/typescript-angularjs/api/StoreApi.ts index 3946a8d47a8..93199134ab8 100644 --- a/samples/client/petstore/typescript-angularjs/api/StoreApi.ts +++ b/samples/client/petstore/typescript-angularjs/api/StoreApi.ts @@ -33,7 +33,7 @@ export class StoreApi { */ public deleteOrder (orderId: string, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> { const localVarPath = this.basePath + '/store/order/{orderId}' - .replace('{' + 'orderId' + '}', String(orderId)); + .replace('{' + 'orderId' + '}', encodeURIComponent(String(orderId))); let queryParameters: any = {}; let headerParams: any = (Object).assign({}, this.defaultHeaders); @@ -83,7 +83,7 @@ export class StoreApi { */ public getOrderById (orderId: number, extraHttpRequestParams?: any ) : ng.IHttpPromise { const localVarPath = this.basePath + '/store/order/{orderId}' - .replace('{' + 'orderId' + '}', String(orderId)); + .replace('{' + 'orderId' + '}', encodeURIComponent(String(orderId))); let queryParameters: any = {}; let headerParams: any = (Object).assign({}, this.defaultHeaders); diff --git a/samples/client/petstore/typescript-angularjs/api/UserApi.ts b/samples/client/petstore/typescript-angularjs/api/UserApi.ts index 74092f7541f..903abecb803 100644 --- a/samples/client/petstore/typescript-angularjs/api/UserApi.ts +++ b/samples/client/petstore/typescript-angularjs/api/UserApi.ts @@ -117,7 +117,7 @@ export class UserApi { */ public deleteUser (username: string, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> { const localVarPath = this.basePath + '/user/{username}' - .replace('{' + 'username' + '}', String(username)); + .replace('{' + 'username' + '}', encodeURIComponent(String(username))); let queryParameters: any = {}; let headerParams: any = (Object).assign({}, this.defaultHeaders); @@ -145,7 +145,7 @@ export class UserApi { */ public getUserByName (username: string, extraHttpRequestParams?: any ) : ng.IHttpPromise { const localVarPath = this.basePath + '/user/{username}' - .replace('{' + 'username' + '}', String(username)); + .replace('{' + 'username' + '}', encodeURIComponent(String(username))); let queryParameters: any = {}; let headerParams: any = (Object).assign({}, this.defaultHeaders); @@ -236,7 +236,7 @@ export class UserApi { */ public updateUser (username: string, body: models.User, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> { const localVarPath = this.basePath + '/user/{username}' - .replace('{' + 'username' + '}', String(username)); + .replace('{' + 'username' + '}', encodeURIComponent(String(username))); let queryParameters: any = {}; let headerParams: any = (Object).assign({}, this.defaultHeaders);