From 3852736b404644d0bd37c90737b9e8e738afbb16 Mon Sep 17 00:00:00 2001 From: Ferris Tseng Date: Thu, 16 Jun 2016 15:36:50 -0400 Subject: [PATCH 1/2] fix result not defined error in js client --- .../src/main/resources/Javascript/ApiClient.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/swagger-codegen/src/main/resources/Javascript/ApiClient.mustache b/modules/swagger-codegen/src/main/resources/Javascript/ApiClient.mustache index 3b301e0937c..36a484258ec 100644 --- a/modules/swagger-codegen/src/main/resources/Javascript/ApiClient.mustache +++ b/modules/swagger-codegen/src/main/resources/Javascript/ApiClient.mustache @@ -489,7 +489,7 @@ } else { for (var k in data) { if (data.hasOwnProperty(k)) - result[k] = exports.convertToType(data[k], itemType); + obj[k] = exports.convertToType(data[k], itemType); } } }; From c30c586f94854bb58dd12b7d03a1437d252d35bb Mon Sep 17 00:00:00 2001 From: Ferris Tseng Date: Fri, 17 Jun 2016 15:46:36 -0400 Subject: [PATCH 2/2] update petstore sample --- .../client/petstore/javascript-promise/README.md | 14 +++++++------- .../petstore/javascript-promise/src/ApiClient.js | 6 +++--- samples/client/petstore/javascript/README.md | 14 +++++++------- .../client/petstore/javascript/src/ApiClient.js | 6 +++--- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/samples/client/petstore/javascript-promise/README.md b/samples/client/petstore/javascript-promise/README.md index c081f0f3cda..0688588b914 100644 --- a/samples/client/petstore/javascript-promise/README.md +++ b/samples/client/petstore/javascript-promise/README.md @@ -6,7 +6,7 @@ This SDK is automatically generated by the [Swagger Codegen](https://github.com/ - API version: 1.0.0 - Package version: 1.0.0 -- Build date: 2016-06-15T01:16:30.521+08:00 +- Build date: 2016-06-17T15:45:49.945-04:00 - Build package: class io.swagger.codegen.languages.JavascriptClientCodegen ## Installation @@ -139,12 +139,6 @@ Class | Method | HTTP request | Description ## Documentation for Authorization -### api_key - -- **Type**: API key -- **API key parameter name**: api_key -- **Location**: HTTP header - ### petstore_auth - **Type**: OAuth @@ -154,3 +148,9 @@ Class | Method | HTTP request | Description - write:pets: modify pets in your account - read:pets: read your pets +### api_key + +- **Type**: API key +- **API key parameter name**: api_key +- **Location**: HTTP header + diff --git a/samples/client/petstore/javascript-promise/src/ApiClient.js b/samples/client/petstore/javascript-promise/src/ApiClient.js index d89eb4f4460..a9c34a392f5 100644 --- a/samples/client/petstore/javascript-promise/src/ApiClient.js +++ b/samples/client/petstore/javascript-promise/src/ApiClient.js @@ -64,8 +64,8 @@ * @type {Array.} */ this.authentications = { - 'api_key': {type: 'apiKey', 'in': 'header', name: 'api_key'}, - 'petstore_auth': {type: 'oauth2'} + 'petstore_auth': {type: 'oauth2'}, + 'api_key': {type: 'apiKey', 'in': 'header', name: 'api_key'} }; /** * The default HTTP headers to be included for all API calls. @@ -489,7 +489,7 @@ } else { for (var k in data) { if (data.hasOwnProperty(k)) - result[k] = exports.convertToType(data[k], itemType); + obj[k] = exports.convertToType(data[k], itemType); } } }; diff --git a/samples/client/petstore/javascript/README.md b/samples/client/petstore/javascript/README.md index bba1f871bcf..8e17a391c5d 100644 --- a/samples/client/petstore/javascript/README.md +++ b/samples/client/petstore/javascript/README.md @@ -6,7 +6,7 @@ This SDK is automatically generated by the [Swagger Codegen](https://github.com/ - API version: 1.0.0 - Package version: 1.0.0 -- Build date: 2016-06-15T01:15:37.147+08:00 +- Build date: 2016-06-17T15:45:43.569-04:00 - Build package: class io.swagger.codegen.languages.JavascriptClientCodegen ## Installation @@ -142,12 +142,6 @@ Class | Method | HTTP request | Description ## Documentation for Authorization -### api_key - -- **Type**: API key -- **API key parameter name**: api_key -- **Location**: HTTP header - ### petstore_auth - **Type**: OAuth @@ -157,3 +151,9 @@ Class | Method | HTTP request | Description - write:pets: modify pets in your account - read:pets: read your pets +### api_key + +- **Type**: API key +- **API key parameter name**: api_key +- **Location**: HTTP header + diff --git a/samples/client/petstore/javascript/src/ApiClient.js b/samples/client/petstore/javascript/src/ApiClient.js index 9187f89af01..3436e9dbe5d 100644 --- a/samples/client/petstore/javascript/src/ApiClient.js +++ b/samples/client/petstore/javascript/src/ApiClient.js @@ -64,8 +64,8 @@ * @type {Array.} */ this.authentications = { - 'api_key': {type: 'apiKey', 'in': 'header', name: 'api_key'}, - 'petstore_auth': {type: 'oauth2'} + 'petstore_auth': {type: 'oauth2'}, + 'api_key': {type: 'apiKey', 'in': 'header', name: 'api_key'} }; /** * The default HTTP headers to be included for all API calls. @@ -501,7 +501,7 @@ } else { for (var k in data) { if (data.hasOwnProperty(k)) - result[k] = exports.convertToType(data[k], itemType); + obj[k] = exports.convertToType(data[k], itemType); } } };