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 eca28359c4b..c34b1c85dc1 100644 --- a/modules/swagger-codegen/src/main/resources/typescript-angular2/api.mustache +++ b/modules/swagger-codegen/src/main/resources/typescript-angular2/api.mustache @@ -61,7 +61,8 @@ export class {{classname}} { {{#allParams}}* @param {{paramName}} {{description}} {{/allParams}}*/ public {{nickname}}WithHttpInfo({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}extraHttpRequestParams?: any): Observable { - const path = this.basePath + `{{path}}`; + const path = this.basePath + '{{path}}'{{#pathParams}} + .replace('${' + '{{baseName}}' + '}', String({{paramName}})){{/pathParams}}; let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 diff --git a/samples/client/petstore/typescript-angular2/default/api/PetApi.ts b/samples/client/petstore/typescript-angular2/default/api/PetApi.ts index c3cf9ca9e0f..502e8d2adda 100644 --- a/samples/client/petstore/typescript-angular2/default/api/PetApi.ts +++ b/samples/client/petstore/typescript-angular2/default/api/PetApi.ts @@ -192,7 +192,7 @@ export class PetApi { * @param body Pet object that needs to be added to the store */ public addPetWithHttpInfo(body?: models.Pet, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/pet`; + const path = this.basePath + '/pet'; let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -239,7 +239,8 @@ export class PetApi { * @param apiKey */ public deletePetWithHttpInfo(petId: number, apiKey?: string, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/pet/${petId}`; + const path = this.basePath + '/pet/${petId}' + .replace('${' + 'petId' + '}', String(petId)); let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -285,7 +286,7 @@ export class PetApi { * @param status Status values that need to be considered for filter */ public findPetsByStatusWithHttpInfo(status?: Array, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/pet/findByStatus`; + const path = this.basePath + '/pet/findByStatus'; let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -330,7 +331,7 @@ export class PetApi { * @param tags Tags to filter by */ public findPetsByTagsWithHttpInfo(tags?: Array, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/pet/findByTags`; + const path = this.basePath + '/pet/findByTags'; let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -375,7 +376,8 @@ export class PetApi { * @param petId ID of pet that needs to be fetched */ public getPetByIdWithHttpInfo(petId: number, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/pet/${petId}`; + const path = this.basePath + '/pet/${petId}' + .replace('${' + 'petId' + '}', String(petId)); let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -426,7 +428,7 @@ export class PetApi { * @param body Pet object that needs to be added to the store */ public updatePetWithHttpInfo(body?: models.Pet, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/pet`; + const path = this.basePath + '/pet'; let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -474,7 +476,8 @@ export class PetApi { * @param status Updated status of the pet */ public updatePetWithFormWithHttpInfo(petId: string, name?: string, status?: string, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/pet/${petId}`; + const path = this.basePath + '/pet/${petId}' + .replace('${' + 'petId' + '}', String(petId)); let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -533,7 +536,8 @@ export class PetApi { * @param file file to upload */ public uploadFileWithHttpInfo(petId: number, additionalMetadata?: string, file?: any, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/pet/${petId}/uploadImage`; + const path = this.basePath + '/pet/${petId}/uploadImage' + .replace('${' + 'petId' + '}', String(petId)); let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 diff --git a/samples/client/petstore/typescript-angular2/default/api/StoreApi.ts b/samples/client/petstore/typescript-angular2/default/api/StoreApi.ts index 38d67411809..e10a1281c22 100644 --- a/samples/client/petstore/typescript-angular2/default/api/StoreApi.ts +++ b/samples/client/petstore/typescript-angular2/default/api/StoreApi.ts @@ -122,7 +122,8 @@ export class StoreApi { * @param orderId ID of the order that needs to be deleted */ public deleteOrderWithHttpInfo(orderId: string, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/store/order/${orderId}`; + const path = this.basePath + '/store/order/${orderId}' + .replace('${' + 'orderId' + '}', String(orderId)); let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -161,7 +162,7 @@ export class StoreApi { * Returns a map of status codes to quantities */ public getInventoryWithHttpInfo(extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/store/inventory`; + const path = this.basePath + '/store/inventory'; let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -202,7 +203,8 @@ export class StoreApi { * @param orderId ID of pet that needs to be fetched */ public getOrderByIdWithHttpInfo(orderId: string, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/store/order/${orderId}`; + const path = this.basePath + '/store/order/${orderId}' + .replace('${' + 'orderId' + '}', String(orderId)); let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -242,7 +244,7 @@ export class StoreApi { * @param body order placed for purchasing the pet */ public placeOrderWithHttpInfo(body?: models.Order, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/store/order`; + const path = this.basePath + '/store/order'; let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 diff --git a/samples/client/petstore/typescript-angular2/default/api/UserApi.ts b/samples/client/petstore/typescript-angular2/default/api/UserApi.ts index 4844041bce9..96868788a9c 100644 --- a/samples/client/petstore/typescript-angular2/default/api/UserApi.ts +++ b/samples/client/petstore/typescript-angular2/default/api/UserApi.ts @@ -188,7 +188,7 @@ export class UserApi { * @param body Created user object */ public createUserWithHttpInfo(body?: models.User, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/user`; + const path = this.basePath + '/user'; let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -226,7 +226,7 @@ export class UserApi { * @param body List of user object */ public createUsersWithArrayInputWithHttpInfo(body?: Array, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/user/createWithArray`; + const path = this.basePath + '/user/createWithArray'; let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -264,7 +264,7 @@ export class UserApi { * @param body List of user object */ public createUsersWithListInputWithHttpInfo(body?: Array, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/user/createWithList`; + const path = this.basePath + '/user/createWithList'; let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -302,7 +302,8 @@ export class UserApi { * @param username The name that needs to be deleted */ public deleteUserWithHttpInfo(username: string, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/user/${username}`; + const path = this.basePath + '/user/${username}' + .replace('${' + 'username' + '}', String(username)); let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -342,7 +343,8 @@ export class UserApi { * @param username The name that needs to be fetched. Use user1 for testing. */ public getUserByNameWithHttpInfo(username: string, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/user/${username}`; + const path = this.basePath + '/user/${username}' + .replace('${' + 'username' + '}', String(username)); let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -383,7 +385,7 @@ export class UserApi { * @param password The password for login in clear text */ public loginUserWithHttpInfo(username?: string, password?: string, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/user/login`; + const path = this.basePath + '/user/login'; let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -424,7 +426,7 @@ export class UserApi { * */ public logoutUserWithHttpInfo(extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/user/logout`; + const path = this.basePath + '/user/logout'; let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -461,7 +463,8 @@ export class UserApi { * @param body Updated user object */ public updateUserWithHttpInfo(username: string, body?: models.User, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/user/${username}`; + const path = this.basePath + '/user/${username}' + .replace('${' + 'username' + '}', String(username)); let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 diff --git a/samples/client/petstore/typescript-angular2/npm/README.md b/samples/client/petstore/typescript-angular2/npm/README.md index d5e4636d3c9..bf59448d8e8 100644 --- a/samples/client/petstore/typescript-angular2/npm/README.md +++ b/samples/client/petstore/typescript-angular2/npm/README.md @@ -1,4 +1,4 @@ -## @swagger/angular2-typescript-petstore@0.0.1-SNAPSHOT.201702031824 +## @swagger/angular2-typescript-petstore@0.0.1-SNAPSHOT.201702090204 ### Building @@ -19,7 +19,7 @@ navigate to the folder of your consuming project and run one of next commando's. _published:_ ``` -npm install @swagger/angular2-typescript-petstore@0.0.1-SNAPSHOT.201702031824 --save +npm install @swagger/angular2-typescript-petstore@0.0.1-SNAPSHOT.201702090204 --save ``` _unPublished (not recommended):_ diff --git a/samples/client/petstore/typescript-angular2/npm/api/PetApi.ts b/samples/client/petstore/typescript-angular2/npm/api/PetApi.ts index 9806c35339c..26ee01017f7 100644 --- a/samples/client/petstore/typescript-angular2/npm/api/PetApi.ts +++ b/samples/client/petstore/typescript-angular2/npm/api/PetApi.ts @@ -180,7 +180,7 @@ export class PetApi { * @param body Pet object that needs to be added to the store */ public addPetWithHttpInfo(body?: models.Pet, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/pet`; + const path = this.basePath + '/pet'; let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -229,7 +229,8 @@ export class PetApi { * @param apiKey */ public deletePetWithHttpInfo(petId: number, apiKey?: string, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/pet/${petId}`; + const path = this.basePath + '/pet/${petId}' + .replace('${' + 'petId' + '}', String(petId)); let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -278,7 +279,7 @@ export class PetApi { * @param status Status values that need to be considered for filter */ public findPetsByStatusWithHttpInfo(status?: Array, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/pet/findByStatus`; + const path = this.basePath + '/pet/findByStatus'; let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -327,7 +328,7 @@ export class PetApi { * @param tags Tags to filter by */ public findPetsByTagsWithHttpInfo(tags?: Array, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/pet/findByTags`; + const path = this.basePath + '/pet/findByTags'; let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -376,7 +377,8 @@ export class PetApi { * @param petId ID of pet that needs to be fetched */ public getPetByIdWithHttpInfo(petId: number, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/pet/${petId}`; + const path = this.basePath + '/pet/${petId}' + .replace('${' + 'petId' + '}', String(petId)); let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -428,7 +430,7 @@ export class PetApi { * @param body Pet object that needs to be added to the store */ public updatePetWithHttpInfo(body?: models.Pet, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/pet`; + const path = this.basePath + '/pet'; let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -478,7 +480,8 @@ export class PetApi { * @param status Updated status of the pet */ public updatePetWithFormWithHttpInfo(petId: string, name?: string, status?: string, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/pet/${petId}`; + const path = this.basePath + '/pet/${petId}' + .replace('${' + 'petId' + '}', String(petId)); let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -541,7 +544,8 @@ export class PetApi { * @param file file to upload */ public uploadFileWithHttpInfo(petId: number, additionalMetadata?: string, file?: any, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/pet/${petId}/uploadImage`; + const path = this.basePath + '/pet/${petId}/uploadImage' + .replace('${' + 'petId' + '}', String(petId)); let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 diff --git a/samples/client/petstore/typescript-angular2/npm/api/StoreApi.ts b/samples/client/petstore/typescript-angular2/npm/api/StoreApi.ts index 744e5333386..b84d8f6a4f8 100644 --- a/samples/client/petstore/typescript-angular2/npm/api/StoreApi.ts +++ b/samples/client/petstore/typescript-angular2/npm/api/StoreApi.ts @@ -110,7 +110,8 @@ export class StoreApi { * @param orderId ID of the order that needs to be deleted */ public deleteOrderWithHttpInfo(orderId: string, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/store/order/${orderId}`; + const path = this.basePath + '/store/order/${orderId}' + .replace('${' + 'orderId' + '}', String(orderId)); let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -147,7 +148,7 @@ export class StoreApi { * Returns a map of status codes to quantities */ public getInventoryWithHttpInfo(extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/store/inventory`; + const path = this.basePath + '/store/inventory'; let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -186,7 +187,8 @@ export class StoreApi { * @param orderId ID of pet that needs to be fetched */ public getOrderByIdWithHttpInfo(orderId: string, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/store/order/${orderId}`; + const path = this.basePath + '/store/order/${orderId}' + .replace('${' + 'orderId' + '}', String(orderId)); let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -224,7 +226,7 @@ export class StoreApi { * @param body order placed for purchasing the pet */ public placeOrderWithHttpInfo(body?: models.Order, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/store/order`; + const path = this.basePath + '/store/order'; let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 diff --git a/samples/client/petstore/typescript-angular2/npm/api/UserApi.ts b/samples/client/petstore/typescript-angular2/npm/api/UserApi.ts index 2c15efc9ee5..3db8a332039 100644 --- a/samples/client/petstore/typescript-angular2/npm/api/UserApi.ts +++ b/samples/client/petstore/typescript-angular2/npm/api/UserApi.ts @@ -176,7 +176,7 @@ export class UserApi { * @param body Created user object */ public createUserWithHttpInfo(body?: models.User, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/user`; + const path = this.basePath + '/user'; let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -213,7 +213,7 @@ export class UserApi { * @param body List of user object */ public createUsersWithArrayInputWithHttpInfo(body?: Array, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/user/createWithArray`; + const path = this.basePath + '/user/createWithArray'; let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -250,7 +250,7 @@ export class UserApi { * @param body List of user object */ public createUsersWithListInputWithHttpInfo(body?: Array, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/user/createWithList`; + const path = this.basePath + '/user/createWithList'; let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -287,7 +287,8 @@ export class UserApi { * @param username The name that needs to be deleted */ public deleteUserWithHttpInfo(username: string, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/user/${username}`; + const path = this.basePath + '/user/${username}' + .replace('${' + 'username' + '}', String(username)); let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -325,7 +326,8 @@ export class UserApi { * @param username The name that needs to be fetched. Use user1 for testing. */ public getUserByNameWithHttpInfo(username: string, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/user/${username}`; + const path = this.basePath + '/user/${username}' + .replace('${' + 'username' + '}', String(username)); let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -364,7 +366,7 @@ export class UserApi { * @param password The password for login in clear text */ public loginUserWithHttpInfo(username?: string, password?: string, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/user/login`; + const path = this.basePath + '/user/login'; let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -413,7 +415,7 @@ export class UserApi { * */ public logoutUserWithHttpInfo(extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/user/logout`; + const path = this.basePath + '/user/logout'; let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -448,7 +450,8 @@ export class UserApi { * @param body Updated user object */ public updateUserWithHttpInfo(username: string, body?: models.User, extraHttpRequestParams?: any): Observable { - const path = this.basePath + `/user/${username}`; + const path = this.basePath + '/user/${username}' + .replace('${' + 'username' + '}', String(username)); let queryParameters = new URLSearchParams(); let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 diff --git a/samples/client/petstore/typescript-angular2/npm/package.json b/samples/client/petstore/typescript-angular2/npm/package.json index f0a54da13d5..e1c5d927281 100644 --- a/samples/client/petstore/typescript-angular2/npm/package.json +++ b/samples/client/petstore/typescript-angular2/npm/package.json @@ -1,6 +1,6 @@ { "name": "@swagger/angular2-typescript-petstore", - "version": "0.0.1-SNAPSHOT.201702031824", + "version": "0.0.1-SNAPSHOT.201702090204", "description": "swagger client for @swagger/angular2-typescript-petstore", "author": "Swagger Codegen Contributors", "keywords": [