From 117e1ea53ef237e22e9be28717e35402bd822999 Mon Sep 17 00:00:00 2001 From: David Teixeira Date: Mon, 23 Jan 2017 11:29:49 +0000 Subject: [PATCH 1/2] Removed pet variable from Javascript api_test Mustache file, which was undefined and is not necessary here. This should fix issue #4608. --- .../src/main/resources/Javascript/api_test.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/swagger-codegen/src/main/resources/Javascript/api_test.mustache b/modules/swagger-codegen/src/main/resources/Javascript/api_test.mustache index 181c114ca96..e37cb1162ee 100644 --- a/modules/swagger-codegen/src/main/resources/Javascript/api_test.mustache +++ b/modules/swagger-codegen/src/main/resources/Javascript/api_test.mustache @@ -41,7 +41,7 @@ describe('{{operationId}}', function() { it('should call {{operationId}} successfully', function(done) { //uncomment below and update the code to test {{operationId}} - //instance.{{operationId}}(pet, function(error) { + //instance.{{operationId}}(function(error) { // if (error) throw error; //expect().to.be(); //}); From 6d5da3f2ef56f6254c55b508dcc436de07c08454 Mon Sep 17 00:00:00 2001 From: David Teixeira Date: Tue, 24 Jan 2017 17:24:35 +0000 Subject: [PATCH 2/2] Added single quotes -- fixes bug where generated client throws an 'Uncaught Reference Error'. --- .../main/resources/Javascript/partial_model_generic.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/swagger-codegen/src/main/resources/Javascript/partial_model_generic.mustache b/modules/swagger-codegen/src/main/resources/Javascript/partial_model_generic.mustache index f08a5c7f5b5..e955fda3869 100644 --- a/modules/swagger-codegen/src/main/resources/Javascript/partial_model_generic.mustache +++ b/modules/swagger-codegen/src/main/resources/Javascript/partial_model_generic.mustache @@ -39,7 +39,7 @@ exports.constructFromObject = function(data, obj) { if (data){{! TODO: support polymorphism: discriminator property on data determines class to instantiate.}} { obj = obj || new exports(); -{{#parent}}{{^parentModel}} ApiClient.constructFromObject(data, obj, {{vendorExtensions.x-itemType}}); +{{#parent}}{{^parentModel}} ApiClient.constructFromObject(data, obj, '{{vendorExtensions.x-itemType}}'); {{/parentModel}}{{/parent}}{{#useInheritance}}{{#parentModel}} {{classname}}.constructFromObject(data, obj);{{/parentModel}} {{#interfaces}} {{.}}.constructFromObject(data, obj); {{/interfaces}}{{/useInheritance}}{{#vars}} if (data.hasOwnProperty('{{baseName}}')) {