From 176b6829c4e51c03eed96cffa5f7379b7d8f4afa Mon Sep 17 00:00:00 2001 From: wing328 Date: Mon, 24 Apr 2017 18:44:49 +0800 Subject: [PATCH] add back toString to form parameters in ts angular2 (#5457) --- .../main/resources/typescript-angular2/api.service.mustache | 2 +- .../petstore/typescript-angular2/default/api/pet.service.ts | 4 ++-- samples/client/petstore/typescript-angular2/npm/README.md | 4 ++-- .../petstore/typescript-angular2/npm/api/pet.service.ts | 4 ++-- samples/client/petstore/typescript-angular2/npm/package.json | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/typescript-angular2/api.service.mustache b/modules/swagger-codegen/src/main/resources/typescript-angular2/api.service.mustache index d5286d6619cd..3b1c76b6a130 100644 --- a/modules/swagger-codegen/src/main/resources/typescript-angular2/api.service.mustache +++ b/modules/swagger-codegen/src/main/resources/typescript-angular2/api.service.mustache @@ -241,7 +241,7 @@ export class {{classname}} { body: {{paramName}} == null ? '' : JSON.stringify({{paramName}}), // https://github.com/angular/angular/issues/10612 {{/bodyParam}} {{#hasFormParams}} - body: formParams, + body: formParams.toString(), {{/hasFormParams}} {{#isResponseFile}} responseType: ResponseContentType.Blob, diff --git a/samples/client/petstore/typescript-angular2/default/api/pet.service.ts b/samples/client/petstore/typescript-angular2/default/api/pet.service.ts index 91b9bac6ab2c..7f89ba3b3900 100644 --- a/samples/client/petstore/typescript-angular2/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular2/default/api/pet.service.ts @@ -554,7 +554,7 @@ export class PetService { let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Post, headers: headers, - body: formParams, + body: formParams.toString(), search: queryParameters, withCredentials:true }); @@ -623,7 +623,7 @@ export class PetService { let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Post, headers: headers, - body: formParams, + body: formParams.toString(), search: queryParameters, withCredentials:true }); diff --git a/samples/client/petstore/typescript-angular2/npm/README.md b/samples/client/petstore/typescript-angular2/npm/README.md index 8995d86b5d71..e92ce8bb979b 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.201704231833 +## @swagger/angular2-typescript-petstore@0.0.1-SNAPSHOT.201704231845 ### 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.201704231833 --save +npm install @swagger/angular2-typescript-petstore@0.0.1-SNAPSHOT.201704231845 --save ``` _unPublished (not recommended):_ diff --git a/samples/client/petstore/typescript-angular2/npm/api/pet.service.ts b/samples/client/petstore/typescript-angular2/npm/api/pet.service.ts index 91b9bac6ab2c..7f89ba3b3900 100644 --- a/samples/client/petstore/typescript-angular2/npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular2/npm/api/pet.service.ts @@ -554,7 +554,7 @@ export class PetService { let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Post, headers: headers, - body: formParams, + body: formParams.toString(), search: queryParameters, withCredentials:true }); @@ -623,7 +623,7 @@ export class PetService { let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Post, headers: headers, - body: formParams, + body: formParams.toString(), search: queryParameters, withCredentials:true }); diff --git a/samples/client/petstore/typescript-angular2/npm/package.json b/samples/client/petstore/typescript-angular2/npm/package.json index a1973c26f98f..50ce3a48b59e 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.201704231833", + "version": "0.0.1-SNAPSHOT.201704231845", "description": "swagger client for @swagger/angular2-typescript-petstore", "author": "Swagger Codegen Contributors", "keywords": [