[JavaScript] Fix licenseNames (#6605)

* [JavaScript] Fix licenseName in package.mustache

* Fix invalid SPDX license expression in resources/2_0

* Update JavaScript samples
This commit is contained in:
Halil İbrahim Şener 2017-10-08 12:15:21 +03:00 committed by wing328
parent 8a7940f199
commit 1f9f8c5a3e
57 changed files with 1820 additions and 87 deletions

View File

@ -52,7 +52,6 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo
public static final String MODULE_NAME = "moduleName";
public static final String PROJECT_DESCRIPTION = "projectDescription";
public static final String PROJECT_VERSION = "projectVersion";
public static final String PROJECT_LICENSE_NAME = "projectLicenseName";
public static final String USE_PROMISES = "usePromises";
public static final String USE_INHERITANCE = "useInheritance";
public static final String EMIT_MODEL_METHODS = "emitModelMethods";
@ -84,7 +83,7 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo
protected String moduleName;
protected String projectDescription;
protected String projectVersion;
protected String projectLicenseName;
protected String licenseName;
protected String invokerPackage;
protected String sourceFolder = "src";
@ -179,7 +178,7 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo
"description of the project (Default: using info.description or \"Client library of <projectName>\")"));
cliOptions.add(new CliOption(PROJECT_VERSION,
"version of the project (Default: using info.version or \"1.0.0\")"));
cliOptions.add(new CliOption(PROJECT_LICENSE_NAME,
cliOptions.add(new CliOption(CodegenConstants.LICENSE_NAME,
"name of the license the project uses (Default: using info.license.name)"));
cliOptions.add(new CliOption(USE_PROMISES,
"use Promises as return values from the client API, instead of superagent callbacks")
@ -244,8 +243,8 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo
if (additionalProperties.containsKey(PROJECT_VERSION)) {
setProjectVersion(((String) additionalProperties.get(PROJECT_VERSION)));
}
if (additionalProperties.containsKey(PROJECT_LICENSE_NAME)) {
setProjectLicenseName(((String) additionalProperties.get(PROJECT_LICENSE_NAME)));
if (additionalProperties.containsKey(CodegenConstants.LICENSE_NAME)) {
setLicenseName(((String) additionalProperties.get(CodegenConstants.LICENSE_NAME)));
}
if (additionalProperties.containsKey(CodegenConstants.LOCAL_VARIABLE_PREFIX)) {
setLocalVariablePrefix((String) additionalProperties.get(CodegenConstants.LOCAL_VARIABLE_PREFIX));
@ -291,12 +290,11 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo
// when projectDescription is not specified, use info.description
projectDescription = sanitizeName(info.getDescription());
}
if (additionalProperties.get(PROJECT_LICENSE_NAME) == null) {
// when projectLicense is not specified, use info.license
if (info.getLicense() != null) {
License license = info.getLicense();
additionalProperties.put(PROJECT_LICENSE_NAME, sanitizeName(license.getName()));
}
// when licenceName is not specified, use info.license
if (additionalProperties.get(CodegenConstants.LICENSE_NAME) == null && info.getLicense() != null) {
License license = info.getLicense();
licenseName = license.getName();
}
}
@ -313,11 +311,15 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo
if (projectDescription == null) {
projectDescription = "Client library of " + projectName;
}
if (StringUtils.isBlank(licenseName)) {
licenseName = "Unlicense";
}
additionalProperties.put(PROJECT_NAME, projectName);
additionalProperties.put(MODULE_NAME, moduleName);
additionalProperties.put(PROJECT_DESCRIPTION, escapeText(projectDescription));
additionalProperties.put(PROJECT_VERSION, projectVersion);
additionalProperties.put(CodegenConstants.LICENSE_NAME, licenseName);
additionalProperties.put(CodegenConstants.API_PACKAGE, apiPackage);
additionalProperties.put(CodegenConstants.INVOKER_PACKAGE, invokerPackage);
additionalProperties.put(CodegenConstants.LOCAL_VARIABLE_PREFIX, localVariablePrefix);
@ -422,8 +424,8 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo
this.projectVersion = projectVersion;
}
public void setProjectLicenseName(String projectLicenseName) {
this.projectLicenseName = projectLicenseName;
public void setLicenseName(String licenseName) {
this.licenseName = licenseName;
}
public void setUsePromises(boolean usePromises) {

View File

@ -2,7 +2,7 @@
"name": "{{{projectName}}}",
"version": "{{{projectVersion}}}",
"description": "{{{projectDescription}}}",
"license": "Unlicense",
"license": "{{licenseName}}",
"main": "{{sourceFolder}}{{#invokerPackage}}/{{invokerPackage}}{{/invokerPackage}}/index.js",
"scripts": {
"test": "mocha --compilers js:babel-core/register --recursive"

View File

@ -2,7 +2,7 @@
"name": "{{{projectName}}}",
"version": "{{{projectVersion}}}",
"description": "{{{projectDescription}}}",
"license": "Unlicense",
"license": "{{licenseName}}",
"main": "{{sourceFolder}}{{#invokerPackage}}/{{invokerPackage}}{{/invokerPackage}}/index.js",
"scripts": {
"test": "./node_modules/mocha/bin/mocha --recursive"

View File

@ -58,7 +58,7 @@ public class JavaScriptClientOptionsTest extends AbstractOptionsTest {
times = 1;
clientCodegen.setProjectVersion(JavaScriptOptionsProvider.PROJECT_VERSION_VALUE);
times = 1;
clientCodegen.setProjectLicenseName(JavaScriptOptionsProvider.PROJECT_LICENSE_NAME_VALUE);
clientCodegen.setLicenseName(JavaScriptOptionsProvider.PROJECT_LICENSE_NAME_VALUE);
times = 1;
clientCodegen.setUsePromises(Boolean.valueOf(JavaScriptOptionsProvider.USE_PROMISES_VALUE));
times = 1;

View File

@ -1,7 +1,6 @@
package io.swagger.codegen.options;
import io.swagger.codegen.CodegenConstants;
import io.swagger.codegen.options.OptionsProvider;
import io.swagger.codegen.languages.JavascriptClientCodegen;
import com.google.common.collect.ImmutableMap;
@ -56,7 +55,7 @@ public class JavaScriptOptionsProvider implements OptionsProvider {
.put(JavascriptClientCodegen.MODULE_NAME, MODULE_NAME_VALUE)
.put(JavascriptClientCodegen.PROJECT_DESCRIPTION, PROJECT_DESCRIPTION_VALUE)
.put(JavascriptClientCodegen.PROJECT_VERSION, PROJECT_VERSION_VALUE)
.put(JavascriptClientCodegen.PROJECT_LICENSE_NAME, PROJECT_LICENSE_NAME_VALUE)
.put(CodegenConstants.LICENSE_NAME, PROJECT_LICENSE_NAME_VALUE)
.put(JavascriptClientCodegen.USE_PROMISES, USE_PROMISES_VALUE)
.put(JavascriptClientCodegen.USE_INHERITANCE, USE_INHERITANCE_VALUE)
.put(JavascriptClientCodegen.EMIT_MODEL_METHODS, EMIT_MODEL_METHODS_VALUE)

View File

@ -6,7 +6,7 @@
"title": "Swagger Petstore",
"termsOfService": "http://helloreverb.com/terms/",
"license": {
"name": "Apache 2.0",
"name": "Apache-2.0",
"url": "http://www.apache.org/licenses/LICENSE-2.0.html"
}
},

View File

@ -6,7 +6,7 @@
"title": "Swagger Petstore",
"termsOfService": "http://helloreverb.com/terms/",
"license": {
"name": "Apache 2.0",
"name": "Apache-2.0",
"url": "http://www.apache.org/licenses/LICENSE-2.0.html"
}
},

View File

@ -4,7 +4,7 @@
"version": "1.0.0",
"title": "File Response Test",
"license": {
"name": "Apache 2.0",
"name": "Apache-2.0",
"url": "http://www.apache.org/licenses/LICENSE-2.0.html"
}
},

View File

@ -9,7 +9,7 @@
"email": "apiteam@swagger.io"
},
"license": {
"name": "Apache 2.0",
"name": "Apache-2.0",
"url": "http://www.apache.org/licenses/LICENSE-2.0.html"
}
},

View File

@ -9,7 +9,7 @@
"email": "apiteam@swagger.io"
},
"license": {
"name": "Apache 2.0",
"name": "Apache-2.0",
"url": "http://www.apache.org/licenses/LICENSE-2.0.html"
}
},

View File

@ -9,7 +9,7 @@
"email":"apiteam@swagger.io"
},
"license":{
"name":"Apache 2.0",
"name":"Apache-2.0",
"url":"http://www.apache.org/licenses/LICENSE-2.0.html"
}
},
@ -1053,4 +1053,4 @@
"description":"Find out more about Swagger",
"url":"http://swagger.io"
}
}
}

View File

@ -9,7 +9,7 @@
"email": "apiteam@swagger.io"
},
"license": {
"name": "Apache 2.0",
"name": "Apache-2.0",
"url": "http://www.apache.org/licenses/LICENSE-2.0.html"
}
},

View File

@ -7,7 +7,7 @@ info:
contact:
email: apiteam@swagger.io */ ' " =end -- \r\n \n \r
license:
name: Apache 2.0 */ ' " =end -- \r\n \n \r
name: Apache-2.0 */ ' " =end -- \r\n \n \r
url: http://www.apache.org/licenses/LICENSE-2.0.html */ ' " =end -- \r\n \n \r
host: petstore.swagger.io */ ' " =end -- \r\n \n \r
basePath: /v2 */ ' " =end -- \r\n \n \r

View File

@ -7,7 +7,7 @@ info:
contact:
email: apiteam@swagger.io
license:
name: Apache 2.0
name: Apache-2.0
url: 'http://www.apache.org/licenses/LICENSE-2.0.html'
host: petstore.swagger.io
basePath: /v2

View File

@ -7,7 +7,7 @@ info:
contact:
email: apiteam@swagger.io
license:
name: Apache 2.0
name: Apache-2.0
url: 'http://www.apache.org/licenses/LICENSE-2.0.html'
host: petstore.swagger.io:80
basePath: /v2

View File

@ -9,7 +9,7 @@
"email": "apiteam@wordnik.com"
},
"license": {
"name": "Apache 2.0",
"name": "Apache-2.0",
"url": "http://www.apache.org/licenses/LICENSE-2.0.html"
}
},

View File

@ -7,7 +7,7 @@ info:
contact:
email: apiteam@swagger.io
license:
name: Apache 2.0
name: Apache-2.0
url: 'http://www.apache.org/licenses/LICENSE-2.0.html'
host: petstore.swagger.io
basePath: /v2

View File

@ -9,7 +9,7 @@
"name": "apiteam@swagger.io"
},
"license": {
"name": "Apache 2.0",
"name": "Apache-2.0",
"url": "http://www.apache.org/licenses/LICENSE-2.0.html"
}
},
@ -99,4 +99,4 @@
}
}
}
}
}

View File

@ -9,7 +9,7 @@
"email": "apiteam@swagger.io"
},
"license": {
"name": "Apache 2.0",
"name": "Apache-2.0",
"url": "http://www.apache.org/licenses/LICENSE-2.0.html"
}
},
@ -92,4 +92,4 @@
}
}
}
}
}

View File

@ -4,7 +4,7 @@ info:
version: 1.0.0
title: Response header test
license:
name: Apache 2.0
name: Apache-2.0
url: 'http://www.apache.org/licenses/LICENSE-2.0.html'
basePath: /
schemes:
@ -38,4 +38,4 @@ paths:
type: "integer"
description: "I am the error code"
'400':
description: Invalid ID supplied
description: Invalid ID supplied

View File

@ -9,7 +9,7 @@
"email": "apiteam@swagger.io"
},
"license": {
"name": "Apache 2.0",
"name": "Apache-2.0",
"url": "http://www.apache.org/licenses/LICENSE-2.0.html"
}
},
@ -138,4 +138,4 @@
}
}
}
}
}

View File

@ -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

View File

@ -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
<a name="testSpecialTags"></a>
# **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

View File

@ -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
<a name="testClassname"></a>
# **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

View File

@ -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"

View File

@ -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
);
}
}

View File

@ -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
);
}
}

View File

@ -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.

View File

@ -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();
});
});
});
}));

View File

@ -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();
});
});
});
}));

View File

@ -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

View File

@ -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
<a name="testSpecialTags"></a>
# **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

View File

@ -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
<a name="testClassname"></a>
# **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

View File

@ -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"

View File

@ -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;
});
}
}

View File

@ -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;
});
}
}

View File

@ -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.

View File

@ -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();
});
});
});
}));

View File

@ -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();
});
});
});
}));

View File

@ -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

View File

@ -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
<a name="testSpecialTags"></a>
# **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

View File

@ -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
<a name="testClassname"></a>
# **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

View File

@ -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"

View File

@ -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;
}));

View File

@ -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;
}));

View File

@ -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}

View File

@ -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();
});
});
});
}));

View File

@ -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();
});
});
});
}));

View File

@ -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

View File

@ -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
<a name="testSpecialTags"></a>
# **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

View File

@ -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
<a name="testClassname"></a>
# **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

View File

@ -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"

View File

@ -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;
}));

View File

@ -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;
}));

View File

@ -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}

View File

@ -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();
});
});
});
}));

View File

@ -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();
});
});
});
}));