From 85d05981ecb15c0bd22cfed1004d54e63b35a0a0 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Thu, 11 Apr 2019 23:30:00 +0800 Subject: [PATCH] Unescape HTML characters in JS docstring (#2636) * unescape html characters in JS docstring * better codee format --- .../main/resources/Javascript/api.mustache | 36 ++++++------ .../resources/Javascript/es6/api.mustache | 32 +++++------ .../javascript-es6/src/api/FakeApi.js | 14 ++--- .../javascript-es6/src/api/StoreApi.js | 4 +- .../javascript-promise-es6/src/api/FakeApi.js | 28 +++++----- .../src/api/StoreApi.js | 8 +-- .../src/api/AnotherFakeApi.js | 2 - .../javascript-promise/src/api/FakeApi.js | 56 +++++-------------- .../src/api/FakeClassnameTags123Api.js | 2 - .../javascript-promise/src/api/PetApi.js | 19 ------- .../javascript-promise/src/api/StoreApi.js | 15 ++--- .../javascript-promise/src/api/UserApi.js | 17 ------ .../javascript/src/api/AnotherFakeApi.js | 2 - .../petstore/javascript/src/api/FakeApi.js | 42 +++----------- .../src/api/FakeClassnameTags123Api.js | 2 - .../petstore/javascript/src/api/PetApi.js | 19 ------- .../petstore/javascript/src/api/StoreApi.js | 11 +--- .../petstore/javascript/src/api/UserApi.js | 17 ------ 18 files changed, 89 insertions(+), 237 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/Javascript/api.mustache b/modules/openapi-generator/src/main/resources/Javascript/api.mustache index ded4de021cc..6aaef50fa1e 100644 --- a/modules/openapi-generator/src/main/resources/Javascript/api.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript/api.mustache @@ -2,7 +2,7 @@ {{=< >=}}(function(root, factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. - define(['<#invokerPackage><&invokerPackage>/ApiClient'<#imports>, '<#invokerPackage><&invokerPackage>/<#modelPackage><&modelPackage>/'], factory); + define(['<#invokerPackage><&invokerPackage>/ApiClient'<#imports>, '<#invokerPackage><&invokerPackage>/<#modelPackage><&modelPackage>/<&import>'], factory); } else if (typeof module === 'object' && module.exports) { // CommonJS-like environments that support module.exports, like Node. module.exports = factory(require('../ApiClient')<#imports>, require('../<#modelPackage><&modelPackage>/')); @@ -13,19 +13,19 @@ } root.<&moduleName>.<&classname> = factory(root.<&moduleName>.ApiClient<#imports>, root.<&moduleName>.); } -}(this, function(ApiClient<#imports>, ) { +}(this, function(ApiClient<#imports>, <&import>) { 'use strict'; <#emitJSDoc> /** * service. - * @module <#invokerPackage><&invokerPackage>/<#apiPackage><&apiPackage>/ + * @module <#invokerPackage><&invokerPackage>/<#apiPackage><&apiPackage>/<&classname> * @version */ /** * Constructs a new <&classname>. <#description> - * - * @alias module:<#invokerPackage><&invokerPackage>/<#apiPackage>/ + * <&description> + * @alias module:<#invokerPackage><&invokerPackage>/<#apiPackage><&apiPackage>/<&classname> * @class * @param {module:<#invokerPackage><&invokerPackage>/ApiClient} [apiClient] Optional API client implementation to use, * default to {@link module:<#invokerPackage><&invokerPackage>/ApiClient#instance} if unspecified. @@ -43,24 +43,26 @@ */ /**<#summary> - * <#notes> - * <#allParams><#required> - * @param {<&vendorExtensions.x-jsdoc-type>} <#hasOptionalParams> + * <&summary><#notes> + * <¬es><#allParams><#required> + * @param {<&vendorExtensions.x-jsdoc-type>} <¶mName> <&description><#hasOptionalParams> * @param {Object} opts Optional parameters<#allParams><^required> - * @param {<&vendorExtensions.x-jsdoc-type>} opts. <#defaultValue> (default to <.>)<^usePromises> - * @param {module:<#invokerPackage><&invokerPackage>/<#apiPackage><&apiPackage>/<&classname>~Callback} callback The callback function, accepting three arguments: error, data, response<#returnType> + * @param {<&vendorExtensions.x-jsdoc-type>} opts.<¶mName> <&description><#defaultValue> (default to <&.>)<^usePromises> + * @param {module:<#invokerPackage><&invokerPackage>/<#apiPackage><&apiPackage>/<&classname>~<&operationId>Callback} callback The callback function, accepting three arguments: error, data, response<#returnType> * data is of type: {@link <&vendorExtensions.x-jsdoc-type>}<#usePromises> * @return {Promise} a {@link https://www.promisejs.org/|Promise}<#returnType>, with an object containing data of type {@link <&vendorExtensions.x-jsdoc-type>} and HTTP response<^returnType>, with an object containing HTTP response */ this.<#usePromises>WithHttpInfo = function() {<#hasOptionalParams> opts = opts || {}; var postBody = <#bodyParam><#required><^required>opts['']<^bodyParam>null; -<#allParams><#required> +<#allParams> +<#required> // verify the required parameter '' is set if ( === undefined || === null) { throw new Error("Missing the required parameter '' when calling "); } - + + var pathParams = {<#pathParams> '': <#required><^required>opts['']<#hasMore>, @@ -106,12 +108,12 @@ <#emitJSDoc> /**<#summary> - * <#notes> - * <#allParams><#required> - * @param {<&vendorExtensions.x-jsdoc-type>} <#hasOptionalParams> + * <&summary><#notes> + * <¬es><#allParams><#required> + * @param {<&vendorExtensions.x-jsdoc-type>} <¶mName> <&description><#hasOptionalParams> * @param {Object} opts Optional parameters<#allParams><^required> - * @param {<&vendorExtensions.x-jsdoc-type>} opts. <#defaultValue> (default to <.>)<^usePromises> - * @param {module:<#invokerPackage><&invokerPackage>/<#apiPackage><&apiPackage>/<&classname>~Callback} callback The callback function, accepting three arguments: error, data, response<#returnType> + * @param {<&vendorExtensions.x-jsdoc-type>} opts.<¶mName> <&description><#defaultValue> (default to <&.>)<^usePromises> + * @param {module:<#invokerPackage><&invokerPackage>/<#apiPackage><&apiPackage>/<&classname>~<&operationId>Callback} callback The callback function, accepting three arguments: error, data, response<#returnType> * data is of type: {@link <&vendorExtensions.x-jsdoc-type>}<#usePromises> * @return {Promise} a {@link https://www.promisejs.org/|Promise}<#returnType>, with data of type {@link <&vendorExtensions.x-jsdoc-type>} */ diff --git a/modules/openapi-generator/src/main/resources/Javascript/es6/api.mustache b/modules/openapi-generator/src/main/resources/Javascript/es6/api.mustache index 7429aa2b03b..c9a61734adc 100644 --- a/modules/openapi-generator/src/main/resources/Javascript/es6/api.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript/es6/api.mustache @@ -2,20 +2,20 @@ {{=< >=}} import ApiClient from "../ApiClient"; -<#imports>import from '../<#modelPackage><&modelPackage>/'; +<#imports>import <&import> from '../<#modelPackage><&modelPackage>/'; <#emitJSDoc>/** * service. * @module <#invokerPackage><&invokerPackage>/<#apiPackage><&apiPackage>/ -* @version +* @version <&projectVersion> */ -export default class { +export default class <&classname> { <#emitJSDoc>/** * Constructs a new <&classname>. <#description> * - * @alias module:<#invokerPackage><&invokerPackage>/<#apiPackage>/ + * @alias module:<#invokerPackage><&invokerPackage>/<#apiPackage><&apiPackage>/ * @class * @param {module:<#invokerPackage><&invokerPackage>/ApiClient} [apiClient] Optional API client implementation to use, * default to {@link module:<#invokerPackage><&invokerPackage>/ApiClient#instance} if unspecified. @@ -26,20 +26,20 @@ export default class { <#operations><#operation><#emitJSDoc><^usePromises> /** - * Callback function to receive the result of the operation. - * @callback module:<#invokerPackage>/<#apiPackage>/~Callback + * Callback function to receive the result of the <&operationId> operation. + * @callback module:<#invokerPackage><&invokerPackage>/<#apiPackage><&apiPackage>/<&classname>~<&operationId>Callback * @param {String} error Error message, if any. * @param <#vendorExtensions.x-jsdoc-type>{<&vendorExtensions.x-jsdoc-type>} data The data returned by the service call.<^vendorExtensions.x-jsdoc-type>data This operation does not return a value. * @param {String} response The complete HTTP response. */ /**<#summary> - * <#notes> - * <#allParams><#required> - * @param {<&vendorExtensions.x-jsdoc-type>} <#hasOptionalParams> + * <&summary><#notes> + * <¬es><#allParams><#required> + * @param {<&vendorExtensions.x-jsdoc-type>} <¶mName> <&description><#hasOptionalParams> * @param {Object} opts Optional parameters<#allParams><^required> - * @param {<&vendorExtensions.x-jsdoc-type>} opts. <#defaultValue> (default to <.>)<^usePromises> - * @param {module:<#invokerPackage><&invokerPackage>/<#apiPackage><&apiPackage>/<&classname>~Callback} callback The callback function, accepting three arguments: error, data, response<#returnType> + * @param {<&vendorExtensions.x-jsdoc-type>} opts.<¶mName> <&description><#defaultValue> (default to <&.>)<^usePromises> + * @param {module:<#invokerPackage><&invokerPackage>/<#apiPackage><&apiPackage>/<&classname>~<&operationId>Callback} callback The callback function, accepting three arguments: error, data, response<#returnType> * data is of type: {@link <&vendorExtensions.x-jsdoc-type>}<#usePromises> * @return {Promise} a {@link https://www.promisejs.org/|Promise}<#returnType>, with an object containing data of type {@link <&vendorExtensions.x-jsdoc-type>} and HTTP response<^returnType>, with an object containing HTTP response */ @@ -95,12 +95,12 @@ export default class { <#emitJSDoc> /**<#summary> - * <#notes> - * <#allParams><#required> - * @param {<&vendorExtensions.x-jsdoc-type>} <#hasOptionalParams> + * <&summary><#notes> + * <¬es><#allParams><#required> + * @param {<&vendorExtensions.x-jsdoc-type>} <¶mName> <&description><#hasOptionalParams> * @param {Object} opts Optional parameters<#allParams><^required> - * @param {<&vendorExtensions.x-jsdoc-type>} opts. <#defaultValue> (default to <.>)<^usePromises> - * @param {module:<#invokerPackage><&invokerPackage>/<#apiPackage><&apiPackage>/<&classname>~Callback} callback The callback function, accepting three arguments: error, data, response<#returnType> + * @param {<&vendorExtensions.x-jsdoc-type>} opts.<¶mName> <&description><#defaultValue> (default to <&.>)<^usePromises> + * @param {module:<#invokerPackage><&invokerPackage>/<#apiPackage><&apiPackage>/<&classname>~<&operationId>Callback} callback The callback function, accepting three arguments: error, data, response<#returnType> * data is of type: {@link <&vendorExtensions.x-jsdoc-type>}<#usePromises> * @return {Promise} a {@link https://www.promisejs.org/|Promise}<#returnType>, with data of type {@link <&vendorExtensions.x-jsdoc-type>} */ diff --git a/samples/client/petstore/javascript-es6/src/api/FakeApi.js b/samples/client/petstore/javascript-es6/src/api/FakeApi.js index f1afb6a147f..a5d40e4fefa 100644 --- a/samples/client/petstore/javascript-es6/src/api/FakeApi.js +++ b/samples/client/petstore/javascript-es6/src/api/FakeApi.js @@ -244,7 +244,7 @@ export default class FakeApi { */ /** - * For this test, the body for this request much reference a schema named `File`. + * For this test, the body for this request much reference a schema named `File`. * @param {module:model/FileSchemaTestClass} body * @param {module:api/FakeApi~testBodyWithFileSchemaCallback} callback The callback function, accepting three arguments: error, data, response */ @@ -329,8 +329,8 @@ export default class FakeApi { */ /** - * To test \"client\" model - * To test \"client\" model + * To test \"client\" model + * To test \"client\" model * @param {module:model/Client} body client model * @param {module:api/FakeApi~testClientModelCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link module:model/Client} @@ -457,13 +457,13 @@ export default class FakeApi { * To test enum parameters * @param {Object} opts Optional parameters * @param {Array.} opts.enumHeaderStringArray Header parameter enum test (string array) - * @param {module:model/String} opts.enumHeaderString Header parameter enum test (string) (default to '-efg') + * @param {module:model/String} opts.enumHeaderString Header parameter enum test (string) (default to '-efg') * @param {Array.} opts.enumQueryStringArray Query parameter enum test (string array) - * @param {module:model/String} opts.enumQueryString Query parameter enum test (string) (default to '-efg') + * @param {module:model/String} opts.enumQueryString Query parameter enum test (string) (default to '-efg') * @param {module:model/Number} opts.enumQueryInteger Query parameter enum test (double) * @param {module:model/Number} opts.enumQueryDouble Query parameter enum test (double) - * @param {Array.} opts.enumFormStringArray Form parameter enum test (string array) (default to '$') - * @param {module:model/String} opts.enumFormString Form parameter enum test (string) (default to '-efg') + * @param {Array.} opts.enumFormStringArray Form parameter enum test (string array) (default to '$') + * @param {module:model/String} opts.enumFormString Form parameter enum test (string) (default to '-efg') * @param {module:api/FakeApi~testEnumParametersCallback} callback The callback function, accepting three arguments: error, data, response */ testEnumParameters(opts, callback) { diff --git a/samples/client/petstore/javascript-es6/src/api/StoreApi.js b/samples/client/petstore/javascript-es6/src/api/StoreApi.js index ef0411961b0..5c8f3e8a681 100644 --- a/samples/client/petstore/javascript-es6/src/api/StoreApi.js +++ b/samples/client/petstore/javascript-es6/src/api/StoreApi.js @@ -44,7 +44,7 @@ export default class StoreApi { /** * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param {String} orderId ID of the order that needs to be deleted * @param {module:api/StoreApi~deleteOrderCallback} callback The callback function, accepting three arguments: error, data, response */ @@ -123,7 +123,7 @@ export default class StoreApi { /** * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param {Number} orderId ID of pet that needs to be fetched * @param {module:api/StoreApi~getOrderByIdCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link module:model/Order} diff --git a/samples/client/petstore/javascript-promise-es6/src/api/FakeApi.js b/samples/client/petstore/javascript-promise-es6/src/api/FakeApi.js index 8016a00c62b..7febf0addd6 100644 --- a/samples/client/petstore/javascript-promise-es6/src/api/FakeApi.js +++ b/samples/client/petstore/javascript-promise-es6/src/api/FakeApi.js @@ -263,7 +263,7 @@ export default class FakeApi { /** - * For this test, the body for this request much reference a schema named `File`. + * For this test, the body for this request much reference a schema named `File`. * @param {module:model/FileSchemaTestClass} body * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response */ @@ -295,7 +295,7 @@ export default class FakeApi { } /** - * For this test, the body for this request much reference a schema named `File`. + * For this test, the body for this request much reference a schema named `File`. * @param {module:model/FileSchemaTestClass} body * @return {Promise} a {@link https://www.promisejs.org/|Promise} */ @@ -358,8 +358,8 @@ export default class FakeApi { /** - * To test \"client\" model - * To test \"client\" model + * To test \"client\" model + * To test \"client\" model * @param {module:model/Client} body client model * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Client} and HTTP response */ @@ -391,8 +391,8 @@ export default class FakeApi { } /** - * To test \"client\" model - * To test \"client\" model + * To test \"client\" model + * To test \"client\" model * @param {module:model/Client} body client model * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Client} */ @@ -511,13 +511,13 @@ export default class FakeApi { * To test enum parameters * @param {Object} opts Optional parameters * @param {Array.} opts.enumHeaderStringArray Header parameter enum test (string array) - * @param {module:model/String} opts.enumHeaderString Header parameter enum test (string) (default to '-efg') + * @param {module:model/String} opts.enumHeaderString Header parameter enum test (string) (default to '-efg') * @param {Array.} opts.enumQueryStringArray Query parameter enum test (string array) - * @param {module:model/String} opts.enumQueryString Query parameter enum test (string) (default to '-efg') + * @param {module:model/String} opts.enumQueryString Query parameter enum test (string) (default to '-efg') * @param {module:model/Number} opts.enumQueryInteger Query parameter enum test (double) * @param {module:model/Number} opts.enumQueryDouble Query parameter enum test (double) - * @param {Array.} opts.enumFormStringArray Form parameter enum test (string array) (default to '$') - * @param {module:model/String} opts.enumFormString Form parameter enum test (string) (default to '-efg') + * @param {Array.} opts.enumFormStringArray Form parameter enum test (string array) (default to '$') + * @param {module:model/String} opts.enumFormString Form parameter enum test (string) (default to '-efg') * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response */ testEnumParametersWithHttpInfo(opts) { @@ -557,13 +557,13 @@ export default class FakeApi { * To test enum parameters * @param {Object} opts Optional parameters * @param {Array.} opts.enumHeaderStringArray Header parameter enum test (string array) - * @param {module:model/String} opts.enumHeaderString Header parameter enum test (string) (default to '-efg') + * @param {module:model/String} opts.enumHeaderString Header parameter enum test (string) (default to '-efg') * @param {Array.} opts.enumQueryStringArray Query parameter enum test (string array) - * @param {module:model/String} opts.enumQueryString Query parameter enum test (string) (default to '-efg') + * @param {module:model/String} opts.enumQueryString Query parameter enum test (string) (default to '-efg') * @param {module:model/Number} opts.enumQueryInteger Query parameter enum test (double) * @param {module:model/Number} opts.enumQueryDouble Query parameter enum test (double) - * @param {Array.} opts.enumFormStringArray Form parameter enum test (string array) (default to '$') - * @param {module:model/String} opts.enumFormString Form parameter enum test (string) (default to '-efg') + * @param {Array.} opts.enumFormStringArray Form parameter enum test (string array) (default to '$') + * @param {module:model/String} opts.enumFormString Form parameter enum test (string) (default to '-efg') * @return {Promise} a {@link https://www.promisejs.org/|Promise} */ testEnumParameters(opts) { diff --git a/samples/client/petstore/javascript-promise-es6/src/api/StoreApi.js b/samples/client/petstore/javascript-promise-es6/src/api/StoreApi.js index 8b9ac6a0e57..9556d3e152c 100644 --- a/samples/client/petstore/javascript-promise-es6/src/api/StoreApi.js +++ b/samples/client/petstore/javascript-promise-es6/src/api/StoreApi.js @@ -37,7 +37,7 @@ export default class StoreApi { /** * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param {String} orderId ID of the order that needs to be deleted * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response */ @@ -71,7 +71,7 @@ export default class StoreApi { /** * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param {String} orderId ID of the order that needs to be deleted * @return {Promise} a {@link https://www.promisejs.org/|Promise} */ @@ -126,7 +126,7 @@ export default class StoreApi { /** * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param {Number} orderId ID of pet that needs to be fetched * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Order} and HTTP response */ @@ -160,7 +160,7 @@ export default class StoreApi { /** * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param {Number} orderId ID of pet that needs to be fetched * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Order} */ diff --git a/samples/client/petstore/javascript-promise/src/api/AnotherFakeApi.js b/samples/client/petstore/javascript-promise/src/api/AnotherFakeApi.js index 3f6208cc6cc..8732143a6ac 100644 --- a/samples/client/petstore/javascript-promise/src/api/AnotherFakeApi.js +++ b/samples/client/petstore/javascript-promise/src/api/AnotherFakeApi.js @@ -56,13 +56,11 @@ */ this.call123testSpecialTagsWithHttpInfo = function(body) { var postBody = body; - // verify the required parameter 'body' is set if (body === undefined || body === null) { throw new Error("Missing the required parameter 'body' when calling call123testSpecialTags"); } - var pathParams = { }; var queryParams = { diff --git a/samples/client/petstore/javascript-promise/src/api/FakeApi.js b/samples/client/petstore/javascript-promise/src/api/FakeApi.js index 3af077df9ce..10c75740181 100644 --- a/samples/client/petstore/javascript-promise/src/api/FakeApi.js +++ b/samples/client/petstore/javascript-promise/src/api/FakeApi.js @@ -56,13 +56,11 @@ */ this.createXmlItemWithHttpInfo = function(xmlItem) { var postBody = xmlItem; - // verify the required parameter 'xmlItem' is set if (xmlItem === undefined || xmlItem === null) { throw new Error("Missing the required parameter 'xmlItem' when calling createXmlItem"); } - var pathParams = { }; var queryParams = { @@ -109,7 +107,6 @@ opts = opts || {}; var postBody = opts['body']; - var pathParams = { }; var queryParams = { @@ -156,7 +153,6 @@ opts = opts || {}; var postBody = opts['body']; - var pathParams = { }; var queryParams = { @@ -203,7 +199,6 @@ opts = opts || {}; var postBody = opts['body']; - var pathParams = { }; var queryParams = { @@ -250,7 +245,6 @@ opts = opts || {}; var postBody = opts['body']; - var pathParams = { }; var queryParams = { @@ -288,19 +282,17 @@ /** - * For this test, the body for this request much reference a schema named `File`. + * For this test, the body for this request much reference a schema named `File`. * @param {module:model/FileSchemaTestClass} body * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response */ this.testBodyWithFileSchemaWithHttpInfo = function(body) { var postBody = body; - // verify the required parameter 'body' is set if (body === undefined || body === null) { throw new Error("Missing the required parameter 'body' when calling testBodyWithFileSchema"); } - var pathParams = { }; var queryParams = { @@ -324,7 +316,7 @@ } /** - * For this test, the body for this request much reference a schema named `File`. + * For this test, the body for this request much reference a schema named `File`. * @param {module:model/FileSchemaTestClass} body * @return {Promise} a {@link https://www.promisejs.org/|Promise} */ @@ -343,18 +335,15 @@ */ this.testBodyWithQueryParamsWithHttpInfo = function(query, body) { var postBody = body; - // verify the required parameter 'query' is set if (query === undefined || query === null) { throw new Error("Missing the required parameter 'query' when calling testBodyWithQueryParams"); } - // verify the required parameter 'body' is set if (body === undefined || body === null) { throw new Error("Missing the required parameter 'body' when calling testBodyWithQueryParams"); } - var pathParams = { }; var queryParams = { @@ -392,20 +381,18 @@ /** - * To test \"client\" model - * To test \"client\" model + * To test \"client\" model + * To test \"client\" model * @param {module:model/Client} body client model * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Client} and HTTP response */ this.testClientModelWithHttpInfo = function(body) { var postBody = body; - // verify the required parameter 'body' is set if (body === undefined || body === null) { throw new Error("Missing the required parameter 'body' when calling testClientModel"); } - var pathParams = { }; var queryParams = { @@ -429,8 +416,8 @@ } /** - * To test \"client\" model - * To test \"client\" model + * To test \"client\" model + * To test \"client\" model * @param {module:model/Client} body client model * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Client} */ @@ -465,28 +452,23 @@ this.testEndpointParametersWithHttpInfo = function(_number, _double, patternWithoutDelimiter, _byte, opts) { opts = opts || {}; var postBody = null; - // verify the required parameter '_number' is set if (_number === undefined || _number === null) { throw new Error("Missing the required parameter '_number' when calling testEndpointParameters"); } - // verify the required parameter '_double' is set if (_double === undefined || _double === null) { throw new Error("Missing the required parameter '_double' when calling testEndpointParameters"); } - // verify the required parameter 'patternWithoutDelimiter' is set if (patternWithoutDelimiter === undefined || patternWithoutDelimiter === null) { throw new Error("Missing the required parameter 'patternWithoutDelimiter' when calling testEndpointParameters"); } - // verify the required parameter '_byte' is set if (_byte === undefined || _byte === null) { throw new Error("Missing the required parameter '_byte' when calling testEndpointParameters"); } - var pathParams = { }; var queryParams = { @@ -556,20 +538,19 @@ * To test enum parameters * @param {Object} opts Optional parameters * @param {Array.} opts.enumHeaderStringArray Header parameter enum test (string array) - * @param {module:model/String} opts.enumHeaderString Header parameter enum test (string) (default to '-efg') + * @param {module:model/String} opts.enumHeaderString Header parameter enum test (string) (default to '-efg') * @param {Array.} opts.enumQueryStringArray Query parameter enum test (string array) - * @param {module:model/String} opts.enumQueryString Query parameter enum test (string) (default to '-efg') + * @param {module:model/String} opts.enumQueryString Query parameter enum test (string) (default to '-efg') * @param {module:model/Number} opts.enumQueryInteger Query parameter enum test (double) * @param {module:model/Number} opts.enumQueryDouble Query parameter enum test (double) - * @param {Array.} opts.enumFormStringArray Form parameter enum test (string array) (default to '$') - * @param {module:model/String} opts.enumFormString Form parameter enum test (string) (default to '-efg') + * @param {Array.} opts.enumFormStringArray Form parameter enum test (string array) (default to '$') + * @param {module:model/String} opts.enumFormString Form parameter enum test (string) (default to '-efg') * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response */ this.testEnumParametersWithHttpInfo = function(opts) { opts = opts || {}; var postBody = null; - var pathParams = { }; var queryParams = { @@ -608,13 +589,13 @@ * To test enum parameters * @param {Object} opts Optional parameters * @param {Array.} opts.enumHeaderStringArray Header parameter enum test (string array) - * @param {module:model/String} opts.enumHeaderString Header parameter enum test (string) (default to '-efg') + * @param {module:model/String} opts.enumHeaderString Header parameter enum test (string) (default to '-efg') * @param {Array.} opts.enumQueryStringArray Query parameter enum test (string array) - * @param {module:model/String} opts.enumQueryString Query parameter enum test (string) (default to '-efg') + * @param {module:model/String} opts.enumQueryString Query parameter enum test (string) (default to '-efg') * @param {module:model/Number} opts.enumQueryInteger Query parameter enum test (double) * @param {module:model/Number} opts.enumQueryDouble Query parameter enum test (double) - * @param {Array.} opts.enumFormStringArray Form parameter enum test (string array) (default to '$') - * @param {module:model/String} opts.enumFormString Form parameter enum test (string) (default to '-efg') + * @param {Array.} opts.enumFormStringArray Form parameter enum test (string array) (default to '$') + * @param {module:model/String} opts.enumFormString Form parameter enum test (string) (default to '-efg') * @return {Promise} a {@link https://www.promisejs.org/|Promise} */ this.testEnumParameters = function(opts) { @@ -640,23 +621,19 @@ this.testGroupParametersWithHttpInfo = function(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, opts) { opts = opts || {}; var postBody = null; - // verify the required parameter 'requiredStringGroup' is set if (requiredStringGroup === undefined || requiredStringGroup === null) { throw new Error("Missing the required parameter 'requiredStringGroup' when calling testGroupParameters"); } - // verify the required parameter 'requiredBooleanGroup' is set if (requiredBooleanGroup === undefined || requiredBooleanGroup === null) { throw new Error("Missing the required parameter 'requiredBooleanGroup' when calling testGroupParameters"); } - // verify the required parameter 'requiredInt64Group' is set if (requiredInt64Group === undefined || requiredInt64Group === null) { throw new Error("Missing the required parameter 'requiredInt64Group' when calling testGroupParameters"); } - var pathParams = { }; var queryParams = { @@ -712,13 +689,11 @@ */ this.testInlineAdditionalPropertiesWithHttpInfo = function(param) { var postBody = param; - // verify the required parameter 'param' is set if (param === undefined || param === null) { throw new Error("Missing the required parameter 'param' when calling testInlineAdditionalProperties"); } - var pathParams = { }; var queryParams = { @@ -762,18 +737,15 @@ */ this.testJsonFormDataWithHttpInfo = function(param, param2) { var postBody = null; - // verify the required parameter 'param' is set if (param === undefined || param === null) { throw new Error("Missing the required parameter 'param' when calling testJsonFormData"); } - // verify the required parameter 'param2' is set if (param2 === undefined || param2 === null) { throw new Error("Missing the required parameter 'param2' when calling testJsonFormData"); } - var pathParams = { }; var queryParams = { diff --git a/samples/client/petstore/javascript-promise/src/api/FakeClassnameTags123Api.js b/samples/client/petstore/javascript-promise/src/api/FakeClassnameTags123Api.js index f2a07da8ad5..29ddd453802 100644 --- a/samples/client/petstore/javascript-promise/src/api/FakeClassnameTags123Api.js +++ b/samples/client/petstore/javascript-promise/src/api/FakeClassnameTags123Api.js @@ -56,13 +56,11 @@ */ this.testClassnameWithHttpInfo = function(body) { var postBody = body; - // verify the required parameter 'body' is set if (body === undefined || body === null) { throw new Error("Missing the required parameter 'body' when calling testClassname"); } - var pathParams = { }; var queryParams = { diff --git a/samples/client/petstore/javascript-promise/src/api/PetApi.js b/samples/client/petstore/javascript-promise/src/api/PetApi.js index 7073d55e041..7bea171fcde 100644 --- a/samples/client/petstore/javascript-promise/src/api/PetApi.js +++ b/samples/client/petstore/javascript-promise/src/api/PetApi.js @@ -55,13 +55,11 @@ */ this.addPetWithHttpInfo = function(body) { var postBody = body; - // verify the required parameter 'body' is set if (body === undefined || body === null) { throw new Error("Missing the required parameter 'body' when calling addPet"); } - var pathParams = { }; var queryParams = { @@ -107,13 +105,11 @@ this.deletePetWithHttpInfo = function(petId, opts) { opts = opts || {}; var postBody = null; - // verify the required parameter 'petId' is set if (petId === undefined || petId === null) { throw new Error("Missing the required parameter 'petId' when calling deletePet"); } - var pathParams = { 'petId': petId }; @@ -161,13 +157,11 @@ */ this.findPetsByStatusWithHttpInfo = function(status) { var postBody = null; - // verify the required parameter 'status' is set if (status === undefined || status === null) { throw new Error("Missing the required parameter 'status' when calling findPetsByStatus"); } - var pathParams = { }; var queryParams = { @@ -216,13 +210,11 @@ */ this.findPetsByTagsWithHttpInfo = function(tags) { var postBody = null; - // verify the required parameter 'tags' is set if (tags === undefined || tags === null) { throw new Error("Missing the required parameter 'tags' when calling findPetsByTags"); } - var pathParams = { }; var queryParams = { @@ -271,13 +263,11 @@ */ this.getPetByIdWithHttpInfo = function(petId) { var postBody = null; - // verify the required parameter 'petId' is set if (petId === undefined || petId === null) { throw new Error("Missing the required parameter 'petId' when calling getPetById"); } - var pathParams = { 'petId': petId }; @@ -322,13 +312,11 @@ */ this.updatePetWithHttpInfo = function(body) { var postBody = body; - // verify the required parameter 'body' is set if (body === undefined || body === null) { throw new Error("Missing the required parameter 'body' when calling updatePet"); } - var pathParams = { }; var queryParams = { @@ -375,13 +363,11 @@ this.updatePetWithFormWithHttpInfo = function(petId, opts) { opts = opts || {}; var postBody = null; - // verify the required parameter 'petId' is set if (petId === undefined || petId === null) { throw new Error("Missing the required parameter 'petId' when calling updatePetWithForm"); } - var pathParams = { 'petId': petId }; @@ -434,13 +420,11 @@ this.uploadFileWithHttpInfo = function(petId, opts) { opts = opts || {}; var postBody = null; - // verify the required parameter 'petId' is set if (petId === undefined || petId === null) { throw new Error("Missing the required parameter 'petId' when calling uploadFile"); } - var pathParams = { 'petId': petId }; @@ -493,18 +477,15 @@ this.uploadFileWithRequiredFileWithHttpInfo = function(petId, requiredFile, opts) { opts = opts || {}; var postBody = null; - // verify the required parameter 'petId' is set if (petId === undefined || petId === null) { throw new Error("Missing the required parameter 'petId' when calling uploadFileWithRequiredFile"); } - // verify the required parameter 'requiredFile' is set if (requiredFile === undefined || requiredFile === null) { throw new Error("Missing the required parameter 'requiredFile' when calling uploadFileWithRequiredFile"); } - var pathParams = { 'petId': petId }; diff --git a/samples/client/petstore/javascript-promise/src/api/StoreApi.js b/samples/client/petstore/javascript-promise/src/api/StoreApi.js index 953cd1e9d2e..f85b4920958 100644 --- a/samples/client/petstore/javascript-promise/src/api/StoreApi.js +++ b/samples/client/petstore/javascript-promise/src/api/StoreApi.js @@ -50,19 +50,17 @@ /** * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param {String} orderId ID of the order that needs to be deleted * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response */ this.deleteOrderWithHttpInfo = function(orderId) { var postBody = null; - // verify the required parameter 'orderId' is set if (orderId === undefined || orderId === null) { throw new Error("Missing the required parameter 'orderId' when calling deleteOrder"); } - var pathParams = { 'order_id': orderId }; @@ -88,7 +86,7 @@ /** * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param {String} orderId ID of the order that needs to be deleted * @return {Promise} a {@link https://www.promisejs.org/|Promise} */ @@ -108,7 +106,6 @@ this.getInventoryWithHttpInfo = function() { var postBody = null; - var pathParams = { }; var queryParams = { @@ -146,19 +143,17 @@ /** * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param {Number} orderId ID of pet that needs to be fetched * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Order} and HTTP response */ this.getOrderByIdWithHttpInfo = function(orderId) { var postBody = null; - // verify the required parameter 'orderId' is set if (orderId === undefined || orderId === null) { throw new Error("Missing the required parameter 'orderId' when calling getOrderById"); } - var pathParams = { 'order_id': orderId }; @@ -184,7 +179,7 @@ /** * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param {Number} orderId ID of pet that needs to be fetched * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Order} */ @@ -203,13 +198,11 @@ */ this.placeOrderWithHttpInfo = function(body) { var postBody = body; - // verify the required parameter 'body' is set if (body === undefined || body === null) { throw new Error("Missing the required parameter 'body' when calling placeOrder"); } - var pathParams = { }; var queryParams = { diff --git a/samples/client/petstore/javascript-promise/src/api/UserApi.js b/samples/client/petstore/javascript-promise/src/api/UserApi.js index 4169683c300..73967ca5f9f 100644 --- a/samples/client/petstore/javascript-promise/src/api/UserApi.js +++ b/samples/client/petstore/javascript-promise/src/api/UserApi.js @@ -56,13 +56,11 @@ */ this.createUserWithHttpInfo = function(body) { var postBody = body; - // verify the required parameter 'body' is set if (body === undefined || body === null) { throw new Error("Missing the required parameter 'body' when calling createUser"); } - var pathParams = { }; var queryParams = { @@ -106,13 +104,11 @@ */ this.createUsersWithArrayInputWithHttpInfo = function(body) { var postBody = body; - // verify the required parameter 'body' is set if (body === undefined || body === null) { throw new Error("Missing the required parameter 'body' when calling createUsersWithArrayInput"); } - var pathParams = { }; var queryParams = { @@ -155,13 +151,11 @@ */ this.createUsersWithListInputWithHttpInfo = function(body) { var postBody = body; - // verify the required parameter 'body' is set if (body === undefined || body === null) { throw new Error("Missing the required parameter 'body' when calling createUsersWithListInput"); } - var pathParams = { }; var queryParams = { @@ -205,13 +199,11 @@ */ this.deleteUserWithHttpInfo = function(username) { var postBody = null; - // verify the required parameter 'username' is set if (username === undefined || username === null) { throw new Error("Missing the required parameter 'username' when calling deleteUser"); } - var pathParams = { 'username': username }; @@ -256,13 +248,11 @@ */ this.getUserByNameWithHttpInfo = function(username) { var postBody = null; - // verify the required parameter 'username' is set if (username === undefined || username === null) { throw new Error("Missing the required parameter 'username' when calling getUserByName"); } - var pathParams = { 'username': username }; @@ -307,18 +297,15 @@ */ this.loginUserWithHttpInfo = function(username, password) { var postBody = null; - // verify the required parameter 'username' is set if (username === undefined || username === null) { throw new Error("Missing the required parameter 'username' when calling loginUser"); } - // verify the required parameter 'password' is set if (password === undefined || password === null) { throw new Error("Missing the required parameter 'password' when calling loginUser"); } - var pathParams = { }; var queryParams = { @@ -364,7 +351,6 @@ this.logoutUserWithHttpInfo = function() { var postBody = null; - var pathParams = { }; var queryParams = { @@ -408,18 +394,15 @@ */ this.updateUserWithHttpInfo = function(username, body) { var postBody = body; - // verify the required parameter 'username' is set if (username === undefined || username === null) { throw new Error("Missing the required parameter 'username' when calling updateUser"); } - // verify the required parameter 'body' is set if (body === undefined || body === null) { throw new Error("Missing the required parameter 'body' when calling updateUser"); } - var pathParams = { 'username': username }; diff --git a/samples/client/petstore/javascript/src/api/AnotherFakeApi.js b/samples/client/petstore/javascript/src/api/AnotherFakeApi.js index 8c04ca58cab..92ccde0278e 100644 --- a/samples/client/petstore/javascript/src/api/AnotherFakeApi.js +++ b/samples/client/petstore/javascript/src/api/AnotherFakeApi.js @@ -64,13 +64,11 @@ */ this.call123testSpecialTags = function(body, callback) { var postBody = body; - // verify the required parameter 'body' is set if (body === undefined || body === null) { throw new Error("Missing the required parameter 'body' when calling call123testSpecialTags"); } - var pathParams = { }; var queryParams = { diff --git a/samples/client/petstore/javascript/src/api/FakeApi.js b/samples/client/petstore/javascript/src/api/FakeApi.js index e1f7adefc9f..7a879de0f62 100644 --- a/samples/client/petstore/javascript/src/api/FakeApi.js +++ b/samples/client/petstore/javascript/src/api/FakeApi.js @@ -63,13 +63,11 @@ */ this.createXmlItem = function(xmlItem, callback) { var postBody = xmlItem; - // verify the required parameter 'xmlItem' is set if (xmlItem === undefined || xmlItem === null) { throw new Error("Missing the required parameter 'xmlItem' when calling createXmlItem"); } - var pathParams = { }; var queryParams = { @@ -111,7 +109,6 @@ opts = opts || {}; var postBody = opts['body']; - var pathParams = { }; var queryParams = { @@ -153,7 +150,6 @@ opts = opts || {}; var postBody = opts['body']; - var pathParams = { }; var queryParams = { @@ -195,7 +191,6 @@ opts = opts || {}; var postBody = opts['body']; - var pathParams = { }; var queryParams = { @@ -237,7 +232,6 @@ opts = opts || {}; var postBody = opts['body']; - var pathParams = { }; var queryParams = { @@ -269,19 +263,17 @@ */ /** - * For this test, the body for this request much reference a schema named `File`. + * For this test, the body for this request much reference a schema named `File`. * @param {module:model/FileSchemaTestClass} body * @param {module:api/FakeApi~testBodyWithFileSchemaCallback} callback The callback function, accepting three arguments: error, data, response */ this.testBodyWithFileSchema = function(body, callback) { var postBody = body; - // verify the required parameter 'body' is set if (body === undefined || body === null) { throw new Error("Missing the required parameter 'body' when calling testBodyWithFileSchema"); } - var pathParams = { }; var queryParams = { @@ -319,18 +311,15 @@ */ this.testBodyWithQueryParams = function(query, body, callback) { var postBody = body; - // verify the required parameter 'query' is set if (query === undefined || query === null) { throw new Error("Missing the required parameter 'query' when calling testBodyWithQueryParams"); } - // verify the required parameter 'body' is set if (body === undefined || body === null) { throw new Error("Missing the required parameter 'body' when calling testBodyWithQueryParams"); } - var pathParams = { }; var queryParams = { @@ -363,21 +352,19 @@ */ /** - * To test \"client\" model - * To test \"client\" model + * To test \"client\" model + * To test \"client\" model * @param {module:model/Client} body client model * @param {module:api/FakeApi~testClientModelCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link module:model/Client} */ this.testClientModel = function(body, callback) { var postBody = body; - // verify the required parameter 'body' is set if (body === undefined || body === null) { throw new Error("Missing the required parameter 'body' when calling testClientModel"); } - var pathParams = { }; var queryParams = { @@ -431,28 +418,23 @@ this.testEndpointParameters = function(_number, _double, patternWithoutDelimiter, _byte, opts, callback) { opts = opts || {}; var postBody = null; - // verify the required parameter '_number' is set if (_number === undefined || _number === null) { throw new Error("Missing the required parameter '_number' when calling testEndpointParameters"); } - // verify the required parameter '_double' is set if (_double === undefined || _double === null) { throw new Error("Missing the required parameter '_double' when calling testEndpointParameters"); } - // verify the required parameter 'patternWithoutDelimiter' is set if (patternWithoutDelimiter === undefined || patternWithoutDelimiter === null) { throw new Error("Missing the required parameter 'patternWithoutDelimiter' when calling testEndpointParameters"); } - // verify the required parameter '_byte' is set if (_byte === undefined || _byte === null) { throw new Error("Missing the required parameter '_byte' when calling testEndpointParameters"); } - var pathParams = { }; var queryParams = { @@ -502,20 +484,19 @@ * To test enum parameters * @param {Object} opts Optional parameters * @param {Array.} opts.enumHeaderStringArray Header parameter enum test (string array) - * @param {module:model/String} opts.enumHeaderString Header parameter enum test (string) (default to '-efg') + * @param {module:model/String} opts.enumHeaderString Header parameter enum test (string) (default to '-efg') * @param {Array.} opts.enumQueryStringArray Query parameter enum test (string array) - * @param {module:model/String} opts.enumQueryString Query parameter enum test (string) (default to '-efg') + * @param {module:model/String} opts.enumQueryString Query parameter enum test (string) (default to '-efg') * @param {module:model/Number} opts.enumQueryInteger Query parameter enum test (double) * @param {module:model/Number} opts.enumQueryDouble Query parameter enum test (double) - * @param {Array.} opts.enumFormStringArray Form parameter enum test (string array) (default to '$') - * @param {module:model/String} opts.enumFormString Form parameter enum test (string) (default to '-efg') + * @param {Array.} opts.enumFormStringArray Form parameter enum test (string array) (default to '$') + * @param {module:model/String} opts.enumFormString Form parameter enum test (string) (default to '-efg') * @param {module:api/FakeApi~testEnumParametersCallback} callback The callback function, accepting three arguments: error, data, response */ this.testEnumParameters = function(opts, callback) { opts = opts || {}; var postBody = null; - var pathParams = { }; var queryParams = { @@ -572,23 +553,19 @@ this.testGroupParameters = function(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, opts, callback) { opts = opts || {}; var postBody = null; - // verify the required parameter 'requiredStringGroup' is set if (requiredStringGroup === undefined || requiredStringGroup === null) { throw new Error("Missing the required parameter 'requiredStringGroup' when calling testGroupParameters"); } - // verify the required parameter 'requiredBooleanGroup' is set if (requiredBooleanGroup === undefined || requiredBooleanGroup === null) { throw new Error("Missing the required parameter 'requiredBooleanGroup' when calling testGroupParameters"); } - // verify the required parameter 'requiredInt64Group' is set if (requiredInt64Group === undefined || requiredInt64Group === null) { throw new Error("Missing the required parameter 'requiredInt64Group' when calling testGroupParameters"); } - var pathParams = { }; var queryParams = { @@ -632,13 +609,11 @@ */ this.testInlineAdditionalProperties = function(param, callback) { var postBody = param; - // verify the required parameter 'param' is set if (param === undefined || param === null) { throw new Error("Missing the required parameter 'param' when calling testInlineAdditionalProperties"); } - var pathParams = { }; var queryParams = { @@ -677,18 +652,15 @@ */ this.testJsonFormData = function(param, param2, callback) { var postBody = null; - // verify the required parameter 'param' is set if (param === undefined || param === null) { throw new Error("Missing the required parameter 'param' when calling testJsonFormData"); } - // verify the required parameter 'param2' is set if (param2 === undefined || param2 === null) { throw new Error("Missing the required parameter 'param2' when calling testJsonFormData"); } - var pathParams = { }; var queryParams = { diff --git a/samples/client/petstore/javascript/src/api/FakeClassnameTags123Api.js b/samples/client/petstore/javascript/src/api/FakeClassnameTags123Api.js index c438a686b78..bd4a85bb9ef 100644 --- a/samples/client/petstore/javascript/src/api/FakeClassnameTags123Api.js +++ b/samples/client/petstore/javascript/src/api/FakeClassnameTags123Api.js @@ -64,13 +64,11 @@ */ this.testClassname = function(body, callback) { var postBody = body; - // verify the required parameter 'body' is set if (body === undefined || body === null) { throw new Error("Missing the required parameter 'body' when calling testClassname"); } - var pathParams = { }; var queryParams = { diff --git a/samples/client/petstore/javascript/src/api/PetApi.js b/samples/client/petstore/javascript/src/api/PetApi.js index 88b75d0340c..81ee3b30ae5 100644 --- a/samples/client/petstore/javascript/src/api/PetApi.js +++ b/samples/client/petstore/javascript/src/api/PetApi.js @@ -62,13 +62,11 @@ */ this.addPet = function(body, callback) { var postBody = body; - // verify the required parameter 'body' is set if (body === undefined || body === null) { throw new Error("Missing the required parameter 'body' when calling addPet"); } - var pathParams = { }; var queryParams = { @@ -109,13 +107,11 @@ this.deletePet = function(petId, opts, callback) { opts = opts || {}; var postBody = null; - // verify the required parameter 'petId' is set if (petId === undefined || petId === null) { throw new Error("Missing the required parameter 'petId' when calling deletePet"); } - var pathParams = { 'petId': petId }; @@ -157,13 +153,11 @@ */ this.findPetsByStatus = function(status, callback) { var postBody = null; - // verify the required parameter 'status' is set if (status === undefined || status === null) { throw new Error("Missing the required parameter 'status' when calling findPetsByStatus"); } - var pathParams = { }; var queryParams = { @@ -207,13 +201,11 @@ */ this.findPetsByTags = function(tags, callback) { var postBody = null; - // verify the required parameter 'tags' is set if (tags === undefined || tags === null) { throw new Error("Missing the required parameter 'tags' when calling findPetsByTags"); } - var pathParams = { }; var queryParams = { @@ -257,13 +249,11 @@ */ this.getPetById = function(petId, callback) { var postBody = null; - // verify the required parameter 'petId' is set if (petId === undefined || petId === null) { throw new Error("Missing the required parameter 'petId' when calling getPetById"); } - var pathParams = { 'petId': petId }; @@ -302,13 +292,11 @@ */ this.updatePet = function(body, callback) { var postBody = body; - // verify the required parameter 'body' is set if (body === undefined || body === null) { throw new Error("Missing the required parameter 'body' when calling updatePet"); } - var pathParams = { }; var queryParams = { @@ -350,13 +338,11 @@ this.updatePetWithForm = function(petId, opts, callback) { opts = opts || {}; var postBody = null; - // verify the required parameter 'petId' is set if (petId === undefined || petId === null) { throw new Error("Missing the required parameter 'petId' when calling updatePetWithForm"); } - var pathParams = { 'petId': petId }; @@ -402,13 +388,11 @@ this.uploadFile = function(petId, opts, callback) { opts = opts || {}; var postBody = null; - // verify the required parameter 'petId' is set if (petId === undefined || petId === null) { throw new Error("Missing the required parameter 'petId' when calling uploadFile"); } - var pathParams = { 'petId': petId }; @@ -454,18 +438,15 @@ this.uploadFileWithRequiredFile = function(petId, requiredFile, opts, callback) { opts = opts || {}; var postBody = null; - // verify the required parameter 'petId' is set if (petId === undefined || petId === null) { throw new Error("Missing the required parameter 'petId' when calling uploadFileWithRequiredFile"); } - // verify the required parameter 'requiredFile' is set if (requiredFile === undefined || requiredFile === null) { throw new Error("Missing the required parameter 'requiredFile' when calling uploadFileWithRequiredFile"); } - var pathParams = { 'petId': petId }; diff --git a/samples/client/petstore/javascript/src/api/StoreApi.js b/samples/client/petstore/javascript/src/api/StoreApi.js index 9b0d88bc1a3..8f815b1a8c7 100644 --- a/samples/client/petstore/javascript/src/api/StoreApi.js +++ b/samples/client/petstore/javascript/src/api/StoreApi.js @@ -57,19 +57,17 @@ /** * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param {String} orderId ID of the order that needs to be deleted * @param {module:api/StoreApi~deleteOrderCallback} callback The callback function, accepting three arguments: error, data, response */ this.deleteOrder = function(orderId, callback) { var postBody = null; - // verify the required parameter 'orderId' is set if (orderId === undefined || orderId === null) { throw new Error("Missing the required parameter 'orderId' when calling deleteOrder"); } - var pathParams = { 'order_id': orderId }; @@ -110,7 +108,6 @@ this.getInventory = function(callback) { var postBody = null; - var pathParams = { }; var queryParams = { @@ -143,20 +140,18 @@ /** * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param {Number} orderId ID of pet that needs to be fetched * @param {module:api/StoreApi~getOrderByIdCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link module:model/Order} */ this.getOrderById = function(orderId, callback) { var postBody = null; - // verify the required parameter 'orderId' is set if (orderId === undefined || orderId === null) { throw new Error("Missing the required parameter 'orderId' when calling getOrderById"); } - var pathParams = { 'order_id': orderId }; @@ -196,13 +191,11 @@ */ this.placeOrder = function(body, callback) { var postBody = body; - // verify the required parameter 'body' is set if (body === undefined || body === null) { throw new Error("Missing the required parameter 'body' when calling placeOrder"); } - var pathParams = { }; var queryParams = { diff --git a/samples/client/petstore/javascript/src/api/UserApi.js b/samples/client/petstore/javascript/src/api/UserApi.js index a0997eae874..f61b9999285 100644 --- a/samples/client/petstore/javascript/src/api/UserApi.js +++ b/samples/client/petstore/javascript/src/api/UserApi.js @@ -63,13 +63,11 @@ */ this.createUser = function(body, callback) { var postBody = body; - // verify the required parameter 'body' is set if (body === undefined || body === null) { throw new Error("Missing the required parameter 'body' when calling createUser"); } - var pathParams = { }; var queryParams = { @@ -107,13 +105,11 @@ */ this.createUsersWithArrayInput = function(body, callback) { var postBody = body; - // verify the required parameter 'body' is set if (body === undefined || body === null) { throw new Error("Missing the required parameter 'body' when calling createUsersWithArrayInput"); } - var pathParams = { }; var queryParams = { @@ -151,13 +147,11 @@ */ this.createUsersWithListInput = function(body, callback) { var postBody = body; - // verify the required parameter 'body' is set if (body === undefined || body === null) { throw new Error("Missing the required parameter 'body' when calling createUsersWithListInput"); } - var pathParams = { }; var queryParams = { @@ -196,13 +190,11 @@ */ this.deleteUser = function(username, callback) { var postBody = null; - // verify the required parameter 'username' is set if (username === undefined || username === null) { throw new Error("Missing the required parameter 'username' when calling deleteUser"); } - var pathParams = { 'username': username }; @@ -242,13 +234,11 @@ */ this.getUserByName = function(username, callback) { var postBody = null; - // verify the required parameter 'username' is set if (username === undefined || username === null) { throw new Error("Missing the required parameter 'username' when calling getUserByName"); } - var pathParams = { 'username': username }; @@ -289,18 +279,15 @@ */ this.loginUser = function(username, password, callback) { var postBody = null; - // verify the required parameter 'username' is set if (username === undefined || username === null) { throw new Error("Missing the required parameter 'username' when calling loginUser"); } - // verify the required parameter 'password' is set if (password === undefined || password === null) { throw new Error("Missing the required parameter 'password' when calling loginUser"); } - var pathParams = { }; var queryParams = { @@ -340,7 +327,6 @@ this.logoutUser = function(callback) { var postBody = null; - var pathParams = { }; var queryParams = { @@ -380,18 +366,15 @@ */ this.updateUser = function(username, body, callback) { var postBody = body; - // verify the required parameter 'username' is set if (username === undefined || username === null) { throw new Error("Missing the required parameter 'username' when calling updateUser"); } - // verify the required parameter 'body' is set if (body === undefined || body === null) { throw new Error("Missing the required parameter 'body' when calling updateUser"); } - var pathParams = { 'username': username };