diff --git a/samples/client/petstore/javascript-promise/docs/FakeApi.md b/samples/client/petstore/javascript-promise/docs/FakeApi.md index b3bc1ae145f..24aca3b719b 100644 --- a/samples/client/petstore/javascript-promise/docs/FakeApi.md +++ b/samples/client/petstore/javascript-promise/docs/FakeApi.md @@ -87,7 +87,8 @@ var opts = { 'binary': "B", // String | None '_date': new Date("2013-10-20"), // Date | None 'dateTime': new Date("2013-10-20T19:20:30+01:00"), // Date | None - 'password': "password_example" // String | None + 'password': "password_example", // String | None + 'callback': "callback_example" // String | None }; apiInstance.testEndpointParameters(_number, _double, patternWithoutDelimiter, _byte, opts).then(function() { console.log('API called successfully.'); @@ -114,6 +115,7 @@ Name | Type | Description | Notes **_date** | **Date**| None | [optional] **dateTime** | **Date**| None | [optional] **password** | **String**| None | [optional] + **callback** | **String**| None | [optional] ### Return type diff --git a/samples/client/petstore/javascript-promise/src/ApiClient.js b/samples/client/petstore/javascript-promise/src/ApiClient.js index b3d66a68174..56de9dddbdb 100644 --- a/samples/client/petstore/javascript-promise/src/ApiClient.js +++ b/samples/client/petstore/javascript-promise/src/ApiClient.js @@ -65,8 +65,8 @@ */ this.authentications = { 'api_key': {type: 'apiKey', 'in': 'header', name: 'api_key'}, - 'http_basic_test': {type: 'basic'} - 'petstore_auth': {type: 'oauth2'}, + 'http_basic_test': {type: 'basic'}, + 'petstore_auth': {type: 'oauth2'} }; /** * The default HTTP headers to be included for all API calls. @@ -368,7 +368,10 @@ var contentType = this.jsonPreferredMime(contentTypes); if (contentType) { - request.type(contentType); + // Issue with superagent and multipart/form-data (https://github.com/visionmedia/superagent/issues/746) + if(contentType != 'multipart/form-data') { + request.type(contentType); + } } else if (!request.header['Content-Type']) { request.type('application/json'); } diff --git a/samples/client/petstore/javascript-promise/src/api/FakeApi.js b/samples/client/petstore/javascript-promise/src/api/FakeApi.js index c4b4a1d8771..80ee81d5e34 100644 --- a/samples/client/petstore/javascript-promise/src/api/FakeApi.js +++ b/samples/client/petstore/javascript-promise/src/api/FakeApi.js @@ -67,7 +67,7 @@ // verify the required parameter 'body' is set if (body == undefined || body == null) { - throw "Missing the required parameter 'body' when calling testClientModel"; + throw new Error("Missing the required parameter 'body' when calling testClientModel"); } @@ -110,6 +110,7 @@ * @param {Date} opts._date None * @param {Date} opts.dateTime None * @param {String} opts.password None + * @param {String} opts.callback None * @return {Promise} a {@link https://www.promisejs.org/|Promise} */ this.testEndpointParameters = function(_number, _double, patternWithoutDelimiter, _byte, opts) { @@ -118,22 +119,22 @@ // verify the required parameter '_number' is set if (_number == undefined || _number == null) { - throw "Missing the required parameter '_number' when calling testEndpointParameters"; + throw new Error("Missing the required parameter '_number' when calling testEndpointParameters"); } // verify the required parameter '_double' is set if (_double == undefined || _double == null) { - throw "Missing the required parameter '_double' when calling testEndpointParameters"; + throw new Error("Missing the required parameter '_double' when calling testEndpointParameters"); } // verify the required parameter 'patternWithoutDelimiter' is set if (patternWithoutDelimiter == undefined || patternWithoutDelimiter == null) { - throw "Missing the required parameter 'patternWithoutDelimiter' when calling testEndpointParameters"; + throw new Error("Missing the required parameter 'patternWithoutDelimiter' when calling testEndpointParameters"); } // verify the required parameter '_byte' is set if (_byte == undefined || _byte == null) { - throw "Missing the required parameter '_byte' when calling testEndpointParameters"; + throw new Error("Missing the required parameter '_byte' when calling testEndpointParameters"); } @@ -156,7 +157,8 @@ 'binary': opts['binary'], 'date': opts['_date'], 'dateTime': opts['dateTime'], - 'password': opts['password'] + 'password': opts['password'], + 'callback': opts['callback'] }; var authNames = ['http_basic_test']; diff --git a/samples/client/petstore/javascript-promise/src/api/PetApi.js b/samples/client/petstore/javascript-promise/src/api/PetApi.js index 203b31905ed..d752a612bba 100644 --- a/samples/client/petstore/javascript-promise/src/api/PetApi.js +++ b/samples/client/petstore/javascript-promise/src/api/PetApi.js @@ -68,7 +68,7 @@ // verify the required parameter 'body' is set if (body == undefined || body == null) { - throw "Missing the required parameter 'body' when calling addPet"; + throw new Error("Missing the required parameter 'body' when calling addPet"); } @@ -108,7 +108,7 @@ // verify the required parameter 'petId' is set if (petId == undefined || petId == null) { - throw "Missing the required parameter 'petId' when calling deletePet"; + throw new Error("Missing the required parameter 'petId' when calling deletePet"); } @@ -147,7 +147,7 @@ // verify the required parameter 'status' is set if (status == undefined || status == null) { - throw "Missing the required parameter 'status' when calling findPetsByStatus"; + throw new Error("Missing the required parameter 'status' when calling findPetsByStatus"); } @@ -185,7 +185,7 @@ // verify the required parameter 'tags' is set if (tags == undefined || tags == null) { - throw "Missing the required parameter 'tags' when calling findPetsByTags"; + throw new Error("Missing the required parameter 'tags' when calling findPetsByTags"); } @@ -223,7 +223,7 @@ // verify the required parameter 'petId' is set if (petId == undefined || petId == null) { - throw "Missing the required parameter 'petId' when calling getPetById"; + throw new Error("Missing the required parameter 'petId' when calling getPetById"); } @@ -261,7 +261,7 @@ // verify the required parameter 'body' is set if (body == undefined || body == null) { - throw "Missing the required parameter 'body' when calling updatePet"; + throw new Error("Missing the required parameter 'body' when calling updatePet"); } @@ -302,7 +302,7 @@ // verify the required parameter 'petId' is set if (petId == undefined || petId == null) { - throw "Missing the required parameter 'petId' when calling updatePetWithForm"; + throw new Error("Missing the required parameter 'petId' when calling updatePetWithForm"); } @@ -346,7 +346,7 @@ // verify the required parameter 'petId' is set if (petId == undefined || petId == null) { - throw "Missing the required parameter 'petId' when calling uploadFile"; + throw new Error("Missing the required parameter 'petId' when calling uploadFile"); } diff --git a/samples/client/petstore/javascript-promise/src/api/StoreApi.js b/samples/client/petstore/javascript-promise/src/api/StoreApi.js index b184af1058e..5053b8a708c 100644 --- a/samples/client/petstore/javascript-promise/src/api/StoreApi.js +++ b/samples/client/petstore/javascript-promise/src/api/StoreApi.js @@ -68,7 +68,7 @@ // verify the required parameter 'orderId' is set if (orderId == undefined || orderId == null) { - throw "Missing the required parameter 'orderId' when calling deleteOrder"; + throw new Error("Missing the required parameter 'orderId' when calling deleteOrder"); } @@ -137,7 +137,7 @@ // verify the required parameter 'orderId' is set if (orderId == undefined || orderId == null) { - throw "Missing the required parameter 'orderId' when calling getOrderById"; + throw new Error("Missing the required parameter 'orderId' when calling getOrderById"); } @@ -175,7 +175,7 @@ // verify the required parameter 'body' is set if (body == undefined || body == null) { - throw "Missing the required parameter 'body' when calling placeOrder"; + throw new Error("Missing the required parameter 'body' when calling placeOrder"); } diff --git a/samples/client/petstore/javascript-promise/src/api/UserApi.js b/samples/client/petstore/javascript-promise/src/api/UserApi.js index 9186f84e2df..4e66740bd23 100644 --- a/samples/client/petstore/javascript-promise/src/api/UserApi.js +++ b/samples/client/petstore/javascript-promise/src/api/UserApi.js @@ -68,7 +68,7 @@ // verify the required parameter 'body' is set if (body == undefined || body == null) { - throw "Missing the required parameter 'body' when calling createUser"; + throw new Error("Missing the required parameter 'body' when calling createUser"); } @@ -105,7 +105,7 @@ // verify the required parameter 'body' is set if (body == undefined || body == null) { - throw "Missing the required parameter 'body' when calling createUsersWithArrayInput"; + throw new Error("Missing the required parameter 'body' when calling createUsersWithArrayInput"); } @@ -142,7 +142,7 @@ // verify the required parameter 'body' is set if (body == undefined || body == null) { - throw "Missing the required parameter 'body' when calling createUsersWithListInput"; + throw new Error("Missing the required parameter 'body' when calling createUsersWithListInput"); } @@ -179,7 +179,7 @@ // verify the required parameter 'username' is set if (username == undefined || username == null) { - throw "Missing the required parameter 'username' when calling deleteUser"; + throw new Error("Missing the required parameter 'username' when calling deleteUser"); } @@ -217,7 +217,7 @@ // verify the required parameter 'username' is set if (username == undefined || username == null) { - throw "Missing the required parameter 'username' when calling getUserByName"; + throw new Error("Missing the required parameter 'username' when calling getUserByName"); } @@ -256,12 +256,12 @@ // verify the required parameter 'username' is set if (username == undefined || username == null) { - throw "Missing the required parameter 'username' when calling loginUser"; + throw new Error("Missing the required parameter 'username' when calling loginUser"); } // verify the required parameter 'password' is set if (password == undefined || password == null) { - throw "Missing the required parameter 'password' when calling loginUser"; + throw new Error("Missing the required parameter 'password' when calling loginUser"); } @@ -332,12 +332,12 @@ // verify the required parameter 'username' is set if (username == undefined || username == null) { - throw "Missing the required parameter 'username' when calling updateUser"; + throw new Error("Missing the required parameter 'username' when calling updateUser"); } // verify the required parameter 'body' is set if (body == undefined || body == null) { - throw "Missing the required parameter 'body' when calling updateUser"; + throw new Error("Missing the required parameter 'body' when calling updateUser"); } diff --git a/samples/client/petstore/javascript/src/api/FakeApi.js b/samples/client/petstore/javascript/src/api/FakeApi.js index edda32926dc..04363a01688 100644 --- a/samples/client/petstore/javascript/src/api/FakeApi.js +++ b/samples/client/petstore/javascript/src/api/FakeApi.js @@ -75,7 +75,7 @@ // verify the required parameter 'body' is set if (body == undefined || body == null) { - throw "Missing the required parameter 'body' when calling testClientModel"; + throw new Error("Missing the required parameter 'body' when calling testClientModel"); } @@ -134,22 +134,22 @@ // verify the required parameter '_number' is set if (_number == undefined || _number == null) { - throw "Missing the required parameter '_number' when calling testEndpointParameters"; + throw new Error("Missing the required parameter '_number' when calling testEndpointParameters"); } // verify the required parameter '_double' is set if (_double == undefined || _double == null) { - throw "Missing the required parameter '_double' when calling testEndpointParameters"; + throw new Error("Missing the required parameter '_double' when calling testEndpointParameters"); } // verify the required parameter 'patternWithoutDelimiter' is set if (patternWithoutDelimiter == undefined || patternWithoutDelimiter == null) { - throw "Missing the required parameter 'patternWithoutDelimiter' when calling testEndpointParameters"; + throw new Error("Missing the required parameter 'patternWithoutDelimiter' when calling testEndpointParameters"); } // verify the required parameter '_byte' is set if (_byte == undefined || _byte == null) { - throw "Missing the required parameter '_byte' when calling testEndpointParameters"; + throw new Error("Missing the required parameter '_byte' when calling testEndpointParameters"); } diff --git a/samples/client/petstore/javascript/src/api/PetApi.js b/samples/client/petstore/javascript/src/api/PetApi.js index aae8c9844d0..158e3d3e84d 100644 --- a/samples/client/petstore/javascript/src/api/PetApi.js +++ b/samples/client/petstore/javascript/src/api/PetApi.js @@ -75,7 +75,7 @@ // verify the required parameter 'body' is set if (body == undefined || body == null) { - throw "Missing the required parameter 'body' when calling addPet"; + throw new Error("Missing the required parameter 'body' when calling addPet"); } @@ -122,7 +122,7 @@ // verify the required parameter 'petId' is set if (petId == undefined || petId == null) { - throw "Missing the required parameter 'petId' when calling deletePet"; + throw new Error("Missing the required parameter 'petId' when calling deletePet"); } @@ -169,7 +169,7 @@ // verify the required parameter 'status' is set if (status == undefined || status == null) { - throw "Missing the required parameter 'status' when calling findPetsByStatus"; + throw new Error("Missing the required parameter 'status' when calling findPetsByStatus"); } @@ -215,7 +215,7 @@ // verify the required parameter 'tags' is set if (tags == undefined || tags == null) { - throw "Missing the required parameter 'tags' when calling findPetsByTags"; + throw new Error("Missing the required parameter 'tags' when calling findPetsByTags"); } @@ -261,7 +261,7 @@ // verify the required parameter 'petId' is set if (petId == undefined || petId == null) { - throw "Missing the required parameter 'petId' when calling getPetById"; + throw new Error("Missing the required parameter 'petId' when calling getPetById"); } @@ -306,7 +306,7 @@ // verify the required parameter 'body' is set if (body == undefined || body == null) { - throw "Missing the required parameter 'body' when calling updatePet"; + throw new Error("Missing the required parameter 'body' when calling updatePet"); } @@ -354,7 +354,7 @@ // verify the required parameter 'petId' is set if (petId == undefined || petId == null) { - throw "Missing the required parameter 'petId' when calling updatePetWithForm"; + throw new Error("Missing the required parameter 'petId' when calling updatePetWithForm"); } @@ -406,7 +406,7 @@ // verify the required parameter 'petId' is set if (petId == undefined || petId == null) { - throw "Missing the required parameter 'petId' when calling uploadFile"; + throw new Error("Missing the required parameter 'petId' when calling uploadFile"); } diff --git a/samples/client/petstore/javascript/src/api/StoreApi.js b/samples/client/petstore/javascript/src/api/StoreApi.js index 5290e1bec0f..98149910aff 100644 --- a/samples/client/petstore/javascript/src/api/StoreApi.js +++ b/samples/client/petstore/javascript/src/api/StoreApi.js @@ -75,7 +75,7 @@ // verify the required parameter 'orderId' is set if (orderId == undefined || orderId == null) { - throw "Missing the required parameter 'orderId' when calling deleteOrder"; + throw new Error("Missing the required parameter 'orderId' when calling deleteOrder"); } @@ -160,7 +160,7 @@ // verify the required parameter 'orderId' is set if (orderId == undefined || orderId == null) { - throw "Missing the required parameter 'orderId' when calling getOrderById"; + throw new Error("Missing the required parameter 'orderId' when calling getOrderById"); } @@ -206,7 +206,7 @@ // verify the required parameter 'body' is set if (body == undefined || body == null) { - throw "Missing the required parameter 'body' when calling placeOrder"; + throw new Error("Missing the required parameter 'body' when calling placeOrder"); } diff --git a/samples/client/petstore/javascript/src/api/UserApi.js b/samples/client/petstore/javascript/src/api/UserApi.js index b5234f1881b..a63968da0e9 100644 --- a/samples/client/petstore/javascript/src/api/UserApi.js +++ b/samples/client/petstore/javascript/src/api/UserApi.js @@ -75,7 +75,7 @@ // verify the required parameter 'body' is set if (body == undefined || body == null) { - throw "Missing the required parameter 'body' when calling createUser"; + throw new Error("Missing the required parameter 'body' when calling createUser"); } @@ -119,7 +119,7 @@ // verify the required parameter 'body' is set if (body == undefined || body == null) { - throw "Missing the required parameter 'body' when calling createUsersWithArrayInput"; + throw new Error("Missing the required parameter 'body' when calling createUsersWithArrayInput"); } @@ -163,7 +163,7 @@ // verify the required parameter 'body' is set if (body == undefined || body == null) { - throw "Missing the required parameter 'body' when calling createUsersWithListInput"; + throw new Error("Missing the required parameter 'body' when calling createUsersWithListInput"); } @@ -207,7 +207,7 @@ // verify the required parameter 'username' is set if (username == undefined || username == null) { - throw "Missing the required parameter 'username' when calling deleteUser"; + throw new Error("Missing the required parameter 'username' when calling deleteUser"); } @@ -253,7 +253,7 @@ // verify the required parameter 'username' is set if (username == undefined || username == null) { - throw "Missing the required parameter 'username' when calling getUserByName"; + throw new Error("Missing the required parameter 'username' when calling getUserByName"); } @@ -300,12 +300,12 @@ // verify the required parameter 'username' is set if (username == undefined || username == null) { - throw "Missing the required parameter 'username' when calling loginUser"; + throw new Error("Missing the required parameter 'username' when calling loginUser"); } // verify the required parameter 'password' is set if (password == undefined || password == null) { - throw "Missing the required parameter 'password' when calling loginUser"; + throw new Error("Missing the required parameter 'password' when calling loginUser"); } @@ -390,12 +390,12 @@ // verify the required parameter 'username' is set if (username == undefined || username == null) { - throw "Missing the required parameter 'username' when calling updateUser"; + throw new Error("Missing the required parameter 'username' when calling updateUser"); } // verify the required parameter 'body' is set if (body == undefined || body == null) { - throw "Missing the required parameter 'body' when calling updateUser"; + throw new Error("Missing the required parameter 'body' when calling updateUser"); }