From 8e0816b5dd8773c98bd833fa172f1f83f42dcb14 Mon Sep 17 00:00:00 2001 From: thibaultclem Date: Wed, 9 Dec 2015 16:11:08 +0700 Subject: [PATCH 1/2] Fix syntax issue when generating Javascript client operation without parameters --- .../swagger-codegen/src/main/resources/Javascript/api.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/swagger-codegen/src/main/resources/Javascript/api.mustache b/modules/swagger-codegen/src/main/resources/Javascript/api.mustache index a9af0d54c15a..f7bc498ff189 100644 --- a/modules/swagger-codegen/src/main/resources/Javascript/api.mustache +++ b/modules/swagger-codegen/src/main/resources/Javascript/api.mustache @@ -20,7 +20,7 @@ var {{classname}} = function {{classname}}() { {{/allParams}} * @param {function} callback the callback function * @return {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} */ - self.{{nickname}} = function({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}, callback) { + self.{{nickname}} = function({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}{{#hasParams}}, {{/hasParams}}callback) { var {{localVariablePrefix}}postBody = {{#bodyParam}}{{^isBinary}}JSON.stringify({{paramName}}){{/isBinary}}{{#isBinary}}null{{/isBinary}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}; var {{localVariablePrefix}}postBinaryBody = {{#bodyParam}}{{#isBinary}}{{paramName}}{{/isBinary}}{{^isBinary}}null{{/isBinary}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}; From 7c7255278082337f69971844f734e7022a5e269b Mon Sep 17 00:00:00 2001 From: thibaultclem Date: Wed, 9 Dec 2015 16:32:18 +0700 Subject: [PATCH 2/2] Update JS Client Petstore samples after fixing issue on the JS api.mustache --- .../client/petstore/javascript/src/scripts/rest/api/PetApi.js | 2 +- .../petstore/javascript/src/scripts/rest/api/StoreApi.js | 4 ++-- .../petstore/javascript/src/scripts/rest/api/UserApi.js | 4 ++-- .../client/petstore/javascript/src/scripts/rest/model/Pet.js | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/samples/client/petstore/javascript/src/scripts/rest/api/PetApi.js b/samples/client/petstore/javascript/src/scripts/rest/api/PetApi.js index a693d83dbc2d..bf35463dc1a5 100644 --- a/samples/client/petstore/javascript/src/scripts/rest/api/PetApi.js +++ b/samples/client/petstore/javascript/src/scripts/rest/api/PetApi.js @@ -1,5 +1,5 @@ /* - * @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavascriptClientCodegen", date = "2015-12-07T10:51:19.835+08:00") + * @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavascriptClientCodegen", date = "2015-12-09T16:07:21.000+07:00") */ //export module diff --git a/samples/client/petstore/javascript/src/scripts/rest/api/StoreApi.js b/samples/client/petstore/javascript/src/scripts/rest/api/StoreApi.js index 086ce8b4ae9a..5487b1c386ed 100644 --- a/samples/client/petstore/javascript/src/scripts/rest/api/StoreApi.js +++ b/samples/client/petstore/javascript/src/scripts/rest/api/StoreApi.js @@ -1,5 +1,5 @@ /* - * @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavascriptClientCodegen", date = "2015-12-07T10:51:19.835+08:00") + * @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavascriptClientCodegen", date = "2015-12-09T16:07:21.000+07:00") */ //export module @@ -18,7 +18,7 @@ var StoreApi = function StoreApi() { * @param {function} callback the callback function * @return Map */ - self.getInventory = function(, callback) { + self.getInventory = function(callback) { var postBody = null; var postBinaryBody = null; diff --git a/samples/client/petstore/javascript/src/scripts/rest/api/UserApi.js b/samples/client/petstore/javascript/src/scripts/rest/api/UserApi.js index 53cecbdf8f74..30c797cf25f2 100644 --- a/samples/client/petstore/javascript/src/scripts/rest/api/UserApi.js +++ b/samples/client/petstore/javascript/src/scripts/rest/api/UserApi.js @@ -1,5 +1,5 @@ /* - * @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavascriptClientCodegen", date = "2015-12-07T10:51:19.835+08:00") + * @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavascriptClientCodegen", date = "2015-12-09T16:07:21.000+07:00") */ //export module @@ -230,7 +230,7 @@ var UserApi = function UserApi() { * @param {function} callback the callback function * @return void */ - self.logoutUser = function(, callback) { + self.logoutUser = function(callback) { var postBody = null; var postBinaryBody = null; diff --git a/samples/client/petstore/javascript/src/scripts/rest/model/Pet.js b/samples/client/petstore/javascript/src/scripts/rest/model/Pet.js index e3f3a747c84c..b97907396f18 100644 --- a/samples/client/petstore/javascript/src/scripts/rest/model/Pet.js +++ b/samples/client/petstore/javascript/src/scripts/rest/model/Pet.js @@ -38,7 +38,7 @@ if ( typeof define === "function" && define.amd ) { } -var Pet = function Pet(name, photoUrls) { +var Pet = function Pet(photoUrls, name) { var self = this; /**