From af2db27a8389f98d61960e58c710d98452f003e2 Mon Sep 17 00:00:00 2001 From: wing328 Date: Thu, 8 Dec 2016 18:09:20 +0800 Subject: [PATCH] remove trailing space in ts fetech api, add npm test to ci (#4348) --- .../main/resources/TypeScript-Fetch/api.mustache | 6 ++++-- .../petstore/typescript-fetch/builds/default/api.ts | 4 ++-- .../typescript-fetch/builds/default/pom.xml | 13 +++++++++++++ .../typescript-fetch/builds/es6-target/api.ts | 4 ++-- .../typescript-fetch/builds/es6-target/pom.xml | 13 +++++++++++++ .../typescript-fetch/builds/with-npm-version/api.ts | 4 ++-- .../builds/with-npm-version/pom.xml | 13 +++++++++++++ 7 files changed, 49 insertions(+), 8 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/TypeScript-Fetch/api.mustache b/modules/swagger-codegen/src/main/resources/TypeScript-Fetch/api.mustache index 907089e33bd..16a41ff983b 100644 --- a/modules/swagger-codegen/src/main/resources/TypeScript-Fetch/api.mustache +++ b/modules/swagger-codegen/src/main/resources/TypeScript-Fetch/api.mustache @@ -94,8 +94,10 @@ export const {{classname}}FetchParamCreactor = { let contentTypeHeader: Dictionary; {{#hasFormParams}} contentTypeHeader = { "Content-Type": "application/x-www-form-urlencoded" }; - fetchOptions.body = querystring.stringify({ {{#formParams}} - "{{baseName}}": params["{{paramName}}"],{{/formParams}} + fetchOptions.body = querystring.stringify({ + {{#formParams}} + "{{baseName}}": params["{{paramName}}"], + {{/formParams}} }); {{/hasFormParams}} {{#hasBodyParam}} diff --git a/samples/client/petstore/typescript-fetch/builds/default/api.ts b/samples/client/petstore/typescript-fetch/builds/default/api.ts index c8445d1edfb..917785c47da 100644 --- a/samples/client/petstore/typescript-fetch/builds/default/api.ts +++ b/samples/client/petstore/typescript-fetch/builds/default/api.ts @@ -250,7 +250,7 @@ export const PetApiFetchParamCreactor = { let contentTypeHeader: Dictionary; contentTypeHeader = { "Content-Type": "application/x-www-form-urlencoded" }; - fetchOptions.body = querystring.stringify({ + fetchOptions.body = querystring.stringify({ "name": params["name"], "status": params["status"], }); @@ -281,7 +281,7 @@ export const PetApiFetchParamCreactor = { let contentTypeHeader: Dictionary; contentTypeHeader = { "Content-Type": "application/x-www-form-urlencoded" }; - fetchOptions.body = querystring.stringify({ + fetchOptions.body = querystring.stringify({ "additionalMetadata": params["additionalMetadata"], "file": params["file"], }); diff --git a/samples/client/petstore/typescript-fetch/builds/default/pom.xml b/samples/client/petstore/typescript-fetch/builds/default/pom.xml index 53722c49e7b..f7886b3f9aa 100644 --- a/samples/client/petstore/typescript-fetch/builds/default/pom.xml +++ b/samples/client/petstore/typescript-fetch/builds/default/pom.xml @@ -39,6 +39,19 @@ + + npm-test + integration-test + + exec + + + npm + + test + + + diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/api.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/api.ts index 832e5417e0e..7bbbe76ca50 100644 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/api.ts +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/api.ts @@ -249,7 +249,7 @@ export const PetApiFetchParamCreactor = { let contentTypeHeader: Dictionary; contentTypeHeader = { "Content-Type": "application/x-www-form-urlencoded" }; - fetchOptions.body = querystring.stringify({ + fetchOptions.body = querystring.stringify({ "name": params["name"], "status": params["status"], }); @@ -280,7 +280,7 @@ export const PetApiFetchParamCreactor = { let contentTypeHeader: Dictionary; contentTypeHeader = { "Content-Type": "application/x-www-form-urlencoded" }; - fetchOptions.body = querystring.stringify({ + fetchOptions.body = querystring.stringify({ "additionalMetadata": params["additionalMetadata"], "file": params["file"], }); diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/pom.xml b/samples/client/petstore/typescript-fetch/builds/es6-target/pom.xml index 8730e7c4377..8b8e6052761 100644 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/pom.xml +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/pom.xml @@ -39,6 +39,19 @@ + + npm-test + integration-test + + exec + + + npm + + test + + + diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/api.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/api.ts index c8445d1edfb..917785c47da 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/api.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/api.ts @@ -250,7 +250,7 @@ export const PetApiFetchParamCreactor = { let contentTypeHeader: Dictionary; contentTypeHeader = { "Content-Type": "application/x-www-form-urlencoded" }; - fetchOptions.body = querystring.stringify({ + fetchOptions.body = querystring.stringify({ "name": params["name"], "status": params["status"], }); @@ -281,7 +281,7 @@ export const PetApiFetchParamCreactor = { let contentTypeHeader: Dictionary; contentTypeHeader = { "Content-Type": "application/x-www-form-urlencoded" }; - fetchOptions.body = querystring.stringify({ + fetchOptions.body = querystring.stringify({ "additionalMetadata": params["additionalMetadata"], "file": params["file"], }); diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/pom.xml b/samples/client/petstore/typescript-fetch/builds/with-npm-version/pom.xml index 4a4380291ca..210ee3c10a1 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/pom.xml +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/pom.xml @@ -39,6 +39,19 @@ + + npm-test + integration-test + + exec + + + npm + + test + + +