diff --git a/samples/client/petstore/javascript-es6/README.md b/samples/client/petstore/javascript-es6/README.md index 3c84a23057e7..7d74305e7ce2 100644 --- a/samples/client/petstore/javascript-es6/README.md +++ b/samples/client/petstore/javascript-es6/README.md @@ -70,11 +70,10 @@ Please follow the [installation](#installation) instruction and execute the foll ```javascript var SwaggerPetstore = require('swagger_petstore'); -var api = new SwaggerPetstore.FakeApi() +var api = new SwaggerPetstore.AnotherFakeApi() + +var body = new SwaggerPetstore.Client(); // {Client} client model -var opts = { - 'body': new SwaggerPetstore.OuterBoolean() // {OuterBoolean} Input boolean as post body -}; var callback = function(error, data, response) { if (error) { @@ -83,7 +82,7 @@ var callback = function(error, data, response) { console.log('API called successfully. Returned data: ' + data); } }; -api.fakeOuterBooleanSerialize(opts, callback); +api.testSpecialTags(body, callback); ``` @@ -93,6 +92,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- +*SwaggerPetstore.AnotherFakeApi* | [**testSpecialTags**](docs/AnotherFakeApi.md#testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags *SwaggerPetstore.FakeApi* | [**fakeOuterBooleanSerialize**](docs/FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | *SwaggerPetstore.FakeApi* | [**fakeOuterCompositeSerialize**](docs/FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | *SwaggerPetstore.FakeApi* | [**fakeOuterNumberSerialize**](docs/FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | @@ -101,7 +101,7 @@ Class | Method | HTTP request | Description *SwaggerPetstore.FakeApi* | [**testEndpointParameters**](docs/FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *SwaggerPetstore.FakeApi* | [**testEnumParameters**](docs/FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters *SwaggerPetstore.FakeApi* | [**testJsonFormData**](docs/FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data -*SwaggerPetstore.Fake_classname_tags123Api* | [**testClassname**](docs/Fake_classname_tags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case +*SwaggerPetstore.FakeClassnameTags123Api* | [**testClassname**](docs/FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case *SwaggerPetstore.PetApi* | [**addPet**](docs/PetApi.md#addPet) | **POST** /pet | Add a new pet to the store *SwaggerPetstore.PetApi* | [**deletePet**](docs/PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet *SwaggerPetstore.PetApi* | [**findPetsByStatus**](docs/PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status diff --git a/samples/client/petstore/javascript-es6/docs/AnotherFakeApi.md b/samples/client/petstore/javascript-es6/docs/AnotherFakeApi.md new file mode 100644 index 000000000000..5617fa29d639 --- /dev/null +++ b/samples/client/petstore/javascript-es6/docs/AnotherFakeApi.md @@ -0,0 +1,54 @@ +# SwaggerPetstore.AnotherFakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**testSpecialTags**](AnotherFakeApi.md#testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags + + + +# **testSpecialTags** +> Client testSpecialTags(body) + +To test special tags + +To test special tags + +### Example +```javascript +import SwaggerPetstore from 'swagger_petstore'; + +let apiInstance = new SwaggerPetstore.AnotherFakeApi(); + +let body = new SwaggerPetstore.Client(); // Client | client model + + +apiInstance.testSpecialTags(body, (error, data, response) => { + if (error) { + console.error(error); + } else { + console.log('API called successfully. Returned data: ' + data); + } +}); +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + diff --git a/samples/client/petstore/javascript-es6/docs/FakeClassnameTags123Api.md b/samples/client/petstore/javascript-es6/docs/FakeClassnameTags123Api.md new file mode 100644 index 000000000000..9b2c6dcd4189 --- /dev/null +++ b/samples/client/petstore/javascript-es6/docs/FakeClassnameTags123Api.md @@ -0,0 +1,59 @@ +# SwaggerPetstore.FakeClassnameTags123Api + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**testClassname**](FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case + + + +# **testClassname** +> Client testClassname(body) + +To test class name in snake case + +### Example +```javascript +import SwaggerPetstore from 'swagger_petstore'; +let defaultClient = SwaggerPetstore.ApiClient.instance; + +// Configure API key authorization: api_key_query +let api_key_query = defaultClient.authentications['api_key_query']; +api_key_query.apiKey = 'YOUR API KEY'; +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) +//api_key_query.apiKeyPrefix = 'Token'; + +let apiInstance = new SwaggerPetstore.FakeClassnameTags123Api(); + +let body = new SwaggerPetstore.Client(); // Client | client model + + +apiInstance.testClassname(body, (error, data, response) => { + if (error) { + console.error(error); + } else { + console.log('API called successfully. Returned data: ' + data); + } +}); +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +[api_key_query](../README.md#api_key_query) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + diff --git a/samples/client/petstore/javascript-es6/package.json b/samples/client/petstore/javascript-es6/package.json index 0332217891ac..4ff4ed78574e 100644 --- a/samples/client/petstore/javascript-es6/package.json +++ b/samples/client/petstore/javascript-es6/package.json @@ -2,7 +2,7 @@ "name": "swagger_petstore", "version": "1.0.0", "description": "This_spec_is_mainly_for_testing_Petstore_server_and_contains_fake_endpoints_models__Please_do_not_use_this_for_any_other_purpose__Special_characters__", - "license": "Unlicense", + "license": "Apache 2.0", "main": "src/index.js", "scripts": { "test": "mocha --compilers js:babel-core/register --recursive" diff --git a/samples/client/petstore/javascript-es6/src/api/AnotherFakeApi.js b/samples/client/petstore/javascript-es6/src/api/AnotherFakeApi.js new file mode 100644 index 000000000000..ed170379f3b4 --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/api/AnotherFakeApi.js @@ -0,0 +1,83 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + + +import ApiClient from "../ApiClient"; +import Client from '../model/Client'; + +/** +* AnotherFake service. +* @module api/AnotherFakeApi +* @version 1.0.0 +*/ +export default class AnotherFakeApi { + + /** + * Constructs a new AnotherFakeApi. + * @alias module:api/AnotherFakeApi + * @class + * @param {module:ApiClient} [apiClient] Optional API client implementation to use, + * default to {@link module:ApiClient#instance} if unspecified. + */ + constructor(apiClient) { + this.apiClient = apiClient || ApiClient.instance; + } + + + /** + * Callback function to receive the result of the testSpecialTags operation. + * @callback module:api/AnotherFakeApi~testSpecialTagsCallback + * @param {String} error Error message, if any. + * @param {module:model/Client} data The data returned by the service call. + * @param {String} response The complete HTTP response. + */ + + /** + * To test special tags + * To test special tags + * @param {module:model/Client} body client model + * @param {module:api/AnotherFakeApi~testSpecialTagsCallback} callback The callback function, accepting three arguments: error, data, response + * data is of type: {@link module:model/Client} + */ + testSpecialTags(body, callback) { + let postBody = body; + + // verify the required parameter 'body' is set + if (body === undefined || body === null) { + throw new Error("Missing the required parameter 'body' when calling testSpecialTags"); + } + + + let pathParams = { + }; + let queryParams = { + }; + let headerParams = { + }; + let formParams = { + }; + + let authNames = []; + let contentTypes = ['application/json']; + let accepts = ['application/json']; + let returnType = Client; + + return this.apiClient.callApi( + '/another-fake/dummy', 'PATCH', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, callback + ); + } + + +} diff --git a/samples/client/petstore/javascript-es6/src/api/FakeClassnameTags123Api.js b/samples/client/petstore/javascript-es6/src/api/FakeClassnameTags123Api.js new file mode 100644 index 000000000000..11ece0534a77 --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/api/FakeClassnameTags123Api.js @@ -0,0 +1,82 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + + +import ApiClient from "../ApiClient"; +import Client from '../model/Client'; + +/** +* FakeClassnameTags123 service. +* @module api/FakeClassnameTags123Api +* @version 1.0.0 +*/ +export default class FakeClassnameTags123Api { + + /** + * Constructs a new FakeClassnameTags123Api. + * @alias module:api/FakeClassnameTags123Api + * @class + * @param {module:ApiClient} [apiClient] Optional API client implementation to use, + * default to {@link module:ApiClient#instance} if unspecified. + */ + constructor(apiClient) { + this.apiClient = apiClient || ApiClient.instance; + } + + + /** + * Callback function to receive the result of the testClassname operation. + * @callback module:api/FakeClassnameTags123Api~testClassnameCallback + * @param {String} error Error message, if any. + * @param {module:model/Client} data The data returned by the service call. + * @param {String} response The complete HTTP response. + */ + + /** + * To test class name in snake case + * @param {module:model/Client} body client model + * @param {module:api/FakeClassnameTags123Api~testClassnameCallback} callback The callback function, accepting three arguments: error, data, response + * data is of type: {@link module:model/Client} + */ + testClassname(body, callback) { + let 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"); + } + + + let pathParams = { + }; + let queryParams = { + }; + let headerParams = { + }; + let formParams = { + }; + + let authNames = ['api_key_query']; + let contentTypes = ['application/json']; + let accepts = ['application/json']; + let returnType = Client; + + return this.apiClient.callApi( + '/fake_classname_test', 'PATCH', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, callback + ); + } + + +} diff --git a/samples/client/petstore/javascript-es6/src/index.js b/samples/client/petstore/javascript-es6/src/index.js index 9a8ff8e2e420..ebcad866e7af 100644 --- a/samples/client/petstore/javascript-es6/src/index.js +++ b/samples/client/petstore/javascript-es6/src/index.js @@ -49,8 +49,9 @@ import Tag from './model/Tag'; import User from './model/User'; import Cat from './model/Cat'; import Dog from './model/Dog'; +import AnotherFakeApi from './api/AnotherFakeApi'; import FakeApi from './api/FakeApi'; -import Fake_classname_tags123Api from './api/Fake_classname_tags123Api'; +import FakeClassnameTags123Api from './api/FakeClassnameTags123Api'; import PetApi from './api/PetApi'; import StoreApi from './api/StoreApi'; import UserApi from './api/UserApi'; @@ -310,6 +311,12 @@ export { */ Dog, + /** + * The AnotherFakeApi service constructor. + * @property {module:api/AnotherFakeApi} + */ + AnotherFakeApi, + /** * The FakeApi service constructor. * @property {module:api/FakeApi} @@ -317,10 +324,10 @@ export { FakeApi, /** - * The Fake_classname_tags123Api service constructor. - * @property {module:api/Fake_classname_tags123Api} + * The FakeClassnameTags123Api service constructor. + * @property {module:api/FakeClassnameTags123Api} */ - Fake_classname_tags123Api, + FakeClassnameTags123Api, /** * The PetApi service constructor. diff --git a/samples/client/petstore/javascript-es6/test/api/AnotherFakeApi.spec.js b/samples/client/petstore/javascript-es6/test/api/AnotherFakeApi.spec.js new file mode 100644 index 000000000000..f55538a53e72 --- /dev/null +++ b/samples/client/petstore/javascript-es6/test/api/AnotherFakeApi.spec.js @@ -0,0 +1,63 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.AnotherFakeApi(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('AnotherFakeApi', function() { + describe('testSpecialTags', function() { + it('should call testSpecialTags successfully', function(done) { + //uncomment below and update the code to test testSpecialTags + //instance.testSpecialTags(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + }); + +})); diff --git a/samples/client/petstore/javascript-es6/test/api/FakeClassnameTags123Api.spec.js b/samples/client/petstore/javascript-es6/test/api/FakeClassnameTags123Api.spec.js new file mode 100644 index 000000000000..10e20e7778a2 --- /dev/null +++ b/samples/client/petstore/javascript-es6/test/api/FakeClassnameTags123Api.spec.js @@ -0,0 +1,63 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.FakeClassnameTags123Api(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('FakeClassnameTags123Api', function() { + describe('testClassname', function() { + it('should call testClassname successfully', function(done) { + //uncomment below and update the code to test testClassname + //instance.testClassname(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + }); + +})); diff --git a/samples/client/petstore/javascript-promise-es6/README.md b/samples/client/petstore/javascript-promise-es6/README.md index 833e2d74828b..c668dfd721ff 100644 --- a/samples/client/petstore/javascript-promise-es6/README.md +++ b/samples/client/petstore/javascript-promise-es6/README.md @@ -70,12 +70,11 @@ Please follow the [installation](#installation) instruction and execute the foll ```javascript var SwaggerPetstore = require('swagger_petstore'); -var api = new SwaggerPetstore.FakeApi() +var api = new SwaggerPetstore.AnotherFakeApi() -var opts = { - 'body': new SwaggerPetstore.OuterBoolean() // {OuterBoolean} Input boolean as post body -}; -api.fakeOuterBooleanSerialize(opts).then(function(data) { +var body = new SwaggerPetstore.Client(); // {Client} client model + +api.testSpecialTags(body).then(function(data) { console.log('API called successfully. Returned data: ' + data); }, function(error) { console.error(error); @@ -90,6 +89,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- +*SwaggerPetstore.AnotherFakeApi* | [**testSpecialTags**](docs/AnotherFakeApi.md#testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags *SwaggerPetstore.FakeApi* | [**fakeOuterBooleanSerialize**](docs/FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | *SwaggerPetstore.FakeApi* | [**fakeOuterCompositeSerialize**](docs/FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | *SwaggerPetstore.FakeApi* | [**fakeOuterNumberSerialize**](docs/FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | @@ -98,7 +98,7 @@ Class | Method | HTTP request | Description *SwaggerPetstore.FakeApi* | [**testEndpointParameters**](docs/FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *SwaggerPetstore.FakeApi* | [**testEnumParameters**](docs/FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters *SwaggerPetstore.FakeApi* | [**testJsonFormData**](docs/FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data -*SwaggerPetstore.Fake_classname_tags123Api* | [**testClassname**](docs/Fake_classname_tags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case +*SwaggerPetstore.FakeClassnameTags123Api* | [**testClassname**](docs/FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case *SwaggerPetstore.PetApi* | [**addPet**](docs/PetApi.md#addPet) | **POST** /pet | Add a new pet to the store *SwaggerPetstore.PetApi* | [**deletePet**](docs/PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet *SwaggerPetstore.PetApi* | [**findPetsByStatus**](docs/PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status diff --git a/samples/client/petstore/javascript-promise-es6/docs/AnotherFakeApi.md b/samples/client/petstore/javascript-promise-es6/docs/AnotherFakeApi.md new file mode 100644 index 000000000000..e6e6f0bf9f96 --- /dev/null +++ b/samples/client/petstore/javascript-promise-es6/docs/AnotherFakeApi.md @@ -0,0 +1,52 @@ +# SwaggerPetstore.AnotherFakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**testSpecialTags**](AnotherFakeApi.md#testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags + + + +# **testSpecialTags** +> Client testSpecialTags(body) + +To test special tags + +To test special tags + +### Example +```javascript +import SwaggerPetstore from 'swagger_petstore'; + +let apiInstance = new SwaggerPetstore.AnotherFakeApi(); + +let body = new SwaggerPetstore.Client(); // Client | client model + +apiInstance.testSpecialTags(body).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, (error) => { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + diff --git a/samples/client/petstore/javascript-promise-es6/docs/FakeClassnameTags123Api.md b/samples/client/petstore/javascript-promise-es6/docs/FakeClassnameTags123Api.md new file mode 100644 index 000000000000..1595c9b35f41 --- /dev/null +++ b/samples/client/petstore/javascript-promise-es6/docs/FakeClassnameTags123Api.md @@ -0,0 +1,57 @@ +# SwaggerPetstore.FakeClassnameTags123Api + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**testClassname**](FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case + + + +# **testClassname** +> Client testClassname(body) + +To test class name in snake case + +### Example +```javascript +import SwaggerPetstore from 'swagger_petstore'; +let defaultClient = SwaggerPetstore.ApiClient.instance; + +// Configure API key authorization: api_key_query +let api_key_query = defaultClient.authentications['api_key_query']; +api_key_query.apiKey = 'YOUR API KEY'; +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) +//api_key_query.apiKeyPrefix = 'Token'; + +let apiInstance = new SwaggerPetstore.FakeClassnameTags123Api(); + +let body = new SwaggerPetstore.Client(); // Client | client model + +apiInstance.testClassname(body).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, (error) => { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +[api_key_query](../README.md#api_key_query) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + diff --git a/samples/client/petstore/javascript-promise-es6/package.json b/samples/client/petstore/javascript-promise-es6/package.json index 0332217891ac..4ff4ed78574e 100644 --- a/samples/client/petstore/javascript-promise-es6/package.json +++ b/samples/client/petstore/javascript-promise-es6/package.json @@ -2,7 +2,7 @@ "name": "swagger_petstore", "version": "1.0.0", "description": "This_spec_is_mainly_for_testing_Petstore_server_and_contains_fake_endpoints_models__Please_do_not_use_this_for_any_other_purpose__Special_characters__", - "license": "Unlicense", + "license": "Apache 2.0", "main": "src/index.js", "scripts": { "test": "mocha --compilers js:babel-core/register --recursive" diff --git a/samples/client/petstore/javascript-promise-es6/src/api/AnotherFakeApi.js b/samples/client/petstore/javascript-promise-es6/src/api/AnotherFakeApi.js new file mode 100644 index 000000000000..94185c14bc33 --- /dev/null +++ b/samples/client/petstore/javascript-promise-es6/src/api/AnotherFakeApi.js @@ -0,0 +1,88 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + + +import ApiClient from "../ApiClient"; +import Client from '../model/Client'; + +/** +* AnotherFake service. +* @module api/AnotherFakeApi +* @version 1.0.0 +*/ +export default class AnotherFakeApi { + + /** + * Constructs a new AnotherFakeApi. + * @alias module:api/AnotherFakeApi + * @class + * @param {module:ApiClient} [apiClient] Optional API client implementation to use, + * default to {@link module:ApiClient#instance} if unspecified. + */ + constructor(apiClient) { + this.apiClient = apiClient || ApiClient.instance; + } + + + + /** + * To test special tags + * To test special tags + * @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 + */ + testSpecialTagsWithHttpInfo(body) { + let postBody = body; + + // verify the required parameter 'body' is set + if (body === undefined || body === null) { + throw new Error("Missing the required parameter 'body' when calling testSpecialTags"); + } + + + let pathParams = { + }; + let queryParams = { + }; + let headerParams = { + }; + let formParams = { + }; + + let authNames = []; + let contentTypes = ['application/json']; + let accepts = ['application/json']; + let returnType = Client; + + return this.apiClient.callApi( + '/another-fake/dummy', 'PATCH', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType + ); + } + + /** + * To test special tags + * To test special tags + * @param {module:model/Client} body client model + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Client} + */ + testSpecialTags(body) { + return this.testSpecialTagsWithHttpInfo(body) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + + +} diff --git a/samples/client/petstore/javascript-promise-es6/src/api/FakeClassnameTags123Api.js b/samples/client/petstore/javascript-promise-es6/src/api/FakeClassnameTags123Api.js new file mode 100644 index 000000000000..89dddfd7a92a --- /dev/null +++ b/samples/client/petstore/javascript-promise-es6/src/api/FakeClassnameTags123Api.js @@ -0,0 +1,86 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + + +import ApiClient from "../ApiClient"; +import Client from '../model/Client'; + +/** +* FakeClassnameTags123 service. +* @module api/FakeClassnameTags123Api +* @version 1.0.0 +*/ +export default class FakeClassnameTags123Api { + + /** + * Constructs a new FakeClassnameTags123Api. + * @alias module:api/FakeClassnameTags123Api + * @class + * @param {module:ApiClient} [apiClient] Optional API client implementation to use, + * default to {@link module:ApiClient#instance} if unspecified. + */ + constructor(apiClient) { + this.apiClient = apiClient || ApiClient.instance; + } + + + + /** + * To test class name in snake case + * @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 + */ + testClassnameWithHttpInfo(body) { + let 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"); + } + + + let pathParams = { + }; + let queryParams = { + }; + let headerParams = { + }; + let formParams = { + }; + + let authNames = ['api_key_query']; + let contentTypes = ['application/json']; + let accepts = ['application/json']; + let returnType = Client; + + return this.apiClient.callApi( + '/fake_classname_test', 'PATCH', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType + ); + } + + /** + * To test class name in snake case + * @param {module:model/Client} body client model + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Client} + */ + testClassname(body) { + return this.testClassnameWithHttpInfo(body) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + + +} diff --git a/samples/client/petstore/javascript-promise-es6/src/index.js b/samples/client/petstore/javascript-promise-es6/src/index.js index 9a8ff8e2e420..ebcad866e7af 100644 --- a/samples/client/petstore/javascript-promise-es6/src/index.js +++ b/samples/client/petstore/javascript-promise-es6/src/index.js @@ -49,8 +49,9 @@ import Tag from './model/Tag'; import User from './model/User'; import Cat from './model/Cat'; import Dog from './model/Dog'; +import AnotherFakeApi from './api/AnotherFakeApi'; import FakeApi from './api/FakeApi'; -import Fake_classname_tags123Api from './api/Fake_classname_tags123Api'; +import FakeClassnameTags123Api from './api/FakeClassnameTags123Api'; import PetApi from './api/PetApi'; import StoreApi from './api/StoreApi'; import UserApi from './api/UserApi'; @@ -310,6 +311,12 @@ export { */ Dog, + /** + * The AnotherFakeApi service constructor. + * @property {module:api/AnotherFakeApi} + */ + AnotherFakeApi, + /** * The FakeApi service constructor. * @property {module:api/FakeApi} @@ -317,10 +324,10 @@ export { FakeApi, /** - * The Fake_classname_tags123Api service constructor. - * @property {module:api/Fake_classname_tags123Api} + * The FakeClassnameTags123Api service constructor. + * @property {module:api/FakeClassnameTags123Api} */ - Fake_classname_tags123Api, + FakeClassnameTags123Api, /** * The PetApi service constructor. diff --git a/samples/client/petstore/javascript-promise-es6/test/api/AnotherFakeApi.spec.js b/samples/client/petstore/javascript-promise-es6/test/api/AnotherFakeApi.spec.js new file mode 100644 index 000000000000..f55538a53e72 --- /dev/null +++ b/samples/client/petstore/javascript-promise-es6/test/api/AnotherFakeApi.spec.js @@ -0,0 +1,63 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.AnotherFakeApi(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('AnotherFakeApi', function() { + describe('testSpecialTags', function() { + it('should call testSpecialTags successfully', function(done) { + //uncomment below and update the code to test testSpecialTags + //instance.testSpecialTags(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + }); + +})); diff --git a/samples/client/petstore/javascript-promise-es6/test/api/FakeClassnameTags123Api.spec.js b/samples/client/petstore/javascript-promise-es6/test/api/FakeClassnameTags123Api.spec.js new file mode 100644 index 000000000000..10e20e7778a2 --- /dev/null +++ b/samples/client/petstore/javascript-promise-es6/test/api/FakeClassnameTags123Api.spec.js @@ -0,0 +1,63 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.FakeClassnameTags123Api(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('FakeClassnameTags123Api', function() { + describe('testClassname', function() { + it('should call testClassname successfully', function(done) { + //uncomment below and update the code to test testClassname + //instance.testClassname(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + }); + +})); diff --git a/samples/client/petstore/javascript-promise/README.md b/samples/client/petstore/javascript-promise/README.md index 50b4721e60e9..35942f17ef6a 100644 --- a/samples/client/petstore/javascript-promise/README.md +++ b/samples/client/petstore/javascript-promise/README.md @@ -95,12 +95,11 @@ Please follow the [installation](#installation) instruction and execute the foll ```javascript var SwaggerPetstore = require('swagger_petstore'); -var api = new SwaggerPetstore.FakeApi() +var api = new SwaggerPetstore.AnotherFakeApi() -var opts = { - 'body': new SwaggerPetstore.OuterBoolean() // {OuterBoolean} Input boolean as post body -}; -api.fakeOuterBooleanSerialize(opts).then(function(data) { +var body = new SwaggerPetstore.Client(); // {Client} client model + +api.testSpecialTags(body).then(function(data) { console.log('API called successfully. Returned data: ' + data); }, function(error) { console.error(error); @@ -115,6 +114,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- +*SwaggerPetstore.AnotherFakeApi* | [**testSpecialTags**](docs/AnotherFakeApi.md#testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags *SwaggerPetstore.FakeApi* | [**fakeOuterBooleanSerialize**](docs/FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | *SwaggerPetstore.FakeApi* | [**fakeOuterCompositeSerialize**](docs/FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | *SwaggerPetstore.FakeApi* | [**fakeOuterNumberSerialize**](docs/FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | @@ -123,7 +123,7 @@ Class | Method | HTTP request | Description *SwaggerPetstore.FakeApi* | [**testEndpointParameters**](docs/FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *SwaggerPetstore.FakeApi* | [**testEnumParameters**](docs/FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters *SwaggerPetstore.FakeApi* | [**testJsonFormData**](docs/FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data -*SwaggerPetstore.Fake_classname_tags123Api* | [**testClassname**](docs/Fake_classname_tags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case +*SwaggerPetstore.FakeClassnameTags123Api* | [**testClassname**](docs/FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case *SwaggerPetstore.PetApi* | [**addPet**](docs/PetApi.md#addPet) | **POST** /pet | Add a new pet to the store *SwaggerPetstore.PetApi* | [**deletePet**](docs/PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet *SwaggerPetstore.PetApi* | [**findPetsByStatus**](docs/PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status diff --git a/samples/client/petstore/javascript-promise/docs/AnotherFakeApi.md b/samples/client/petstore/javascript-promise/docs/AnotherFakeApi.md new file mode 100644 index 000000000000..34529644bbae --- /dev/null +++ b/samples/client/petstore/javascript-promise/docs/AnotherFakeApi.md @@ -0,0 +1,52 @@ +# SwaggerPetstore.AnotherFakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**testSpecialTags**](AnotherFakeApi.md#testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags + + + +# **testSpecialTags** +> Client testSpecialTags(body) + +To test special tags + +To test special tags + +### Example +```javascript +var SwaggerPetstore = require('swagger_petstore'); + +var apiInstance = new SwaggerPetstore.AnotherFakeApi(); + +var body = new SwaggerPetstore.Client(); // Client | client model + +apiInstance.testSpecialTags(body).then(function(data) { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + diff --git a/samples/client/petstore/javascript-promise/docs/FakeClassnameTags123Api.md b/samples/client/petstore/javascript-promise/docs/FakeClassnameTags123Api.md new file mode 100644 index 000000000000..670ed04c196c --- /dev/null +++ b/samples/client/petstore/javascript-promise/docs/FakeClassnameTags123Api.md @@ -0,0 +1,57 @@ +# SwaggerPetstore.FakeClassnameTags123Api + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**testClassname**](FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case + + + +# **testClassname** +> Client testClassname(body) + +To test class name in snake case + +### Example +```javascript +var SwaggerPetstore = require('swagger_petstore'); +var defaultClient = SwaggerPetstore.ApiClient.instance; + +// Configure API key authorization: api_key_query +var api_key_query = defaultClient.authentications['api_key_query']; +api_key_query.apiKey = 'YOUR API KEY'; +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) +//api_key_query.apiKeyPrefix = 'Token'; + +var apiInstance = new SwaggerPetstore.FakeClassnameTags123Api(); + +var body = new SwaggerPetstore.Client(); // Client | client model + +apiInstance.testClassname(body).then(function(data) { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +[api_key_query](../README.md#api_key_query) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + diff --git a/samples/client/petstore/javascript-promise/package.json b/samples/client/petstore/javascript-promise/package.json index 881163c02f41..7b90d35255f7 100644 --- a/samples/client/petstore/javascript-promise/package.json +++ b/samples/client/petstore/javascript-promise/package.json @@ -2,7 +2,7 @@ "name": "swagger_petstore", "version": "1.0.0", "description": "This_spec_is_mainly_for_testing_Petstore_server_and_contains_fake_endpoints_models__Please_do_not_use_this_for_any_other_purpose__Special_characters__", - "license": "Unlicense", + "license": "Apache 2.0", "main": "src/index.js", "scripts": { "test": "./node_modules/mocha/bin/mocha --recursive" diff --git a/samples/client/petstore/javascript-promise/src/api/AnotherFakeApi.js b/samples/client/petstore/javascript-promise/src/api/AnotherFakeApi.js new file mode 100644 index 000000000000..eabb53763c2a --- /dev/null +++ b/samples/client/petstore/javascript-promise/src/api/AnotherFakeApi.js @@ -0,0 +1,105 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * + * Swagger Codegen version: 2.3.0-SNAPSHOT + * + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient', 'model/Client'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient'), require('../model/Client')); + } else { + // Browser globals (root is window) + if (!root.SwaggerPetstore) { + root.SwaggerPetstore = {}; + } + root.SwaggerPetstore.AnotherFakeApi = factory(root.SwaggerPetstore.ApiClient, root.SwaggerPetstore.Client); + } +}(this, function(ApiClient, Client) { + 'use strict'; + + /** + * AnotherFake service. + * @module api/AnotherFakeApi + * @version 1.0.0 + */ + + /** + * Constructs a new AnotherFakeApi. + * @alias module:api/AnotherFakeApi + * @class + * @param {module:ApiClient} [apiClient] Optional API client implementation to use, + * default to {@link module:ApiClient#instance} if unspecified. + */ + var exports = function(apiClient) { + this.apiClient = apiClient || ApiClient.instance; + + + + /** + * To test special tags + * To test special tags + * @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.testSpecialTagsWithHttpInfo = 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 testSpecialTags"); + } + + + var pathParams = { + }; + var queryParams = { + }; + var collectionQueryParams = { + }; + var headerParams = { + }; + var formParams = { + }; + + var authNames = []; + var contentTypes = ['application/json']; + var accepts = ['application/json']; + var returnType = Client; + + return this.apiClient.callApi( + '/another-fake/dummy', 'PATCH', + pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType + ); + } + + /** + * To test special tags + * To test special tags + * @param {module:model/Client} body client model + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Client} + */ + this.testSpecialTags = function(body) { + return this.testSpecialTagsWithHttpInfo(body) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + }; + + return exports; +})); diff --git a/samples/client/petstore/javascript-promise/src/api/FakeClassnameTags123Api.js b/samples/client/petstore/javascript-promise/src/api/FakeClassnameTags123Api.js new file mode 100644 index 000000000000..fdae9bbaebde --- /dev/null +++ b/samples/client/petstore/javascript-promise/src/api/FakeClassnameTags123Api.js @@ -0,0 +1,103 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * + * Swagger Codegen version: 2.3.0-SNAPSHOT + * + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient', 'model/Client'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient'), require('../model/Client')); + } else { + // Browser globals (root is window) + if (!root.SwaggerPetstore) { + root.SwaggerPetstore = {}; + } + root.SwaggerPetstore.FakeClassnameTags123Api = factory(root.SwaggerPetstore.ApiClient, root.SwaggerPetstore.Client); + } +}(this, function(ApiClient, Client) { + 'use strict'; + + /** + * FakeClassnameTags123 service. + * @module api/FakeClassnameTags123Api + * @version 1.0.0 + */ + + /** + * Constructs a new FakeClassnameTags123Api. + * @alias module:api/FakeClassnameTags123Api + * @class + * @param {module:ApiClient} [apiClient] Optional API client implementation to use, + * default to {@link module:ApiClient#instance} if unspecified. + */ + var exports = function(apiClient) { + this.apiClient = apiClient || ApiClient.instance; + + + + /** + * To test class name in snake case + * @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.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 = { + }; + var collectionQueryParams = { + }; + var headerParams = { + }; + var formParams = { + }; + + var authNames = ['api_key_query']; + var contentTypes = ['application/json']; + var accepts = ['application/json']; + var returnType = Client; + + return this.apiClient.callApi( + '/fake_classname_test', 'PATCH', + pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType + ); + } + + /** + * To test class name in snake case + * @param {module:model/Client} body client model + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Client} + */ + this.testClassname = function(body) { + return this.testClassnameWithHttpInfo(body) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + }; + + return exports; +})); diff --git a/samples/client/petstore/javascript-promise/src/index.js b/samples/client/petstore/javascript-promise/src/index.js index afc840ce7588..480a6d3ead39 100644 --- a/samples/client/petstore/javascript-promise/src/index.js +++ b/samples/client/petstore/javascript-promise/src/index.js @@ -17,12 +17,12 @@ (function(factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. - define(['ApiClient', 'model/AdditionalPropertiesClass', 'model/Animal', 'model/AnimalFarm', 'model/ApiResponse', 'model/ArrayOfArrayOfNumberOnly', 'model/ArrayOfNumberOnly', 'model/ArrayTest', 'model/Capitalization', 'model/Category', 'model/ClassModel', 'model/Client', 'model/EnumArrays', 'model/EnumClass', 'model/EnumTest', 'model/FormatTest', 'model/HasOnlyReadOnly', 'model/List', 'model/MapTest', 'model/MixedPropertiesAndAdditionalPropertiesClass', 'model/Model200Response', 'model/ModelReturn', 'model/Name', 'model/NumberOnly', 'model/Order', 'model/OuterBoolean', 'model/OuterComposite', 'model/OuterEnum', 'model/OuterNumber', 'model/OuterString', 'model/Pet', 'model/ReadOnlyFirst', 'model/SpecialModelName', 'model/Tag', 'model/User', 'model/Cat', 'model/Dog', 'api/FakeApi', 'api/Fake_classname_tags123Api', 'api/PetApi', 'api/StoreApi', 'api/UserApi'], factory); + define(['ApiClient', 'model/AdditionalPropertiesClass', 'model/Animal', 'model/AnimalFarm', 'model/ApiResponse', 'model/ArrayOfArrayOfNumberOnly', 'model/ArrayOfNumberOnly', 'model/ArrayTest', 'model/Capitalization', 'model/Category', 'model/ClassModel', 'model/Client', 'model/EnumArrays', 'model/EnumClass', 'model/EnumTest', 'model/FormatTest', 'model/HasOnlyReadOnly', 'model/List', 'model/MapTest', 'model/MixedPropertiesAndAdditionalPropertiesClass', 'model/Model200Response', 'model/ModelReturn', 'model/Name', 'model/NumberOnly', 'model/Order', 'model/OuterBoolean', 'model/OuterComposite', 'model/OuterEnum', 'model/OuterNumber', 'model/OuterString', 'model/Pet', 'model/ReadOnlyFirst', 'model/SpecialModelName', 'model/Tag', 'model/User', 'model/Cat', 'model/Dog', 'api/AnotherFakeApi', 'api/FakeApi', 'api/FakeClassnameTags123Api', 'api/PetApi', 'api/StoreApi', 'api/UserApi'], factory); } else if (typeof module === 'object' && module.exports) { // CommonJS-like environments that support module.exports, like Node. - module.exports = factory(require('./ApiClient'), require('./model/AdditionalPropertiesClass'), require('./model/Animal'), require('./model/AnimalFarm'), require('./model/ApiResponse'), require('./model/ArrayOfArrayOfNumberOnly'), require('./model/ArrayOfNumberOnly'), require('./model/ArrayTest'), require('./model/Capitalization'), require('./model/Category'), require('./model/ClassModel'), require('./model/Client'), require('./model/EnumArrays'), require('./model/EnumClass'), require('./model/EnumTest'), require('./model/FormatTest'), require('./model/HasOnlyReadOnly'), require('./model/List'), require('./model/MapTest'), require('./model/MixedPropertiesAndAdditionalPropertiesClass'), require('./model/Model200Response'), require('./model/ModelReturn'), require('./model/Name'), require('./model/NumberOnly'), require('./model/Order'), require('./model/OuterBoolean'), require('./model/OuterComposite'), require('./model/OuterEnum'), require('./model/OuterNumber'), require('./model/OuterString'), require('./model/Pet'), require('./model/ReadOnlyFirst'), require('./model/SpecialModelName'), require('./model/Tag'), require('./model/User'), require('./model/Cat'), require('./model/Dog'), require('./api/FakeApi'), require('./api/Fake_classname_tags123Api'), require('./api/PetApi'), require('./api/StoreApi'), require('./api/UserApi')); + module.exports = factory(require('./ApiClient'), require('./model/AdditionalPropertiesClass'), require('./model/Animal'), require('./model/AnimalFarm'), require('./model/ApiResponse'), require('./model/ArrayOfArrayOfNumberOnly'), require('./model/ArrayOfNumberOnly'), require('./model/ArrayTest'), require('./model/Capitalization'), require('./model/Category'), require('./model/ClassModel'), require('./model/Client'), require('./model/EnumArrays'), require('./model/EnumClass'), require('./model/EnumTest'), require('./model/FormatTest'), require('./model/HasOnlyReadOnly'), require('./model/List'), require('./model/MapTest'), require('./model/MixedPropertiesAndAdditionalPropertiesClass'), require('./model/Model200Response'), require('./model/ModelReturn'), require('./model/Name'), require('./model/NumberOnly'), require('./model/Order'), require('./model/OuterBoolean'), require('./model/OuterComposite'), require('./model/OuterEnum'), require('./model/OuterNumber'), require('./model/OuterString'), require('./model/Pet'), require('./model/ReadOnlyFirst'), require('./model/SpecialModelName'), require('./model/Tag'), require('./model/User'), require('./model/Cat'), require('./model/Dog'), require('./api/AnotherFakeApi'), require('./api/FakeApi'), require('./api/FakeClassnameTags123Api'), require('./api/PetApi'), require('./api/StoreApi'), require('./api/UserApi')); } -}(function(ApiClient, AdditionalPropertiesClass, Animal, AnimalFarm, ApiResponse, ArrayOfArrayOfNumberOnly, ArrayOfNumberOnly, ArrayTest, Capitalization, Category, ClassModel, Client, EnumArrays, EnumClass, EnumTest, FormatTest, HasOnlyReadOnly, List, MapTest, MixedPropertiesAndAdditionalPropertiesClass, Model200Response, ModelReturn, Name, NumberOnly, Order, OuterBoolean, OuterComposite, OuterEnum, OuterNumber, OuterString, Pet, ReadOnlyFirst, SpecialModelName, Tag, User, Cat, Dog, FakeApi, Fake_classname_tags123Api, PetApi, StoreApi, UserApi) { +}(function(ApiClient, AdditionalPropertiesClass, Animal, AnimalFarm, ApiResponse, ArrayOfArrayOfNumberOnly, ArrayOfNumberOnly, ArrayTest, Capitalization, Category, ClassModel, Client, EnumArrays, EnumClass, EnumTest, FormatTest, HasOnlyReadOnly, List, MapTest, MixedPropertiesAndAdditionalPropertiesClass, Model200Response, ModelReturn, Name, NumberOnly, Order, OuterBoolean, OuterComposite, OuterEnum, OuterNumber, OuterString, Pet, ReadOnlyFirst, SpecialModelName, Tag, User, Cat, Dog, AnotherFakeApi, FakeApi, FakeClassnameTags123Api, PetApi, StoreApi, UserApi) { 'use strict'; /** @@ -242,16 +242,21 @@ * @property {module:model/Dog} */ Dog: Dog, + /** + * The AnotherFakeApi service constructor. + * @property {module:api/AnotherFakeApi} + */ + AnotherFakeApi: AnotherFakeApi, /** * The FakeApi service constructor. * @property {module:api/FakeApi} */ FakeApi: FakeApi, /** - * The Fake_classname_tags123Api service constructor. - * @property {module:api/Fake_classname_tags123Api} + * The FakeClassnameTags123Api service constructor. + * @property {module:api/FakeClassnameTags123Api} */ - Fake_classname_tags123Api: Fake_classname_tags123Api, + FakeClassnameTags123Api: FakeClassnameTags123Api, /** * The PetApi service constructor. * @property {module:api/PetApi} diff --git a/samples/client/petstore/javascript-promise/test/api/AnotherFakeApi.spec.js b/samples/client/petstore/javascript-promise/test/api/AnotherFakeApi.spec.js new file mode 100644 index 000000000000..593e828d3cd5 --- /dev/null +++ b/samples/client/petstore/javascript-promise/test/api/AnotherFakeApi.spec.js @@ -0,0 +1,66 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * + * Swagger Codegen version: 2.3.0-SNAPSHOT + * + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.AnotherFakeApi(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('AnotherFakeApi', function() { + describe('testSpecialTags', function() { + it('should call testSpecialTags successfully', function(done) { + //uncomment below and update the code to test testSpecialTags + //instance.testSpecialTags(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + }); + +})); diff --git a/samples/client/petstore/javascript-promise/test/api/FakeClassnameTags123Api.spec.js b/samples/client/petstore/javascript-promise/test/api/FakeClassnameTags123Api.spec.js new file mode 100644 index 000000000000..065045595112 --- /dev/null +++ b/samples/client/petstore/javascript-promise/test/api/FakeClassnameTags123Api.spec.js @@ -0,0 +1,66 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * + * Swagger Codegen version: 2.3.0-SNAPSHOT + * + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.FakeClassnameTags123Api(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('FakeClassnameTags123Api', function() { + describe('testClassname', function() { + it('should call testClassname successfully', function(done) { + //uncomment below and update the code to test testClassname + //instance.testClassname(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + }); + +})); diff --git a/samples/client/petstore/javascript/README.md b/samples/client/petstore/javascript/README.md index 89263d30f51a..402689f894a2 100644 --- a/samples/client/petstore/javascript/README.md +++ b/samples/client/petstore/javascript/README.md @@ -95,11 +95,10 @@ Please follow the [installation](#installation) instruction and execute the foll ```javascript var SwaggerPetstore = require('swagger_petstore'); -var api = new SwaggerPetstore.FakeApi() +var api = new SwaggerPetstore.AnotherFakeApi() + +var body = new SwaggerPetstore.Client(); // {Client} client model -var opts = { - 'body': new SwaggerPetstore.OuterBoolean() // {OuterBoolean} Input boolean as post body -}; var callback = function(error, data, response) { if (error) { @@ -108,7 +107,7 @@ var callback = function(error, data, response) { console.log('API called successfully. Returned data: ' + data); } }; -api.fakeOuterBooleanSerialize(opts, callback); +api.testSpecialTags(body, callback); ``` @@ -118,6 +117,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- +*SwaggerPetstore.AnotherFakeApi* | [**testSpecialTags**](docs/AnotherFakeApi.md#testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags *SwaggerPetstore.FakeApi* | [**fakeOuterBooleanSerialize**](docs/FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | *SwaggerPetstore.FakeApi* | [**fakeOuterCompositeSerialize**](docs/FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | *SwaggerPetstore.FakeApi* | [**fakeOuterNumberSerialize**](docs/FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | @@ -126,7 +126,7 @@ Class | Method | HTTP request | Description *SwaggerPetstore.FakeApi* | [**testEndpointParameters**](docs/FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *SwaggerPetstore.FakeApi* | [**testEnumParameters**](docs/FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters *SwaggerPetstore.FakeApi* | [**testJsonFormData**](docs/FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data -*SwaggerPetstore.Fake_classname_tags123Api* | [**testClassname**](docs/Fake_classname_tags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case +*SwaggerPetstore.FakeClassnameTags123Api* | [**testClassname**](docs/FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case *SwaggerPetstore.PetApi* | [**addPet**](docs/PetApi.md#addPet) | **POST** /pet | Add a new pet to the store *SwaggerPetstore.PetApi* | [**deletePet**](docs/PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet *SwaggerPetstore.PetApi* | [**findPetsByStatus**](docs/PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status diff --git a/samples/client/petstore/javascript/docs/AnotherFakeApi.md b/samples/client/petstore/javascript/docs/AnotherFakeApi.md new file mode 100644 index 000000000000..1423cbe5056c --- /dev/null +++ b/samples/client/petstore/javascript/docs/AnotherFakeApi.md @@ -0,0 +1,55 @@ +# SwaggerPetstore.AnotherFakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**testSpecialTags**](AnotherFakeApi.md#testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags + + + +# **testSpecialTags** +> Client testSpecialTags(body) + +To test special tags + +To test special tags + +### Example +```javascript +var SwaggerPetstore = require('swagger_petstore'); + +var apiInstance = new SwaggerPetstore.AnotherFakeApi(); + +var body = new SwaggerPetstore.Client(); // Client | client model + + +var callback = function(error, data, response) { + if (error) { + console.error(error); + } else { + console.log('API called successfully. Returned data: ' + data); + } +}; +apiInstance.testSpecialTags(body, callback); +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + diff --git a/samples/client/petstore/javascript/docs/FakeClassnameTags123Api.md b/samples/client/petstore/javascript/docs/FakeClassnameTags123Api.md new file mode 100644 index 000000000000..92d5dec78e63 --- /dev/null +++ b/samples/client/petstore/javascript/docs/FakeClassnameTags123Api.md @@ -0,0 +1,60 @@ +# SwaggerPetstore.FakeClassnameTags123Api + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**testClassname**](FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case + + + +# **testClassname** +> Client testClassname(body) + +To test class name in snake case + +### Example +```javascript +var SwaggerPetstore = require('swagger_petstore'); +var defaultClient = SwaggerPetstore.ApiClient.instance; + +// Configure API key authorization: api_key_query +var api_key_query = defaultClient.authentications['api_key_query']; +api_key_query.apiKey = 'YOUR API KEY'; +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) +//api_key_query.apiKeyPrefix = 'Token'; + +var apiInstance = new SwaggerPetstore.FakeClassnameTags123Api(); + +var body = new SwaggerPetstore.Client(); // Client | client model + + +var callback = function(error, data, response) { + if (error) { + console.error(error); + } else { + console.log('API called successfully. Returned data: ' + data); + } +}; +apiInstance.testClassname(body, callback); +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +[api_key_query](../README.md#api_key_query) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + diff --git a/samples/client/petstore/javascript/package.json b/samples/client/petstore/javascript/package.json index 881163c02f41..7b90d35255f7 100644 --- a/samples/client/petstore/javascript/package.json +++ b/samples/client/petstore/javascript/package.json @@ -2,7 +2,7 @@ "name": "swagger_petstore", "version": "1.0.0", "description": "This_spec_is_mainly_for_testing_Petstore_server_and_contains_fake_endpoints_models__Please_do_not_use_this_for_any_other_purpose__Special_characters__", - "license": "Unlicense", + "license": "Apache 2.0", "main": "src/index.js", "scripts": { "test": "./node_modules/mocha/bin/mocha --recursive" diff --git a/samples/client/petstore/javascript/src/api/AnotherFakeApi.js b/samples/client/petstore/javascript/src/api/AnotherFakeApi.js new file mode 100644 index 000000000000..e8233483e190 --- /dev/null +++ b/samples/client/petstore/javascript/src/api/AnotherFakeApi.js @@ -0,0 +1,100 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * + * Swagger Codegen version: 2.3.0-SNAPSHOT + * + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient', 'model/Client'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient'), require('../model/Client')); + } else { + // Browser globals (root is window) + if (!root.SwaggerPetstore) { + root.SwaggerPetstore = {}; + } + root.SwaggerPetstore.AnotherFakeApi = factory(root.SwaggerPetstore.ApiClient, root.SwaggerPetstore.Client); + } +}(this, function(ApiClient, Client) { + 'use strict'; + + /** + * AnotherFake service. + * @module api/AnotherFakeApi + * @version 1.0.0 + */ + + /** + * Constructs a new AnotherFakeApi. + * @alias module:api/AnotherFakeApi + * @class + * @param {module:ApiClient} [apiClient] Optional API client implementation to use, + * default to {@link module:ApiClient#instance} if unspecified. + */ + var exports = function(apiClient) { + this.apiClient = apiClient || ApiClient.instance; + + + /** + * Callback function to receive the result of the testSpecialTags operation. + * @callback module:api/AnotherFakeApi~testSpecialTagsCallback + * @param {String} error Error message, if any. + * @param {module:model/Client} data The data returned by the service call. + * @param {String} response The complete HTTP response. + */ + + /** + * To test special tags + * To test special tags + * @param {module:model/Client} body client model + * @param {module:api/AnotherFakeApi~testSpecialTagsCallback} callback The callback function, accepting three arguments: error, data, response + * data is of type: {@link module:model/Client} + */ + this.testSpecialTags = 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 testSpecialTags"); + } + + + var pathParams = { + }; + var queryParams = { + }; + var collectionQueryParams = { + }; + var headerParams = { + }; + var formParams = { + }; + + var authNames = []; + var contentTypes = ['application/json']; + var accepts = ['application/json']; + var returnType = Client; + + return this.apiClient.callApi( + '/another-fake/dummy', 'PATCH', + pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, callback + ); + } + }; + + return exports; +})); diff --git a/samples/client/petstore/javascript/src/api/FakeClassnameTags123Api.js b/samples/client/petstore/javascript/src/api/FakeClassnameTags123Api.js new file mode 100644 index 000000000000..4da320263223 --- /dev/null +++ b/samples/client/petstore/javascript/src/api/FakeClassnameTags123Api.js @@ -0,0 +1,99 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * + * Swagger Codegen version: 2.3.0-SNAPSHOT + * + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient', 'model/Client'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient'), require('../model/Client')); + } else { + // Browser globals (root is window) + if (!root.SwaggerPetstore) { + root.SwaggerPetstore = {}; + } + root.SwaggerPetstore.FakeClassnameTags123Api = factory(root.SwaggerPetstore.ApiClient, root.SwaggerPetstore.Client); + } +}(this, function(ApiClient, Client) { + 'use strict'; + + /** + * FakeClassnameTags123 service. + * @module api/FakeClassnameTags123Api + * @version 1.0.0 + */ + + /** + * Constructs a new FakeClassnameTags123Api. + * @alias module:api/FakeClassnameTags123Api + * @class + * @param {module:ApiClient} [apiClient] Optional API client implementation to use, + * default to {@link module:ApiClient#instance} if unspecified. + */ + var exports = function(apiClient) { + this.apiClient = apiClient || ApiClient.instance; + + + /** + * Callback function to receive the result of the testClassname operation. + * @callback module:api/FakeClassnameTags123Api~testClassnameCallback + * @param {String} error Error message, if any. + * @param {module:model/Client} data The data returned by the service call. + * @param {String} response The complete HTTP response. + */ + + /** + * To test class name in snake case + * @param {module:model/Client} body client model + * @param {module:api/FakeClassnameTags123Api~testClassnameCallback} callback The callback function, accepting three arguments: error, data, response + * data is of type: {@link module:model/Client} + */ + 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 = { + }; + var collectionQueryParams = { + }; + var headerParams = { + }; + var formParams = { + }; + + var authNames = ['api_key_query']; + var contentTypes = ['application/json']; + var accepts = ['application/json']; + var returnType = Client; + + return this.apiClient.callApi( + '/fake_classname_test', 'PATCH', + pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, callback + ); + } + }; + + return exports; +})); diff --git a/samples/client/petstore/javascript/src/index.js b/samples/client/petstore/javascript/src/index.js index afc840ce7588..480a6d3ead39 100644 --- a/samples/client/petstore/javascript/src/index.js +++ b/samples/client/petstore/javascript/src/index.js @@ -17,12 +17,12 @@ (function(factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. - define(['ApiClient', 'model/AdditionalPropertiesClass', 'model/Animal', 'model/AnimalFarm', 'model/ApiResponse', 'model/ArrayOfArrayOfNumberOnly', 'model/ArrayOfNumberOnly', 'model/ArrayTest', 'model/Capitalization', 'model/Category', 'model/ClassModel', 'model/Client', 'model/EnumArrays', 'model/EnumClass', 'model/EnumTest', 'model/FormatTest', 'model/HasOnlyReadOnly', 'model/List', 'model/MapTest', 'model/MixedPropertiesAndAdditionalPropertiesClass', 'model/Model200Response', 'model/ModelReturn', 'model/Name', 'model/NumberOnly', 'model/Order', 'model/OuterBoolean', 'model/OuterComposite', 'model/OuterEnum', 'model/OuterNumber', 'model/OuterString', 'model/Pet', 'model/ReadOnlyFirst', 'model/SpecialModelName', 'model/Tag', 'model/User', 'model/Cat', 'model/Dog', 'api/FakeApi', 'api/Fake_classname_tags123Api', 'api/PetApi', 'api/StoreApi', 'api/UserApi'], factory); + define(['ApiClient', 'model/AdditionalPropertiesClass', 'model/Animal', 'model/AnimalFarm', 'model/ApiResponse', 'model/ArrayOfArrayOfNumberOnly', 'model/ArrayOfNumberOnly', 'model/ArrayTest', 'model/Capitalization', 'model/Category', 'model/ClassModel', 'model/Client', 'model/EnumArrays', 'model/EnumClass', 'model/EnumTest', 'model/FormatTest', 'model/HasOnlyReadOnly', 'model/List', 'model/MapTest', 'model/MixedPropertiesAndAdditionalPropertiesClass', 'model/Model200Response', 'model/ModelReturn', 'model/Name', 'model/NumberOnly', 'model/Order', 'model/OuterBoolean', 'model/OuterComposite', 'model/OuterEnum', 'model/OuterNumber', 'model/OuterString', 'model/Pet', 'model/ReadOnlyFirst', 'model/SpecialModelName', 'model/Tag', 'model/User', 'model/Cat', 'model/Dog', 'api/AnotherFakeApi', 'api/FakeApi', 'api/FakeClassnameTags123Api', 'api/PetApi', 'api/StoreApi', 'api/UserApi'], factory); } else if (typeof module === 'object' && module.exports) { // CommonJS-like environments that support module.exports, like Node. - module.exports = factory(require('./ApiClient'), require('./model/AdditionalPropertiesClass'), require('./model/Animal'), require('./model/AnimalFarm'), require('./model/ApiResponse'), require('./model/ArrayOfArrayOfNumberOnly'), require('./model/ArrayOfNumberOnly'), require('./model/ArrayTest'), require('./model/Capitalization'), require('./model/Category'), require('./model/ClassModel'), require('./model/Client'), require('./model/EnumArrays'), require('./model/EnumClass'), require('./model/EnumTest'), require('./model/FormatTest'), require('./model/HasOnlyReadOnly'), require('./model/List'), require('./model/MapTest'), require('./model/MixedPropertiesAndAdditionalPropertiesClass'), require('./model/Model200Response'), require('./model/ModelReturn'), require('./model/Name'), require('./model/NumberOnly'), require('./model/Order'), require('./model/OuterBoolean'), require('./model/OuterComposite'), require('./model/OuterEnum'), require('./model/OuterNumber'), require('./model/OuterString'), require('./model/Pet'), require('./model/ReadOnlyFirst'), require('./model/SpecialModelName'), require('./model/Tag'), require('./model/User'), require('./model/Cat'), require('./model/Dog'), require('./api/FakeApi'), require('./api/Fake_classname_tags123Api'), require('./api/PetApi'), require('./api/StoreApi'), require('./api/UserApi')); + module.exports = factory(require('./ApiClient'), require('./model/AdditionalPropertiesClass'), require('./model/Animal'), require('./model/AnimalFarm'), require('./model/ApiResponse'), require('./model/ArrayOfArrayOfNumberOnly'), require('./model/ArrayOfNumberOnly'), require('./model/ArrayTest'), require('./model/Capitalization'), require('./model/Category'), require('./model/ClassModel'), require('./model/Client'), require('./model/EnumArrays'), require('./model/EnumClass'), require('./model/EnumTest'), require('./model/FormatTest'), require('./model/HasOnlyReadOnly'), require('./model/List'), require('./model/MapTest'), require('./model/MixedPropertiesAndAdditionalPropertiesClass'), require('./model/Model200Response'), require('./model/ModelReturn'), require('./model/Name'), require('./model/NumberOnly'), require('./model/Order'), require('./model/OuterBoolean'), require('./model/OuterComposite'), require('./model/OuterEnum'), require('./model/OuterNumber'), require('./model/OuterString'), require('./model/Pet'), require('./model/ReadOnlyFirst'), require('./model/SpecialModelName'), require('./model/Tag'), require('./model/User'), require('./model/Cat'), require('./model/Dog'), require('./api/AnotherFakeApi'), require('./api/FakeApi'), require('./api/FakeClassnameTags123Api'), require('./api/PetApi'), require('./api/StoreApi'), require('./api/UserApi')); } -}(function(ApiClient, AdditionalPropertiesClass, Animal, AnimalFarm, ApiResponse, ArrayOfArrayOfNumberOnly, ArrayOfNumberOnly, ArrayTest, Capitalization, Category, ClassModel, Client, EnumArrays, EnumClass, EnumTest, FormatTest, HasOnlyReadOnly, List, MapTest, MixedPropertiesAndAdditionalPropertiesClass, Model200Response, ModelReturn, Name, NumberOnly, Order, OuterBoolean, OuterComposite, OuterEnum, OuterNumber, OuterString, Pet, ReadOnlyFirst, SpecialModelName, Tag, User, Cat, Dog, FakeApi, Fake_classname_tags123Api, PetApi, StoreApi, UserApi) { +}(function(ApiClient, AdditionalPropertiesClass, Animal, AnimalFarm, ApiResponse, ArrayOfArrayOfNumberOnly, ArrayOfNumberOnly, ArrayTest, Capitalization, Category, ClassModel, Client, EnumArrays, EnumClass, EnumTest, FormatTest, HasOnlyReadOnly, List, MapTest, MixedPropertiesAndAdditionalPropertiesClass, Model200Response, ModelReturn, Name, NumberOnly, Order, OuterBoolean, OuterComposite, OuterEnum, OuterNumber, OuterString, Pet, ReadOnlyFirst, SpecialModelName, Tag, User, Cat, Dog, AnotherFakeApi, FakeApi, FakeClassnameTags123Api, PetApi, StoreApi, UserApi) { 'use strict'; /** @@ -242,16 +242,21 @@ * @property {module:model/Dog} */ Dog: Dog, + /** + * The AnotherFakeApi service constructor. + * @property {module:api/AnotherFakeApi} + */ + AnotherFakeApi: AnotherFakeApi, /** * The FakeApi service constructor. * @property {module:api/FakeApi} */ FakeApi: FakeApi, /** - * The Fake_classname_tags123Api service constructor. - * @property {module:api/Fake_classname_tags123Api} + * The FakeClassnameTags123Api service constructor. + * @property {module:api/FakeClassnameTags123Api} */ - Fake_classname_tags123Api: Fake_classname_tags123Api, + FakeClassnameTags123Api: FakeClassnameTags123Api, /** * The PetApi service constructor. * @property {module:api/PetApi} diff --git a/samples/client/petstore/javascript/test/api/AnotherFakeApi.spec.js b/samples/client/petstore/javascript/test/api/AnotherFakeApi.spec.js new file mode 100644 index 000000000000..593e828d3cd5 --- /dev/null +++ b/samples/client/petstore/javascript/test/api/AnotherFakeApi.spec.js @@ -0,0 +1,66 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * + * Swagger Codegen version: 2.3.0-SNAPSHOT + * + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.AnotherFakeApi(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('AnotherFakeApi', function() { + describe('testSpecialTags', function() { + it('should call testSpecialTags successfully', function(done) { + //uncomment below and update the code to test testSpecialTags + //instance.testSpecialTags(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + }); + +})); diff --git a/samples/client/petstore/javascript/test/api/FakeClassnameTags123Api.spec.js b/samples/client/petstore/javascript/test/api/FakeClassnameTags123Api.spec.js new file mode 100644 index 000000000000..065045595112 --- /dev/null +++ b/samples/client/petstore/javascript/test/api/FakeClassnameTags123Api.spec.js @@ -0,0 +1,66 @@ +/** + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * + * Swagger Codegen version: 2.3.0-SNAPSHOT + * + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new SwaggerPetstore.FakeClassnameTags123Api(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('FakeClassnameTags123Api', function() { + describe('testClassname', function() { + it('should call testClassname successfully', function(done) { + //uncomment below and update the code to test testClassname + //instance.testClassname(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + }); + +}));