forked from loafle/openapi-generator-original
Add multiple servers support to JS API client (#1974)
* add multiple servers support to JS ES6 * multiple server support in js es5 * using exports in es5 * fix index check * add oas v3 js es6 client to travis
This commit is contained in:
parent
046db19a85
commit
83d34bd8d7
34
bin/openapi3/javascript-es6-petstore.sh
Executable file
34
bin/openapi3/javascript-es6-petstore.sh
Executable file
@ -0,0 +1,34 @@
|
||||
#!/bin/sh
|
||||
|
||||
SCRIPT="$0"
|
||||
echo "# START SCRIPT: $SCRIPT"
|
||||
|
||||
while [ -h "$SCRIPT" ] ; do
|
||||
ls=`ls -ld "$SCRIPT"`
|
||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||
if expr "$link" : '/.*' > /dev/null; then
|
||||
SCRIPT="$link"
|
||||
else
|
||||
SCRIPT=`dirname "$SCRIPT"`/"$link"
|
||||
fi
|
||||
done
|
||||
|
||||
if [ ! -d "${APP_DIR}" ]; then
|
||||
APP_DIR=`dirname "$SCRIPT"`/..
|
||||
APP_DIR=`cd "${APP_DIR}"; pwd`
|
||||
fi
|
||||
|
||||
executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
|
||||
|
||||
if [ ! -f "$executable" ]
|
||||
then
|
||||
mvn -B clean package
|
||||
fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/Javascript/es6 \
|
||||
-i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -g javascript \
|
||||
-o samples/openapi3/client/petstore/javascript-es6 $@"
|
||||
|
||||
java -DappName=PetstoreClient $JAVA_OPTS -jar $executable $ags
|
@ -594,6 +594,71 @@
|
||||
}
|
||||
};
|
||||
|
||||
{{#emitJSDoc}}
|
||||
/**
|
||||
* Gets an array of host settings
|
||||
* @returns An array of host settings
|
||||
*/
|
||||
{{/emitJSDoc}}
|
||||
exports.hostSettings = function() {
|
||||
return [
|
||||
{{#servers}}
|
||||
{
|
||||
'url': "{{{url}}}",
|
||||
'description': "{{{description}}}{{^description}}No description provided{{/description}}",
|
||||
{{#variables}}
|
||||
{{#-first}}
|
||||
'variables': {
|
||||
{{/-first}}
|
||||
{{{name}}}: {
|
||||
'description': "{{{description}}}{{^description}}No description provided{{/description}}",
|
||||
'default_value': "{{{defaultValue}}}",
|
||||
{{#enumValues}}
|
||||
{{#-first}}
|
||||
'enum_values': [
|
||||
{{/-first}}
|
||||
"{{{.}}}"{{^-last}},{{/-last}}
|
||||
{{#-last}}
|
||||
]
|
||||
{{/-last}}
|
||||
{{/enumValues}}
|
||||
}{{^-last}},{{/-last}}
|
||||
{{#-last}}
|
||||
}
|
||||
{{/-last}}
|
||||
{{/variables}}
|
||||
}{{^-last}},{{/-last}}
|
||||
{{/servers}}
|
||||
];
|
||||
};
|
||||
|
||||
exports.getBasePathFromSettings = function(index, variables={}) {
|
||||
var servers = this.hostSettings();
|
||||
|
||||
// check array index out of bound
|
||||
if (index < 0 || index >= servers.length) {
|
||||
throw new Error("Invalid index " + index + " when selecting the host settings. Must be less than " + servers.length);
|
||||
}
|
||||
|
||||
var server = servers[index];
|
||||
var url = server['url'];
|
||||
|
||||
// go through variable and assign a value
|
||||
for (var variable_name in server['variables']) {
|
||||
if (variable_name in variables) {
|
||||
if (server['variables'][variable_name]['enum_values'].includes(variables[variable_name])) {
|
||||
url = url.replace("{" + variable_name + "}", variables[variable_name]);
|
||||
} else {
|
||||
throw new Error("The variable `" + variable_name + "` in the host URL has invalid value " + variables[variable_name] + ". Must be " + server['variables'][variable_name]['enum_values'] + ".");
|
||||
}
|
||||
} else {
|
||||
// use default value
|
||||
url = url.replace("{" + variable_name + "}", server['variables'][variable_name]['default_value'])
|
||||
}
|
||||
}
|
||||
return url;
|
||||
};
|
||||
|
||||
{{#emitJSDoc}} /**
|
||||
* Constructs a new map or array model from REST data.
|
||||
* @param data {Object|Array} The REST data.
|
||||
|
@ -560,6 +560,71 @@ class ApiClient {
|
||||
}
|
||||
}
|
||||
|
||||
{{#emitJSDoc}}
|
||||
/**
|
||||
* Gets an array of host settings
|
||||
* @returns An array of host settings
|
||||
*/
|
||||
{{/emitJSDoc}}
|
||||
hostSettings() {
|
||||
return [
|
||||
{{#servers}}
|
||||
{
|
||||
'url': "{{{url}}}",
|
||||
'description': "{{{description}}}{{^description}}No description provided{{/description}}",
|
||||
{{#variables}}
|
||||
{{#-first}}
|
||||
'variables': {
|
||||
{{/-first}}
|
||||
{{{name}}}: {
|
||||
'description': "{{{description}}}{{^description}}No description provided{{/description}}",
|
||||
'default_value': "{{{defaultValue}}}",
|
||||
{{#enumValues}}
|
||||
{{#-first}}
|
||||
'enum_values': [
|
||||
{{/-first}}
|
||||
"{{{.}}}"{{^-last}},{{/-last}}
|
||||
{{#-last}}
|
||||
]
|
||||
{{/-last}}
|
||||
{{/enumValues}}
|
||||
}{{^-last}},{{/-last}}
|
||||
{{#-last}}
|
||||
}
|
||||
{{/-last}}
|
||||
{{/variables}}
|
||||
}{{^-last}},{{/-last}}
|
||||
{{/servers}}
|
||||
];
|
||||
}
|
||||
|
||||
getBasePathFromSettings(index, variables={}) {
|
||||
var servers = this.hostSettings();
|
||||
|
||||
// check array index out of bound
|
||||
if (index < 0 || index >= servers.length) {
|
||||
throw new Error("Invalid index " + index + " when selecting the host settings. Must be less than " + servers.length);
|
||||
}
|
||||
|
||||
var server = servers[index];
|
||||
var url = server['url'];
|
||||
|
||||
// go through variable and assign a value
|
||||
for (var variable_name in server['variables']) {
|
||||
if (variable_name in variables) {
|
||||
if (server['variables'][variable_name]['enum_values'].includes(variables[variable_name])) {
|
||||
url = url.replace("{" + variable_name + "}", variables[variable_name]);
|
||||
} else {
|
||||
throw new Error("The variable `" + variable_name + "` in the host URL has invalid value " + variables[variable_name] + ". Must be " + server['variables'][variable_name]['enum_values'] + ".");
|
||||
}
|
||||
} else {
|
||||
// use default value
|
||||
url = url.replace("{" + variable_name + "}", server['variables'][variable_name]['default_value'])
|
||||
}
|
||||
}
|
||||
return url;
|
||||
}
|
||||
|
||||
{{#emitJSDoc}}/**
|
||||
* Constructs a new map or array model from REST data.
|
||||
* @param data {Object|Array} The REST data.
|
||||
|
1
pom.xml
1
pom.xml
@ -1034,6 +1034,7 @@
|
||||
<module>samples/server/petstore/php-slim</module>
|
||||
<module>samples/client/petstore/javascript</module>
|
||||
<module>samples/client/petstore/javascript-es6</module>
|
||||
<module>samples/openapi3/client/petstore/javascript-es6</module>
|
||||
<module>samples/client/petstore/javascript-promise</module>
|
||||
<module>samples/client/petstore/javascript-promise-es6</module>
|
||||
<module>samples/client/petstore/javascript-flowtyped</module>
|
||||
|
@ -162,6 +162,8 @@ Class | Method | HTTP request | Description
|
||||
- [OpenApiPetstore.ReadOnlyFirst](docs/ReadOnlyFirst.md)
|
||||
- [OpenApiPetstore.SpecialModelName](docs/SpecialModelName.md)
|
||||
- [OpenApiPetstore.Tag](docs/Tag.md)
|
||||
- [OpenApiPetstore.TypeHolderDefault](docs/TypeHolderDefault.md)
|
||||
- [OpenApiPetstore.TypeHolderExample](docs/TypeHolderExample.md)
|
||||
- [OpenApiPetstore.User](docs/User.md)
|
||||
|
||||
|
||||
|
@ -0,0 +1,12 @@
|
||||
# OpenApiPetstore.TypeHolderDefault
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**stringItem** | **String** | | [default to 'what']
|
||||
**numberItem** | **Number** | |
|
||||
**integerItem** | **Number** | |
|
||||
**boolItem** | **Boolean** | | [default to true]
|
||||
**arrayItem** | **[Number]** | |
|
||||
|
||||
|
@ -0,0 +1,12 @@
|
||||
# OpenApiPetstore.TypeHolderExample
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**stringItem** | **String** | |
|
||||
**numberItem** | **Number** | |
|
||||
**integerItem** | **Number** | |
|
||||
**boolItem** | **Boolean** | |
|
||||
**arrayItem** | **[Number]** | |
|
||||
|
||||
|
3511
samples/client/petstore/javascript-es6/package-lock.json
generated
Normal file
3511
samples/client/petstore/javascript-es6/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -537,6 +537,46 @@ class ApiClient {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets an array of host settings
|
||||
* @returns An array of host settings
|
||||
*/
|
||||
hostSettings() {
|
||||
return [
|
||||
{
|
||||
'url': "http://petstore.swagger.io:80/v2",
|
||||
'description': "No description provided",
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
getBasePathFromSettings(index, variables={}) {
|
||||
var servers = this.hostSettings();
|
||||
|
||||
// check array index out of bound
|
||||
if (index < 0 || index >= servers.length) {
|
||||
throw new Error("Invalid index " + index + " when selecting the host settings. Must be less than " + servers.length);
|
||||
}
|
||||
|
||||
var server = servers[index];
|
||||
var url = server['url'];
|
||||
|
||||
// go through variable and assign a value
|
||||
for (var variable_name in server['variables']) {
|
||||
if (variable_name in variables) {
|
||||
if (server['variables'][variable_name]['enum_values'].includes(variables[variable_name])) {
|
||||
url = url.replace("{" + variable_name + "}", variables[variable_name]);
|
||||
} else {
|
||||
throw new Error("The variable `" + variable_name + "` in the host URL has invalid value " + variables[variable_name] + ". Must be " + server['variables'][variable_name]['enum_values'] + ".");
|
||||
}
|
||||
} else {
|
||||
// use default value
|
||||
url = url.replace("{" + variable_name + "}", server['variables'][variable_name]['default_value'])
|
||||
}
|
||||
}
|
||||
return url;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a new map or array model from REST data.
|
||||
* @param data {Object|Array} The REST data.
|
||||
|
@ -46,6 +46,8 @@ import Pet from './model/Pet';
|
||||
import ReadOnlyFirst from './model/ReadOnlyFirst';
|
||||
import SpecialModelName from './model/SpecialModelName';
|
||||
import Tag from './model/Tag';
|
||||
import TypeHolderDefault from './model/TypeHolderDefault';
|
||||
import TypeHolderExample from './model/TypeHolderExample';
|
||||
import User from './model/User';
|
||||
import AnotherFakeApi from './api/AnotherFakeApi';
|
||||
import FakeApi from './api/FakeApi';
|
||||
@ -291,6 +293,18 @@ export {
|
||||
*/
|
||||
Tag,
|
||||
|
||||
/**
|
||||
* The TypeHolderDefault model constructor.
|
||||
* @property {module:model/TypeHolderDefault}
|
||||
*/
|
||||
TypeHolderDefault,
|
||||
|
||||
/**
|
||||
* The TypeHolderExample model constructor.
|
||||
* @property {module:model/TypeHolderExample}
|
||||
*/
|
||||
TypeHolderExample,
|
||||
|
||||
/**
|
||||
* The User model constructor.
|
||||
* @property {module:model/User}
|
||||
|
@ -0,0 +1,115 @@
|
||||
/**
|
||||
* OpenAPI 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
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
*/
|
||||
|
||||
import ApiClient from '../ApiClient';
|
||||
|
||||
/**
|
||||
* The TypeHolderDefault model module.
|
||||
* @module model/TypeHolderDefault
|
||||
* @version 1.0.0
|
||||
*/
|
||||
class TypeHolderDefault {
|
||||
/**
|
||||
* Constructs a new <code>TypeHolderDefault</code>.
|
||||
* @alias module:model/TypeHolderDefault
|
||||
* @param stringItem {String}
|
||||
* @param numberItem {Number}
|
||||
* @param integerItem {Number}
|
||||
* @param boolItem {Boolean}
|
||||
* @param arrayItem {Array.<Number>}
|
||||
*/
|
||||
constructor(stringItem, numberItem, integerItem, boolItem, arrayItem) {
|
||||
|
||||
TypeHolderDefault.initialize(this, stringItem, numberItem, integerItem, boolItem, arrayItem);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes the fields of this object.
|
||||
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
|
||||
* Only for internal use.
|
||||
*/
|
||||
static initialize(obj, stringItem, numberItem, integerItem, boolItem, arrayItem) {
|
||||
obj['string_item'] = stringItem;
|
||||
obj['number_item'] = numberItem;
|
||||
obj['integer_item'] = integerItem;
|
||||
obj['bool_item'] = boolItem;
|
||||
obj['array_item'] = arrayItem;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a <code>TypeHolderDefault</code> from a plain JavaScript object, optionally creating a new instance.
|
||||
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
||||
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
||||
* @param {module:model/TypeHolderDefault} obj Optional instance to populate.
|
||||
* @return {module:model/TypeHolderDefault} The populated <code>TypeHolderDefault</code> instance.
|
||||
*/
|
||||
static constructFromObject(data, obj) {
|
||||
if (data) {
|
||||
obj = obj || new TypeHolderDefault();
|
||||
|
||||
if (data.hasOwnProperty('string_item')) {
|
||||
obj['string_item'] = ApiClient.convertToType(data['string_item'], 'String');
|
||||
}
|
||||
if (data.hasOwnProperty('number_item')) {
|
||||
obj['number_item'] = ApiClient.convertToType(data['number_item'], 'Number');
|
||||
}
|
||||
if (data.hasOwnProperty('integer_item')) {
|
||||
obj['integer_item'] = ApiClient.convertToType(data['integer_item'], 'Number');
|
||||
}
|
||||
if (data.hasOwnProperty('bool_item')) {
|
||||
obj['bool_item'] = ApiClient.convertToType(data['bool_item'], 'Boolean');
|
||||
}
|
||||
if (data.hasOwnProperty('array_item')) {
|
||||
obj['array_item'] = ApiClient.convertToType(data['array_item'], ['Number']);
|
||||
}
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @member {String} string_item
|
||||
* @default 'what'
|
||||
*/
|
||||
TypeHolderDefault.prototype['string_item'] = 'what';
|
||||
|
||||
/**
|
||||
* @member {Number} number_item
|
||||
*/
|
||||
TypeHolderDefault.prototype['number_item'] = undefined;
|
||||
|
||||
/**
|
||||
* @member {Number} integer_item
|
||||
*/
|
||||
TypeHolderDefault.prototype['integer_item'] = undefined;
|
||||
|
||||
/**
|
||||
* @member {Boolean} bool_item
|
||||
* @default true
|
||||
*/
|
||||
TypeHolderDefault.prototype['bool_item'] = true;
|
||||
|
||||
/**
|
||||
* @member {Array.<Number>} array_item
|
||||
*/
|
||||
TypeHolderDefault.prototype['array_item'] = undefined;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
export default TypeHolderDefault;
|
||||
|
@ -0,0 +1,113 @@
|
||||
/**
|
||||
* OpenAPI 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
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
*/
|
||||
|
||||
import ApiClient from '../ApiClient';
|
||||
|
||||
/**
|
||||
* The TypeHolderExample model module.
|
||||
* @module model/TypeHolderExample
|
||||
* @version 1.0.0
|
||||
*/
|
||||
class TypeHolderExample {
|
||||
/**
|
||||
* Constructs a new <code>TypeHolderExample</code>.
|
||||
* @alias module:model/TypeHolderExample
|
||||
* @param stringItem {String}
|
||||
* @param numberItem {Number}
|
||||
* @param integerItem {Number}
|
||||
* @param boolItem {Boolean}
|
||||
* @param arrayItem {Array.<Number>}
|
||||
*/
|
||||
constructor(stringItem, numberItem, integerItem, boolItem, arrayItem) {
|
||||
|
||||
TypeHolderExample.initialize(this, stringItem, numberItem, integerItem, boolItem, arrayItem);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes the fields of this object.
|
||||
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
|
||||
* Only for internal use.
|
||||
*/
|
||||
static initialize(obj, stringItem, numberItem, integerItem, boolItem, arrayItem) {
|
||||
obj['string_item'] = stringItem;
|
||||
obj['number_item'] = numberItem;
|
||||
obj['integer_item'] = integerItem;
|
||||
obj['bool_item'] = boolItem;
|
||||
obj['array_item'] = arrayItem;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a <code>TypeHolderExample</code> from a plain JavaScript object, optionally creating a new instance.
|
||||
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
||||
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
||||
* @param {module:model/TypeHolderExample} obj Optional instance to populate.
|
||||
* @return {module:model/TypeHolderExample} The populated <code>TypeHolderExample</code> instance.
|
||||
*/
|
||||
static constructFromObject(data, obj) {
|
||||
if (data) {
|
||||
obj = obj || new TypeHolderExample();
|
||||
|
||||
if (data.hasOwnProperty('string_item')) {
|
||||
obj['string_item'] = ApiClient.convertToType(data['string_item'], 'String');
|
||||
}
|
||||
if (data.hasOwnProperty('number_item')) {
|
||||
obj['number_item'] = ApiClient.convertToType(data['number_item'], 'Number');
|
||||
}
|
||||
if (data.hasOwnProperty('integer_item')) {
|
||||
obj['integer_item'] = ApiClient.convertToType(data['integer_item'], 'Number');
|
||||
}
|
||||
if (data.hasOwnProperty('bool_item')) {
|
||||
obj['bool_item'] = ApiClient.convertToType(data['bool_item'], 'Boolean');
|
||||
}
|
||||
if (data.hasOwnProperty('array_item')) {
|
||||
obj['array_item'] = ApiClient.convertToType(data['array_item'], ['Number']);
|
||||
}
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @member {String} string_item
|
||||
*/
|
||||
TypeHolderExample.prototype['string_item'] = undefined;
|
||||
|
||||
/**
|
||||
* @member {Number} number_item
|
||||
*/
|
||||
TypeHolderExample.prototype['number_item'] = undefined;
|
||||
|
||||
/**
|
||||
* @member {Number} integer_item
|
||||
*/
|
||||
TypeHolderExample.prototype['integer_item'] = undefined;
|
||||
|
||||
/**
|
||||
* @member {Boolean} bool_item
|
||||
*/
|
||||
TypeHolderExample.prototype['bool_item'] = undefined;
|
||||
|
||||
/**
|
||||
* @member {Array.<Number>} array_item
|
||||
*/
|
||||
TypeHolderExample.prototype['array_item'] = undefined;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
export default TypeHolderExample;
|
||||
|
@ -0,0 +1,89 @@
|
||||
/**
|
||||
* OpenAPI 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
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* 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.OpenApiPetstore);
|
||||
}
|
||||
}(this, function(expect, OpenApiPetstore) {
|
||||
'use strict';
|
||||
|
||||
var instance;
|
||||
|
||||
beforeEach(function() {
|
||||
instance = new OpenApiPetstore.TypeHolderDefault();
|
||||
});
|
||||
|
||||
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('TypeHolderDefault', function() {
|
||||
it('should create an instance of TypeHolderDefault', function() {
|
||||
// uncomment below and update the code to test TypeHolderDefault
|
||||
//var instane = new OpenApiPetstore.TypeHolderDefault();
|
||||
//expect(instance).to.be.a(OpenApiPetstore.TypeHolderDefault);
|
||||
});
|
||||
|
||||
it('should have the property stringItem (base name: "string_item")', function() {
|
||||
// uncomment below and update the code to test the property stringItem
|
||||
//var instane = new OpenApiPetstore.TypeHolderDefault();
|
||||
//expect(instance).to.be();
|
||||
});
|
||||
|
||||
it('should have the property numberItem (base name: "number_item")', function() {
|
||||
// uncomment below and update the code to test the property numberItem
|
||||
//var instane = new OpenApiPetstore.TypeHolderDefault();
|
||||
//expect(instance).to.be();
|
||||
});
|
||||
|
||||
it('should have the property integerItem (base name: "integer_item")', function() {
|
||||
// uncomment below and update the code to test the property integerItem
|
||||
//var instane = new OpenApiPetstore.TypeHolderDefault();
|
||||
//expect(instance).to.be();
|
||||
});
|
||||
|
||||
it('should have the property boolItem (base name: "bool_item")', function() {
|
||||
// uncomment below and update the code to test the property boolItem
|
||||
//var instane = new OpenApiPetstore.TypeHolderDefault();
|
||||
//expect(instance).to.be();
|
||||
});
|
||||
|
||||
it('should have the property arrayItem (base name: "array_item")', function() {
|
||||
// uncomment below and update the code to test the property arrayItem
|
||||
//var instane = new OpenApiPetstore.TypeHolderDefault();
|
||||
//expect(instance).to.be();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
}));
|
@ -0,0 +1,89 @@
|
||||
/**
|
||||
* OpenAPI 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
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* 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.OpenApiPetstore);
|
||||
}
|
||||
}(this, function(expect, OpenApiPetstore) {
|
||||
'use strict';
|
||||
|
||||
var instance;
|
||||
|
||||
beforeEach(function() {
|
||||
instance = new OpenApiPetstore.TypeHolderExample();
|
||||
});
|
||||
|
||||
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('TypeHolderExample', function() {
|
||||
it('should create an instance of TypeHolderExample', function() {
|
||||
// uncomment below and update the code to test TypeHolderExample
|
||||
//var instane = new OpenApiPetstore.TypeHolderExample();
|
||||
//expect(instance).to.be.a(OpenApiPetstore.TypeHolderExample);
|
||||
});
|
||||
|
||||
it('should have the property stringItem (base name: "string_item")', function() {
|
||||
// uncomment below and update the code to test the property stringItem
|
||||
//var instane = new OpenApiPetstore.TypeHolderExample();
|
||||
//expect(instance).to.be();
|
||||
});
|
||||
|
||||
it('should have the property numberItem (base name: "number_item")', function() {
|
||||
// uncomment below and update the code to test the property numberItem
|
||||
//var instane = new OpenApiPetstore.TypeHolderExample();
|
||||
//expect(instance).to.be();
|
||||
});
|
||||
|
||||
it('should have the property integerItem (base name: "integer_item")', function() {
|
||||
// uncomment below and update the code to test the property integerItem
|
||||
//var instane = new OpenApiPetstore.TypeHolderExample();
|
||||
//expect(instance).to.be();
|
||||
});
|
||||
|
||||
it('should have the property boolItem (base name: "bool_item")', function() {
|
||||
// uncomment below and update the code to test the property boolItem
|
||||
//var instane = new OpenApiPetstore.TypeHolderExample();
|
||||
//expect(instance).to.be();
|
||||
});
|
||||
|
||||
it('should have the property arrayItem (base name: "array_item")', function() {
|
||||
// uncomment below and update the code to test the property arrayItem
|
||||
//var instane = new OpenApiPetstore.TypeHolderExample();
|
||||
//expect(instance).to.be();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
}));
|
@ -160,6 +160,8 @@ Class | Method | HTTP request | Description
|
||||
- [OpenApiPetstore.ReadOnlyFirst](docs/ReadOnlyFirst.md)
|
||||
- [OpenApiPetstore.SpecialModelName](docs/SpecialModelName.md)
|
||||
- [OpenApiPetstore.Tag](docs/Tag.md)
|
||||
- [OpenApiPetstore.TypeHolderDefault](docs/TypeHolderDefault.md)
|
||||
- [OpenApiPetstore.TypeHolderExample](docs/TypeHolderExample.md)
|
||||
- [OpenApiPetstore.User](docs/User.md)
|
||||
|
||||
|
||||
|
@ -0,0 +1,12 @@
|
||||
# OpenApiPetstore.TypeHolderDefault
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**stringItem** | **String** | | [default to 'what']
|
||||
**numberItem** | **Number** | |
|
||||
**integerItem** | **Number** | |
|
||||
**boolItem** | **Boolean** | | [default to true]
|
||||
**arrayItem** | **[Number]** | |
|
||||
|
||||
|
@ -0,0 +1,12 @@
|
||||
# OpenApiPetstore.TypeHolderExample
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**stringItem** | **String** | |
|
||||
**numberItem** | **Number** | |
|
||||
**integerItem** | **Number** | |
|
||||
**boolItem** | **Boolean** | |
|
||||
**arrayItem** | **[Number]** | |
|
||||
|
||||
|
@ -536,6 +536,46 @@ class ApiClient {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets an array of host settings
|
||||
* @returns An array of host settings
|
||||
*/
|
||||
hostSettings() {
|
||||
return [
|
||||
{
|
||||
'url': "http://petstore.swagger.io:80/v2",
|
||||
'description': "No description provided",
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
getBasePathFromSettings(index, variables={}) {
|
||||
var servers = this.hostSettings();
|
||||
|
||||
// check array index out of bound
|
||||
if (index < 0 || index >= servers.length) {
|
||||
throw new Error("Invalid index " + index + " when selecting the host settings. Must be less than " + servers.length);
|
||||
}
|
||||
|
||||
var server = servers[index];
|
||||
var url = server['url'];
|
||||
|
||||
// go through variable and assign a value
|
||||
for (var variable_name in server['variables']) {
|
||||
if (variable_name in variables) {
|
||||
if (server['variables'][variable_name]['enum_values'].includes(variables[variable_name])) {
|
||||
url = url.replace("{" + variable_name + "}", variables[variable_name]);
|
||||
} else {
|
||||
throw new Error("The variable `" + variable_name + "` in the host URL has invalid value " + variables[variable_name] + ". Must be " + server['variables'][variable_name]['enum_values'] + ".");
|
||||
}
|
||||
} else {
|
||||
// use default value
|
||||
url = url.replace("{" + variable_name + "}", server['variables'][variable_name]['default_value'])
|
||||
}
|
||||
}
|
||||
return url;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a new map or array model from REST data.
|
||||
* @param data {Object|Array} The REST data.
|
||||
|
@ -46,6 +46,8 @@ import Pet from './model/Pet';
|
||||
import ReadOnlyFirst from './model/ReadOnlyFirst';
|
||||
import SpecialModelName from './model/SpecialModelName';
|
||||
import Tag from './model/Tag';
|
||||
import TypeHolderDefault from './model/TypeHolderDefault';
|
||||
import TypeHolderExample from './model/TypeHolderExample';
|
||||
import User from './model/User';
|
||||
import AnotherFakeApi from './api/AnotherFakeApi';
|
||||
import FakeApi from './api/FakeApi';
|
||||
@ -291,6 +293,18 @@ export {
|
||||
*/
|
||||
Tag,
|
||||
|
||||
/**
|
||||
* The TypeHolderDefault model constructor.
|
||||
* @property {module:model/TypeHolderDefault}
|
||||
*/
|
||||
TypeHolderDefault,
|
||||
|
||||
/**
|
||||
* The TypeHolderExample model constructor.
|
||||
* @property {module:model/TypeHolderExample}
|
||||
*/
|
||||
TypeHolderExample,
|
||||
|
||||
/**
|
||||
* The User model constructor.
|
||||
* @property {module:model/User}
|
||||
|
@ -0,0 +1,115 @@
|
||||
/**
|
||||
* OpenAPI 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
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
*/
|
||||
|
||||
import ApiClient from '../ApiClient';
|
||||
|
||||
/**
|
||||
* The TypeHolderDefault model module.
|
||||
* @module model/TypeHolderDefault
|
||||
* @version 1.0.0
|
||||
*/
|
||||
class TypeHolderDefault {
|
||||
/**
|
||||
* Constructs a new <code>TypeHolderDefault</code>.
|
||||
* @alias module:model/TypeHolderDefault
|
||||
* @param stringItem {String}
|
||||
* @param numberItem {Number}
|
||||
* @param integerItem {Number}
|
||||
* @param boolItem {Boolean}
|
||||
* @param arrayItem {Array.<Number>}
|
||||
*/
|
||||
constructor(stringItem, numberItem, integerItem, boolItem, arrayItem) {
|
||||
|
||||
TypeHolderDefault.initialize(this, stringItem, numberItem, integerItem, boolItem, arrayItem);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes the fields of this object.
|
||||
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
|
||||
* Only for internal use.
|
||||
*/
|
||||
static initialize(obj, stringItem, numberItem, integerItem, boolItem, arrayItem) {
|
||||
obj['string_item'] = stringItem;
|
||||
obj['number_item'] = numberItem;
|
||||
obj['integer_item'] = integerItem;
|
||||
obj['bool_item'] = boolItem;
|
||||
obj['array_item'] = arrayItem;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a <code>TypeHolderDefault</code> from a plain JavaScript object, optionally creating a new instance.
|
||||
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
||||
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
||||
* @param {module:model/TypeHolderDefault} obj Optional instance to populate.
|
||||
* @return {module:model/TypeHolderDefault} The populated <code>TypeHolderDefault</code> instance.
|
||||
*/
|
||||
static constructFromObject(data, obj) {
|
||||
if (data) {
|
||||
obj = obj || new TypeHolderDefault();
|
||||
|
||||
if (data.hasOwnProperty('string_item')) {
|
||||
obj['string_item'] = ApiClient.convertToType(data['string_item'], 'String');
|
||||
}
|
||||
if (data.hasOwnProperty('number_item')) {
|
||||
obj['number_item'] = ApiClient.convertToType(data['number_item'], 'Number');
|
||||
}
|
||||
if (data.hasOwnProperty('integer_item')) {
|
||||
obj['integer_item'] = ApiClient.convertToType(data['integer_item'], 'Number');
|
||||
}
|
||||
if (data.hasOwnProperty('bool_item')) {
|
||||
obj['bool_item'] = ApiClient.convertToType(data['bool_item'], 'Boolean');
|
||||
}
|
||||
if (data.hasOwnProperty('array_item')) {
|
||||
obj['array_item'] = ApiClient.convertToType(data['array_item'], ['Number']);
|
||||
}
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @member {String} string_item
|
||||
* @default 'what'
|
||||
*/
|
||||
TypeHolderDefault.prototype['string_item'] = 'what';
|
||||
|
||||
/**
|
||||
* @member {Number} number_item
|
||||
*/
|
||||
TypeHolderDefault.prototype['number_item'] = undefined;
|
||||
|
||||
/**
|
||||
* @member {Number} integer_item
|
||||
*/
|
||||
TypeHolderDefault.prototype['integer_item'] = undefined;
|
||||
|
||||
/**
|
||||
* @member {Boolean} bool_item
|
||||
* @default true
|
||||
*/
|
||||
TypeHolderDefault.prototype['bool_item'] = true;
|
||||
|
||||
/**
|
||||
* @member {Array.<Number>} array_item
|
||||
*/
|
||||
TypeHolderDefault.prototype['array_item'] = undefined;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
export default TypeHolderDefault;
|
||||
|
@ -0,0 +1,113 @@
|
||||
/**
|
||||
* OpenAPI 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
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
*/
|
||||
|
||||
import ApiClient from '../ApiClient';
|
||||
|
||||
/**
|
||||
* The TypeHolderExample model module.
|
||||
* @module model/TypeHolderExample
|
||||
* @version 1.0.0
|
||||
*/
|
||||
class TypeHolderExample {
|
||||
/**
|
||||
* Constructs a new <code>TypeHolderExample</code>.
|
||||
* @alias module:model/TypeHolderExample
|
||||
* @param stringItem {String}
|
||||
* @param numberItem {Number}
|
||||
* @param integerItem {Number}
|
||||
* @param boolItem {Boolean}
|
||||
* @param arrayItem {Array.<Number>}
|
||||
*/
|
||||
constructor(stringItem, numberItem, integerItem, boolItem, arrayItem) {
|
||||
|
||||
TypeHolderExample.initialize(this, stringItem, numberItem, integerItem, boolItem, arrayItem);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes the fields of this object.
|
||||
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
|
||||
* Only for internal use.
|
||||
*/
|
||||
static initialize(obj, stringItem, numberItem, integerItem, boolItem, arrayItem) {
|
||||
obj['string_item'] = stringItem;
|
||||
obj['number_item'] = numberItem;
|
||||
obj['integer_item'] = integerItem;
|
||||
obj['bool_item'] = boolItem;
|
||||
obj['array_item'] = arrayItem;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a <code>TypeHolderExample</code> from a plain JavaScript object, optionally creating a new instance.
|
||||
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
||||
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
||||
* @param {module:model/TypeHolderExample} obj Optional instance to populate.
|
||||
* @return {module:model/TypeHolderExample} The populated <code>TypeHolderExample</code> instance.
|
||||
*/
|
||||
static constructFromObject(data, obj) {
|
||||
if (data) {
|
||||
obj = obj || new TypeHolderExample();
|
||||
|
||||
if (data.hasOwnProperty('string_item')) {
|
||||
obj['string_item'] = ApiClient.convertToType(data['string_item'], 'String');
|
||||
}
|
||||
if (data.hasOwnProperty('number_item')) {
|
||||
obj['number_item'] = ApiClient.convertToType(data['number_item'], 'Number');
|
||||
}
|
||||
if (data.hasOwnProperty('integer_item')) {
|
||||
obj['integer_item'] = ApiClient.convertToType(data['integer_item'], 'Number');
|
||||
}
|
||||
if (data.hasOwnProperty('bool_item')) {
|
||||
obj['bool_item'] = ApiClient.convertToType(data['bool_item'], 'Boolean');
|
||||
}
|
||||
if (data.hasOwnProperty('array_item')) {
|
||||
obj['array_item'] = ApiClient.convertToType(data['array_item'], ['Number']);
|
||||
}
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @member {String} string_item
|
||||
*/
|
||||
TypeHolderExample.prototype['string_item'] = undefined;
|
||||
|
||||
/**
|
||||
* @member {Number} number_item
|
||||
*/
|
||||
TypeHolderExample.prototype['number_item'] = undefined;
|
||||
|
||||
/**
|
||||
* @member {Number} integer_item
|
||||
*/
|
||||
TypeHolderExample.prototype['integer_item'] = undefined;
|
||||
|
||||
/**
|
||||
* @member {Boolean} bool_item
|
||||
*/
|
||||
TypeHolderExample.prototype['bool_item'] = undefined;
|
||||
|
||||
/**
|
||||
* @member {Array.<Number>} array_item
|
||||
*/
|
||||
TypeHolderExample.prototype['array_item'] = undefined;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
export default TypeHolderExample;
|
||||
|
@ -0,0 +1,89 @@
|
||||
/**
|
||||
* OpenAPI 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
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* 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.OpenApiPetstore);
|
||||
}
|
||||
}(this, function(expect, OpenApiPetstore) {
|
||||
'use strict';
|
||||
|
||||
var instance;
|
||||
|
||||
beforeEach(function() {
|
||||
instance = new OpenApiPetstore.TypeHolderDefault();
|
||||
});
|
||||
|
||||
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('TypeHolderDefault', function() {
|
||||
it('should create an instance of TypeHolderDefault', function() {
|
||||
// uncomment below and update the code to test TypeHolderDefault
|
||||
//var instane = new OpenApiPetstore.TypeHolderDefault();
|
||||
//expect(instance).to.be.a(OpenApiPetstore.TypeHolderDefault);
|
||||
});
|
||||
|
||||
it('should have the property stringItem (base name: "string_item")', function() {
|
||||
// uncomment below and update the code to test the property stringItem
|
||||
//var instane = new OpenApiPetstore.TypeHolderDefault();
|
||||
//expect(instance).to.be();
|
||||
});
|
||||
|
||||
it('should have the property numberItem (base name: "number_item")', function() {
|
||||
// uncomment below and update the code to test the property numberItem
|
||||
//var instane = new OpenApiPetstore.TypeHolderDefault();
|
||||
//expect(instance).to.be();
|
||||
});
|
||||
|
||||
it('should have the property integerItem (base name: "integer_item")', function() {
|
||||
// uncomment below and update the code to test the property integerItem
|
||||
//var instane = new OpenApiPetstore.TypeHolderDefault();
|
||||
//expect(instance).to.be();
|
||||
});
|
||||
|
||||
it('should have the property boolItem (base name: "bool_item")', function() {
|
||||
// uncomment below and update the code to test the property boolItem
|
||||
//var instane = new OpenApiPetstore.TypeHolderDefault();
|
||||
//expect(instance).to.be();
|
||||
});
|
||||
|
||||
it('should have the property arrayItem (base name: "array_item")', function() {
|
||||
// uncomment below and update the code to test the property arrayItem
|
||||
//var instane = new OpenApiPetstore.TypeHolderDefault();
|
||||
//expect(instance).to.be();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
}));
|
@ -0,0 +1,89 @@
|
||||
/**
|
||||
* OpenAPI 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
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* 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.OpenApiPetstore);
|
||||
}
|
||||
}(this, function(expect, OpenApiPetstore) {
|
||||
'use strict';
|
||||
|
||||
var instance;
|
||||
|
||||
beforeEach(function() {
|
||||
instance = new OpenApiPetstore.TypeHolderExample();
|
||||
});
|
||||
|
||||
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('TypeHolderExample', function() {
|
||||
it('should create an instance of TypeHolderExample', function() {
|
||||
// uncomment below and update the code to test TypeHolderExample
|
||||
//var instane = new OpenApiPetstore.TypeHolderExample();
|
||||
//expect(instance).to.be.a(OpenApiPetstore.TypeHolderExample);
|
||||
});
|
||||
|
||||
it('should have the property stringItem (base name: "string_item")', function() {
|
||||
// uncomment below and update the code to test the property stringItem
|
||||
//var instane = new OpenApiPetstore.TypeHolderExample();
|
||||
//expect(instance).to.be();
|
||||
});
|
||||
|
||||
it('should have the property numberItem (base name: "number_item")', function() {
|
||||
// uncomment below and update the code to test the property numberItem
|
||||
//var instane = new OpenApiPetstore.TypeHolderExample();
|
||||
//expect(instance).to.be();
|
||||
});
|
||||
|
||||
it('should have the property integerItem (base name: "integer_item")', function() {
|
||||
// uncomment below and update the code to test the property integerItem
|
||||
//var instane = new OpenApiPetstore.TypeHolderExample();
|
||||
//expect(instance).to.be();
|
||||
});
|
||||
|
||||
it('should have the property boolItem (base name: "bool_item")', function() {
|
||||
// uncomment below and update the code to test the property boolItem
|
||||
//var instane = new OpenApiPetstore.TypeHolderExample();
|
||||
//expect(instance).to.be();
|
||||
});
|
||||
|
||||
it('should have the property arrayItem (base name: "array_item")', function() {
|
||||
// uncomment below and update the code to test the property arrayItem
|
||||
//var instane = new OpenApiPetstore.TypeHolderExample();
|
||||
//expect(instance).to.be();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
}));
|
@ -184,6 +184,8 @@ Class | Method | HTTP request | Description
|
||||
- [OpenApiPetstore.ReadOnlyFirst](docs/ReadOnlyFirst.md)
|
||||
- [OpenApiPetstore.SpecialModelName](docs/SpecialModelName.md)
|
||||
- [OpenApiPetstore.Tag](docs/Tag.md)
|
||||
- [OpenApiPetstore.TypeHolderDefault](docs/TypeHolderDefault.md)
|
||||
- [OpenApiPetstore.TypeHolderExample](docs/TypeHolderExample.md)
|
||||
- [OpenApiPetstore.User](docs/User.md)
|
||||
|
||||
|
||||
|
@ -0,0 +1,12 @@
|
||||
# OpenApiPetstore.TypeHolderDefault
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**stringItem** | **String** | | [default to 'what']
|
||||
**numberItem** | **Number** | |
|
||||
**integerItem** | **Number** | |
|
||||
**boolItem** | **Boolean** | | [default to true]
|
||||
**arrayItem** | **[Number]** | |
|
||||
|
||||
|
@ -0,0 +1,12 @@
|
||||
# OpenApiPetstore.TypeHolderExample
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**stringItem** | **String** | |
|
||||
**numberItem** | **Number** | |
|
||||
**integerItem** | **Number** | |
|
||||
**boolItem** | **Boolean** | |
|
||||
**arrayItem** | **[Number]** | |
|
||||
|
||||
|
@ -101,6 +101,11 @@
|
||||
* Allow user to override superagent agent
|
||||
*/
|
||||
this.requestAgent = null;
|
||||
|
||||
/*
|
||||
* Allow user to add superagent plugins
|
||||
*/
|
||||
this.plugins = null;
|
||||
};
|
||||
|
||||
/**
|
||||
@ -378,6 +383,14 @@
|
||||
var url = this.buildUrl(path, pathParams);
|
||||
var request = superagent(httpMethod, url);
|
||||
|
||||
if (this.plugins !== null) {
|
||||
for (var index in this.plugins) {
|
||||
if (this.plugins.hasOwnProperty(index)) {
|
||||
request.use(this.plugins[index])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// apply authentications
|
||||
this.applyAuthToRequest(request, authNames);
|
||||
|
||||
@ -560,6 +573,46 @@
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Gets an array of host settings
|
||||
* @returns An array of host settings
|
||||
*/
|
||||
exports.hostSettings = function() {
|
||||
return [
|
||||
{
|
||||
'url': "http://petstore.swagger.io:80/v2",
|
||||
'description': "No description provided",
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
exports.getBasePathFromSettings = function(index, variables={}) {
|
||||
var servers = this.hostSettings();
|
||||
|
||||
// check array index out of bound
|
||||
if (index < 0 || index >= servers.length) {
|
||||
throw new Error("Invalid index " + index + " when selecting the host settings. Must be less than " + servers.length);
|
||||
}
|
||||
|
||||
var server = servers[index];
|
||||
var url = server['url'];
|
||||
|
||||
// go through variable and assign a value
|
||||
for (var variable_name in server['variables']) {
|
||||
if (variable_name in variables) {
|
||||
if (server['variables'][variable_name]['enum_values'].includes(variables[variable_name])) {
|
||||
url = url.replace("{" + variable_name + "}", variables[variable_name]);
|
||||
} else {
|
||||
throw new Error("The variable `" + variable_name + "` in the host URL has invalid value " + variables[variable_name] + ". Must be " + server['variables'][variable_name]['enum_values'] + ".");
|
||||
}
|
||||
} else {
|
||||
// use default value
|
||||
url = url.replace("{" + variable_name + "}", server['variables'][variable_name]['default_value'])
|
||||
}
|
||||
}
|
||||
return url;
|
||||
};
|
||||
|
||||
/**
|
||||
* Constructs a new map or array model from REST data.
|
||||
* @param data {Object|Array} The REST data.
|
||||
|
@ -16,12 +16,12 @@
|
||||
(function(factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(['ApiClient', 'model/AdditionalPropertiesClass', 'model/Animal', 'model/ApiResponse', 'model/ArrayOfArrayOfNumberOnly', 'model/ArrayOfNumberOnly', 'model/ArrayTest', 'model/Capitalization', 'model/Cat', 'model/Category', 'model/ClassModel', 'model/Client', 'model/Dog', 'model/EnumArrays', 'model/EnumClass', 'model/EnumTest', 'model/File', 'model/FileSchemaTestClass', 'model/FormatTest', 'model/HasOnlyReadOnly', 'model/List', 'model/MapTest', 'model/MixedPropertiesAndAdditionalPropertiesClass', 'model/Model200Response', 'model/ModelReturn', 'model/Name', 'model/NumberOnly', 'model/Order', 'model/OuterComposite', 'model/OuterEnum', 'model/Pet', 'model/ReadOnlyFirst', 'model/SpecialModelName', 'model/Tag', 'model/User', 'api/AnotherFakeApi', 'api/FakeApi', 'api/FakeClassnameTags123Api', 'api/PetApi', 'api/StoreApi', 'api/UserApi'], factory);
|
||||
define(['ApiClient', 'model/AdditionalPropertiesClass', 'model/Animal', 'model/ApiResponse', 'model/ArrayOfArrayOfNumberOnly', 'model/ArrayOfNumberOnly', 'model/ArrayTest', 'model/Capitalization', 'model/Cat', 'model/Category', 'model/ClassModel', 'model/Client', 'model/Dog', 'model/EnumArrays', 'model/EnumClass', 'model/EnumTest', 'model/File', 'model/FileSchemaTestClass', 'model/FormatTest', 'model/HasOnlyReadOnly', 'model/List', 'model/MapTest', 'model/MixedPropertiesAndAdditionalPropertiesClass', 'model/Model200Response', 'model/ModelReturn', 'model/Name', 'model/NumberOnly', 'model/Order', 'model/OuterComposite', 'model/OuterEnum', 'model/Pet', 'model/ReadOnlyFirst', 'model/SpecialModelName', 'model/Tag', 'model/TypeHolderDefault', 'model/TypeHolderExample', 'model/User', '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/ApiResponse'), require('./model/ArrayOfArrayOfNumberOnly'), require('./model/ArrayOfNumberOnly'), require('./model/ArrayTest'), require('./model/Capitalization'), require('./model/Cat'), require('./model/Category'), require('./model/ClassModel'), require('./model/Client'), require('./model/Dog'), require('./model/EnumArrays'), require('./model/EnumClass'), require('./model/EnumTest'), require('./model/File'), require('./model/FileSchemaTestClass'), 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/OuterComposite'), require('./model/OuterEnum'), require('./model/Pet'), require('./model/ReadOnlyFirst'), require('./model/SpecialModelName'), require('./model/Tag'), require('./model/User'), require('./api/AnotherFakeApi'), require('./api/FakeApi'), require('./api/FakeClassnameTags123Api'), require('./api/PetApi'), require('./api/StoreApi'), require('./api/UserApi'));
|
||||
module.exports = factory(require('./ApiClient'), require('./model/AdditionalPropertiesClass'), require('./model/Animal'), require('./model/ApiResponse'), require('./model/ArrayOfArrayOfNumberOnly'), require('./model/ArrayOfNumberOnly'), require('./model/ArrayTest'), require('./model/Capitalization'), require('./model/Cat'), require('./model/Category'), require('./model/ClassModel'), require('./model/Client'), require('./model/Dog'), require('./model/EnumArrays'), require('./model/EnumClass'), require('./model/EnumTest'), require('./model/File'), require('./model/FileSchemaTestClass'), 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/OuterComposite'), require('./model/OuterEnum'), require('./model/Pet'), require('./model/ReadOnlyFirst'), require('./model/SpecialModelName'), require('./model/Tag'), require('./model/TypeHolderDefault'), require('./model/TypeHolderExample'), require('./model/User'), require('./api/AnotherFakeApi'), require('./api/FakeApi'), require('./api/FakeClassnameTags123Api'), require('./api/PetApi'), require('./api/StoreApi'), require('./api/UserApi'));
|
||||
}
|
||||
}(function(ApiClient, AdditionalPropertiesClass, Animal, ApiResponse, ArrayOfArrayOfNumberOnly, ArrayOfNumberOnly, ArrayTest, Capitalization, Cat, Category, ClassModel, Client, Dog, EnumArrays, EnumClass, EnumTest, File, FileSchemaTestClass, FormatTest, HasOnlyReadOnly, List, MapTest, MixedPropertiesAndAdditionalPropertiesClass, Model200Response, ModelReturn, Name, NumberOnly, Order, OuterComposite, OuterEnum, Pet, ReadOnlyFirst, SpecialModelName, Tag, User, AnotherFakeApi, FakeApi, FakeClassnameTags123Api, PetApi, StoreApi, UserApi) {
|
||||
}(function(ApiClient, AdditionalPropertiesClass, Animal, ApiResponse, ArrayOfArrayOfNumberOnly, ArrayOfNumberOnly, ArrayTest, Capitalization, Cat, Category, ClassModel, Client, Dog, EnumArrays, EnumClass, EnumTest, File, FileSchemaTestClass, FormatTest, HasOnlyReadOnly, List, MapTest, MixedPropertiesAndAdditionalPropertiesClass, Model200Response, ModelReturn, Name, NumberOnly, Order, OuterComposite, OuterEnum, Pet, ReadOnlyFirst, SpecialModelName, Tag, TypeHolderDefault, TypeHolderExample, User, AnotherFakeApi, FakeApi, FakeClassnameTags123Api, PetApi, StoreApi, UserApi) {
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
@ -226,6 +226,16 @@
|
||||
* @property {module:model/Tag}
|
||||
*/
|
||||
Tag: Tag,
|
||||
/**
|
||||
* The TypeHolderDefault model constructor.
|
||||
* @property {module:model/TypeHolderDefault}
|
||||
*/
|
||||
TypeHolderDefault: TypeHolderDefault,
|
||||
/**
|
||||
* The TypeHolderExample model constructor.
|
||||
* @property {module:model/TypeHolderExample}
|
||||
*/
|
||||
TypeHolderExample: TypeHolderExample,
|
||||
/**
|
||||
* The User model constructor.
|
||||
* @property {module:model/User}
|
||||
|
@ -0,0 +1,118 @@
|
||||
/**
|
||||
* OpenAPI 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
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
*
|
||||
* OpenAPI Generator version: 4.0.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'], factory);
|
||||
} else if (typeof module === 'object' && module.exports) {
|
||||
// CommonJS-like environments that support module.exports, like Node.
|
||||
module.exports = factory(require('../ApiClient'));
|
||||
} else {
|
||||
// Browser globals (root is window)
|
||||
if (!root.OpenApiPetstore) {
|
||||
root.OpenApiPetstore = {};
|
||||
}
|
||||
root.OpenApiPetstore.TypeHolderDefault = factory(root.OpenApiPetstore.ApiClient);
|
||||
}
|
||||
}(this, function(ApiClient) {
|
||||
'use strict';
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* The TypeHolderDefault model module.
|
||||
* @module model/TypeHolderDefault
|
||||
* @version 1.0.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* Constructs a new <code>TypeHolderDefault</code>.
|
||||
* @alias module:model/TypeHolderDefault
|
||||
* @class
|
||||
* @param stringItem {String}
|
||||
* @param numberItem {Number}
|
||||
* @param integerItem {Number}
|
||||
* @param boolItem {Boolean}
|
||||
* @param arrayItem {Array.<Number>}
|
||||
*/
|
||||
var exports = function(stringItem, numberItem, integerItem, boolItem, arrayItem) {
|
||||
var _this = this;
|
||||
|
||||
_this['string_item'] = stringItem;
|
||||
_this['number_item'] = numberItem;
|
||||
_this['integer_item'] = integerItem;
|
||||
_this['bool_item'] = boolItem;
|
||||
_this['array_item'] = arrayItem;
|
||||
};
|
||||
|
||||
/**
|
||||
* Constructs a <code>TypeHolderDefault</code> from a plain JavaScript object, optionally creating a new instance.
|
||||
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
||||
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
||||
* @param {module:model/TypeHolderDefault} obj Optional instance to populate.
|
||||
* @return {module:model/TypeHolderDefault} The populated <code>TypeHolderDefault</code> instance.
|
||||
*/
|
||||
exports.constructFromObject = function(data, obj) {
|
||||
if (data) {
|
||||
obj = obj || new exports();
|
||||
if (data.hasOwnProperty('string_item')) {
|
||||
obj['string_item'] = ApiClient.convertToType(data['string_item'], 'String');
|
||||
}
|
||||
if (data.hasOwnProperty('number_item')) {
|
||||
obj['number_item'] = ApiClient.convertToType(data['number_item'], 'Number');
|
||||
}
|
||||
if (data.hasOwnProperty('integer_item')) {
|
||||
obj['integer_item'] = ApiClient.convertToType(data['integer_item'], 'Number');
|
||||
}
|
||||
if (data.hasOwnProperty('bool_item')) {
|
||||
obj['bool_item'] = ApiClient.convertToType(data['bool_item'], 'Boolean');
|
||||
}
|
||||
if (data.hasOwnProperty('array_item')) {
|
||||
obj['array_item'] = ApiClient.convertToType(data['array_item'], ['Number']);
|
||||
}
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
|
||||
/**
|
||||
* @member {String} string_item
|
||||
* @default 'what'
|
||||
*/
|
||||
exports.prototype['string_item'] = 'what';
|
||||
/**
|
||||
* @member {Number} number_item
|
||||
*/
|
||||
exports.prototype['number_item'] = undefined;
|
||||
/**
|
||||
* @member {Number} integer_item
|
||||
*/
|
||||
exports.prototype['integer_item'] = undefined;
|
||||
/**
|
||||
* @member {Boolean} bool_item
|
||||
* @default true
|
||||
*/
|
||||
exports.prototype['bool_item'] = true;
|
||||
/**
|
||||
* @member {Array.<Number>} array_item
|
||||
*/
|
||||
exports.prototype['array_item'] = undefined;
|
||||
|
||||
|
||||
|
||||
return exports;
|
||||
}));
|
||||
|
||||
|
@ -0,0 +1,116 @@
|
||||
/**
|
||||
* OpenAPI 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
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
*
|
||||
* OpenAPI Generator version: 4.0.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'], factory);
|
||||
} else if (typeof module === 'object' && module.exports) {
|
||||
// CommonJS-like environments that support module.exports, like Node.
|
||||
module.exports = factory(require('../ApiClient'));
|
||||
} else {
|
||||
// Browser globals (root is window)
|
||||
if (!root.OpenApiPetstore) {
|
||||
root.OpenApiPetstore = {};
|
||||
}
|
||||
root.OpenApiPetstore.TypeHolderExample = factory(root.OpenApiPetstore.ApiClient);
|
||||
}
|
||||
}(this, function(ApiClient) {
|
||||
'use strict';
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* The TypeHolderExample model module.
|
||||
* @module model/TypeHolderExample
|
||||
* @version 1.0.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* Constructs a new <code>TypeHolderExample</code>.
|
||||
* @alias module:model/TypeHolderExample
|
||||
* @class
|
||||
* @param stringItem {String}
|
||||
* @param numberItem {Number}
|
||||
* @param integerItem {Number}
|
||||
* @param boolItem {Boolean}
|
||||
* @param arrayItem {Array.<Number>}
|
||||
*/
|
||||
var exports = function(stringItem, numberItem, integerItem, boolItem, arrayItem) {
|
||||
var _this = this;
|
||||
|
||||
_this['string_item'] = stringItem;
|
||||
_this['number_item'] = numberItem;
|
||||
_this['integer_item'] = integerItem;
|
||||
_this['bool_item'] = boolItem;
|
||||
_this['array_item'] = arrayItem;
|
||||
};
|
||||
|
||||
/**
|
||||
* Constructs a <code>TypeHolderExample</code> from a plain JavaScript object, optionally creating a new instance.
|
||||
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
||||
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
||||
* @param {module:model/TypeHolderExample} obj Optional instance to populate.
|
||||
* @return {module:model/TypeHolderExample} The populated <code>TypeHolderExample</code> instance.
|
||||
*/
|
||||
exports.constructFromObject = function(data, obj) {
|
||||
if (data) {
|
||||
obj = obj || new exports();
|
||||
if (data.hasOwnProperty('string_item')) {
|
||||
obj['string_item'] = ApiClient.convertToType(data['string_item'], 'String');
|
||||
}
|
||||
if (data.hasOwnProperty('number_item')) {
|
||||
obj['number_item'] = ApiClient.convertToType(data['number_item'], 'Number');
|
||||
}
|
||||
if (data.hasOwnProperty('integer_item')) {
|
||||
obj['integer_item'] = ApiClient.convertToType(data['integer_item'], 'Number');
|
||||
}
|
||||
if (data.hasOwnProperty('bool_item')) {
|
||||
obj['bool_item'] = ApiClient.convertToType(data['bool_item'], 'Boolean');
|
||||
}
|
||||
if (data.hasOwnProperty('array_item')) {
|
||||
obj['array_item'] = ApiClient.convertToType(data['array_item'], ['Number']);
|
||||
}
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
|
||||
/**
|
||||
* @member {String} string_item
|
||||
*/
|
||||
exports.prototype['string_item'] = undefined;
|
||||
/**
|
||||
* @member {Number} number_item
|
||||
*/
|
||||
exports.prototype['number_item'] = undefined;
|
||||
/**
|
||||
* @member {Number} integer_item
|
||||
*/
|
||||
exports.prototype['integer_item'] = undefined;
|
||||
/**
|
||||
* @member {Boolean} bool_item
|
||||
*/
|
||||
exports.prototype['bool_item'] = undefined;
|
||||
/**
|
||||
* @member {Array.<Number>} array_item
|
||||
*/
|
||||
exports.prototype['array_item'] = undefined;
|
||||
|
||||
|
||||
|
||||
return exports;
|
||||
}));
|
||||
|
||||
|
@ -0,0 +1,91 @@
|
||||
/**
|
||||
* OpenAPI 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
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
*
|
||||
* OpenAPI Generator version: 4.0.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.OpenApiPetstore);
|
||||
}
|
||||
}(this, function(expect, OpenApiPetstore) {
|
||||
'use strict';
|
||||
|
||||
var instance;
|
||||
|
||||
beforeEach(function() {
|
||||
instance = new OpenApiPetstore.TypeHolderDefault();
|
||||
});
|
||||
|
||||
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('TypeHolderDefault', function() {
|
||||
it('should create an instance of TypeHolderDefault', function() {
|
||||
// uncomment below and update the code to test TypeHolderDefault
|
||||
//var instance = new OpenApiPetstore.TypeHolderDefault();
|
||||
//expect(instance).to.be.a(OpenApiPetstore.TypeHolderDefault);
|
||||
});
|
||||
|
||||
it('should have the property stringItem (base name: "string_item")', function() {
|
||||
// uncomment below and update the code to test the property stringItem
|
||||
//var instance = new OpenApiPetstore.TypeHolderDefault();
|
||||
//expect(instance).to.be();
|
||||
});
|
||||
|
||||
it('should have the property numberItem (base name: "number_item")', function() {
|
||||
// uncomment below and update the code to test the property numberItem
|
||||
//var instance = new OpenApiPetstore.TypeHolderDefault();
|
||||
//expect(instance).to.be();
|
||||
});
|
||||
|
||||
it('should have the property integerItem (base name: "integer_item")', function() {
|
||||
// uncomment below and update the code to test the property integerItem
|
||||
//var instance = new OpenApiPetstore.TypeHolderDefault();
|
||||
//expect(instance).to.be();
|
||||
});
|
||||
|
||||
it('should have the property boolItem (base name: "bool_item")', function() {
|
||||
// uncomment below and update the code to test the property boolItem
|
||||
//var instance = new OpenApiPetstore.TypeHolderDefault();
|
||||
//expect(instance).to.be();
|
||||
});
|
||||
|
||||
it('should have the property arrayItem (base name: "array_item")', function() {
|
||||
// uncomment below and update the code to test the property arrayItem
|
||||
//var instance = new OpenApiPetstore.TypeHolderDefault();
|
||||
//expect(instance).to.be();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
}));
|
@ -0,0 +1,91 @@
|
||||
/**
|
||||
* OpenAPI 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
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
*
|
||||
* OpenAPI Generator version: 4.0.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.OpenApiPetstore);
|
||||
}
|
||||
}(this, function(expect, OpenApiPetstore) {
|
||||
'use strict';
|
||||
|
||||
var instance;
|
||||
|
||||
beforeEach(function() {
|
||||
instance = new OpenApiPetstore.TypeHolderExample();
|
||||
});
|
||||
|
||||
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('TypeHolderExample', function() {
|
||||
it('should create an instance of TypeHolderExample', function() {
|
||||
// uncomment below and update the code to test TypeHolderExample
|
||||
//var instance = new OpenApiPetstore.TypeHolderExample();
|
||||
//expect(instance).to.be.a(OpenApiPetstore.TypeHolderExample);
|
||||
});
|
||||
|
||||
it('should have the property stringItem (base name: "string_item")', function() {
|
||||
// uncomment below and update the code to test the property stringItem
|
||||
//var instance = new OpenApiPetstore.TypeHolderExample();
|
||||
//expect(instance).to.be();
|
||||
});
|
||||
|
||||
it('should have the property numberItem (base name: "number_item")', function() {
|
||||
// uncomment below and update the code to test the property numberItem
|
||||
//var instance = new OpenApiPetstore.TypeHolderExample();
|
||||
//expect(instance).to.be();
|
||||
});
|
||||
|
||||
it('should have the property integerItem (base name: "integer_item")', function() {
|
||||
// uncomment below and update the code to test the property integerItem
|
||||
//var instance = new OpenApiPetstore.TypeHolderExample();
|
||||
//expect(instance).to.be();
|
||||
});
|
||||
|
||||
it('should have the property boolItem (base name: "bool_item")', function() {
|
||||
// uncomment below and update the code to test the property boolItem
|
||||
//var instance = new OpenApiPetstore.TypeHolderExample();
|
||||
//expect(instance).to.be();
|
||||
});
|
||||
|
||||
it('should have the property arrayItem (base name: "array_item")', function() {
|
||||
// uncomment below and update the code to test the property arrayItem
|
||||
//var instance = new OpenApiPetstore.TypeHolderExample();
|
||||
//expect(instance).to.be();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
}));
|
@ -187,6 +187,8 @@ Class | Method | HTTP request | Description
|
||||
- [OpenApiPetstore.ReadOnlyFirst](docs/ReadOnlyFirst.md)
|
||||
- [OpenApiPetstore.SpecialModelName](docs/SpecialModelName.md)
|
||||
- [OpenApiPetstore.Tag](docs/Tag.md)
|
||||
- [OpenApiPetstore.TypeHolderDefault](docs/TypeHolderDefault.md)
|
||||
- [OpenApiPetstore.TypeHolderExample](docs/TypeHolderExample.md)
|
||||
- [OpenApiPetstore.User](docs/User.md)
|
||||
|
||||
|
||||
|
12
samples/client/petstore/javascript/docs/TypeHolderDefault.md
Normal file
12
samples/client/petstore/javascript/docs/TypeHolderDefault.md
Normal file
@ -0,0 +1,12 @@
|
||||
# OpenApiPetstore.TypeHolderDefault
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**stringItem** | **String** | | [default to 'what']
|
||||
**numberItem** | **Number** | |
|
||||
**integerItem** | **Number** | |
|
||||
**boolItem** | **Boolean** | | [default to true]
|
||||
**arrayItem** | **[Number]** | |
|
||||
|
||||
|
12
samples/client/petstore/javascript/docs/TypeHolderExample.md
Normal file
12
samples/client/petstore/javascript/docs/TypeHolderExample.md
Normal file
@ -0,0 +1,12 @@
|
||||
# OpenApiPetstore.TypeHolderExample
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**stringItem** | **String** | |
|
||||
**numberItem** | **Number** | |
|
||||
**integerItem** | **Number** | |
|
||||
**boolItem** | **Boolean** | |
|
||||
**arrayItem** | **[Number]** | |
|
||||
|
||||
|
@ -584,6 +584,46 @@
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Gets an array of host settings
|
||||
* @returns An array of host settings
|
||||
*/
|
||||
exports.hostSettings = function() {
|
||||
return [
|
||||
{
|
||||
'url': "http://petstore.swagger.io:80/v2",
|
||||
'description': "No description provided",
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
exports.getBasePathFromSettings = function(index, variables={}) {
|
||||
var servers = this.hostSettings();
|
||||
|
||||
// check array index out of bound
|
||||
if (index < 0 || index >= servers.length) {
|
||||
throw new Error("Invalid index " + index + " when selecting the host settings. Must be less than " + servers.length);
|
||||
}
|
||||
|
||||
var server = servers[index];
|
||||
var url = server['url'];
|
||||
|
||||
// go through variable and assign a value
|
||||
for (var variable_name in server['variables']) {
|
||||
if (variable_name in variables) {
|
||||
if (server['variables'][variable_name]['enum_values'].includes(variables[variable_name])) {
|
||||
url = url.replace("{" + variable_name + "}", variables[variable_name]);
|
||||
} else {
|
||||
throw new Error("The variable `" + variable_name + "` in the host URL has invalid value " + variables[variable_name] + ". Must be " + server['variables'][variable_name]['enum_values'] + ".");
|
||||
}
|
||||
} else {
|
||||
// use default value
|
||||
url = url.replace("{" + variable_name + "}", server['variables'][variable_name]['default_value'])
|
||||
}
|
||||
}
|
||||
return url;
|
||||
};
|
||||
|
||||
/**
|
||||
* Constructs a new map or array model from REST data.
|
||||
* @param data {Object|Array} The REST data.
|
||||
|
@ -16,12 +16,12 @@
|
||||
(function(factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(['ApiClient', 'model/AdditionalPropertiesClass', 'model/Animal', 'model/ApiResponse', 'model/ArrayOfArrayOfNumberOnly', 'model/ArrayOfNumberOnly', 'model/ArrayTest', 'model/Capitalization', 'model/Cat', 'model/Category', 'model/ClassModel', 'model/Client', 'model/Dog', 'model/EnumArrays', 'model/EnumClass', 'model/EnumTest', 'model/File', 'model/FileSchemaTestClass', 'model/FormatTest', 'model/HasOnlyReadOnly', 'model/List', 'model/MapTest', 'model/MixedPropertiesAndAdditionalPropertiesClass', 'model/Model200Response', 'model/ModelReturn', 'model/Name', 'model/NumberOnly', 'model/Order', 'model/OuterComposite', 'model/OuterEnum', 'model/Pet', 'model/ReadOnlyFirst', 'model/SpecialModelName', 'model/Tag', 'model/User', 'api/AnotherFakeApi', 'api/FakeApi', 'api/FakeClassnameTags123Api', 'api/PetApi', 'api/StoreApi', 'api/UserApi'], factory);
|
||||
define(['ApiClient', 'model/AdditionalPropertiesClass', 'model/Animal', 'model/ApiResponse', 'model/ArrayOfArrayOfNumberOnly', 'model/ArrayOfNumberOnly', 'model/ArrayTest', 'model/Capitalization', 'model/Cat', 'model/Category', 'model/ClassModel', 'model/Client', 'model/Dog', 'model/EnumArrays', 'model/EnumClass', 'model/EnumTest', 'model/File', 'model/FileSchemaTestClass', 'model/FormatTest', 'model/HasOnlyReadOnly', 'model/List', 'model/MapTest', 'model/MixedPropertiesAndAdditionalPropertiesClass', 'model/Model200Response', 'model/ModelReturn', 'model/Name', 'model/NumberOnly', 'model/Order', 'model/OuterComposite', 'model/OuterEnum', 'model/Pet', 'model/ReadOnlyFirst', 'model/SpecialModelName', 'model/Tag', 'model/TypeHolderDefault', 'model/TypeHolderExample', 'model/User', '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/ApiResponse'), require('./model/ArrayOfArrayOfNumberOnly'), require('./model/ArrayOfNumberOnly'), require('./model/ArrayTest'), require('./model/Capitalization'), require('./model/Cat'), require('./model/Category'), require('./model/ClassModel'), require('./model/Client'), require('./model/Dog'), require('./model/EnumArrays'), require('./model/EnumClass'), require('./model/EnumTest'), require('./model/File'), require('./model/FileSchemaTestClass'), 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/OuterComposite'), require('./model/OuterEnum'), require('./model/Pet'), require('./model/ReadOnlyFirst'), require('./model/SpecialModelName'), require('./model/Tag'), require('./model/User'), require('./api/AnotherFakeApi'), require('./api/FakeApi'), require('./api/FakeClassnameTags123Api'), require('./api/PetApi'), require('./api/StoreApi'), require('./api/UserApi'));
|
||||
module.exports = factory(require('./ApiClient'), require('./model/AdditionalPropertiesClass'), require('./model/Animal'), require('./model/ApiResponse'), require('./model/ArrayOfArrayOfNumberOnly'), require('./model/ArrayOfNumberOnly'), require('./model/ArrayTest'), require('./model/Capitalization'), require('./model/Cat'), require('./model/Category'), require('./model/ClassModel'), require('./model/Client'), require('./model/Dog'), require('./model/EnumArrays'), require('./model/EnumClass'), require('./model/EnumTest'), require('./model/File'), require('./model/FileSchemaTestClass'), 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/OuterComposite'), require('./model/OuterEnum'), require('./model/Pet'), require('./model/ReadOnlyFirst'), require('./model/SpecialModelName'), require('./model/Tag'), require('./model/TypeHolderDefault'), require('./model/TypeHolderExample'), require('./model/User'), require('./api/AnotherFakeApi'), require('./api/FakeApi'), require('./api/FakeClassnameTags123Api'), require('./api/PetApi'), require('./api/StoreApi'), require('./api/UserApi'));
|
||||
}
|
||||
}(function(ApiClient, AdditionalPropertiesClass, Animal, ApiResponse, ArrayOfArrayOfNumberOnly, ArrayOfNumberOnly, ArrayTest, Capitalization, Cat, Category, ClassModel, Client, Dog, EnumArrays, EnumClass, EnumTest, File, FileSchemaTestClass, FormatTest, HasOnlyReadOnly, List, MapTest, MixedPropertiesAndAdditionalPropertiesClass, Model200Response, ModelReturn, Name, NumberOnly, Order, OuterComposite, OuterEnum, Pet, ReadOnlyFirst, SpecialModelName, Tag, User, AnotherFakeApi, FakeApi, FakeClassnameTags123Api, PetApi, StoreApi, UserApi) {
|
||||
}(function(ApiClient, AdditionalPropertiesClass, Animal, ApiResponse, ArrayOfArrayOfNumberOnly, ArrayOfNumberOnly, ArrayTest, Capitalization, Cat, Category, ClassModel, Client, Dog, EnumArrays, EnumClass, EnumTest, File, FileSchemaTestClass, FormatTest, HasOnlyReadOnly, List, MapTest, MixedPropertiesAndAdditionalPropertiesClass, Model200Response, ModelReturn, Name, NumberOnly, Order, OuterComposite, OuterEnum, Pet, ReadOnlyFirst, SpecialModelName, Tag, TypeHolderDefault, TypeHolderExample, User, AnotherFakeApi, FakeApi, FakeClassnameTags123Api, PetApi, StoreApi, UserApi) {
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
@ -226,6 +226,16 @@
|
||||
* @property {module:model/Tag}
|
||||
*/
|
||||
Tag: Tag,
|
||||
/**
|
||||
* The TypeHolderDefault model constructor.
|
||||
* @property {module:model/TypeHolderDefault}
|
||||
*/
|
||||
TypeHolderDefault: TypeHolderDefault,
|
||||
/**
|
||||
* The TypeHolderExample model constructor.
|
||||
* @property {module:model/TypeHolderExample}
|
||||
*/
|
||||
TypeHolderExample: TypeHolderExample,
|
||||
/**
|
||||
* The User model constructor.
|
||||
* @property {module:model/User}
|
||||
|
@ -0,0 +1,118 @@
|
||||
/**
|
||||
* OpenAPI 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
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
*
|
||||
* OpenAPI Generator version: 4.0.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'], factory);
|
||||
} else if (typeof module === 'object' && module.exports) {
|
||||
// CommonJS-like environments that support module.exports, like Node.
|
||||
module.exports = factory(require('../ApiClient'));
|
||||
} else {
|
||||
// Browser globals (root is window)
|
||||
if (!root.OpenApiPetstore) {
|
||||
root.OpenApiPetstore = {};
|
||||
}
|
||||
root.OpenApiPetstore.TypeHolderDefault = factory(root.OpenApiPetstore.ApiClient);
|
||||
}
|
||||
}(this, function(ApiClient) {
|
||||
'use strict';
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* The TypeHolderDefault model module.
|
||||
* @module model/TypeHolderDefault
|
||||
* @version 1.0.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* Constructs a new <code>TypeHolderDefault</code>.
|
||||
* @alias module:model/TypeHolderDefault
|
||||
* @class
|
||||
* @param stringItem {String}
|
||||
* @param numberItem {Number}
|
||||
* @param integerItem {Number}
|
||||
* @param boolItem {Boolean}
|
||||
* @param arrayItem {Array.<Number>}
|
||||
*/
|
||||
var exports = function(stringItem, numberItem, integerItem, boolItem, arrayItem) {
|
||||
var _this = this;
|
||||
|
||||
_this['string_item'] = stringItem;
|
||||
_this['number_item'] = numberItem;
|
||||
_this['integer_item'] = integerItem;
|
||||
_this['bool_item'] = boolItem;
|
||||
_this['array_item'] = arrayItem;
|
||||
};
|
||||
|
||||
/**
|
||||
* Constructs a <code>TypeHolderDefault</code> from a plain JavaScript object, optionally creating a new instance.
|
||||
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
||||
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
||||
* @param {module:model/TypeHolderDefault} obj Optional instance to populate.
|
||||
* @return {module:model/TypeHolderDefault} The populated <code>TypeHolderDefault</code> instance.
|
||||
*/
|
||||
exports.constructFromObject = function(data, obj) {
|
||||
if (data) {
|
||||
obj = obj || new exports();
|
||||
if (data.hasOwnProperty('string_item')) {
|
||||
obj['string_item'] = ApiClient.convertToType(data['string_item'], 'String');
|
||||
}
|
||||
if (data.hasOwnProperty('number_item')) {
|
||||
obj['number_item'] = ApiClient.convertToType(data['number_item'], 'Number');
|
||||
}
|
||||
if (data.hasOwnProperty('integer_item')) {
|
||||
obj['integer_item'] = ApiClient.convertToType(data['integer_item'], 'Number');
|
||||
}
|
||||
if (data.hasOwnProperty('bool_item')) {
|
||||
obj['bool_item'] = ApiClient.convertToType(data['bool_item'], 'Boolean');
|
||||
}
|
||||
if (data.hasOwnProperty('array_item')) {
|
||||
obj['array_item'] = ApiClient.convertToType(data['array_item'], ['Number']);
|
||||
}
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
|
||||
/**
|
||||
* @member {String} string_item
|
||||
* @default 'what'
|
||||
*/
|
||||
exports.prototype['string_item'] = 'what';
|
||||
/**
|
||||
* @member {Number} number_item
|
||||
*/
|
||||
exports.prototype['number_item'] = undefined;
|
||||
/**
|
||||
* @member {Number} integer_item
|
||||
*/
|
||||
exports.prototype['integer_item'] = undefined;
|
||||
/**
|
||||
* @member {Boolean} bool_item
|
||||
* @default true
|
||||
*/
|
||||
exports.prototype['bool_item'] = true;
|
||||
/**
|
||||
* @member {Array.<Number>} array_item
|
||||
*/
|
||||
exports.prototype['array_item'] = undefined;
|
||||
|
||||
|
||||
|
||||
return exports;
|
||||
}));
|
||||
|
||||
|
@ -0,0 +1,116 @@
|
||||
/**
|
||||
* OpenAPI 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
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
*
|
||||
* OpenAPI Generator version: 4.0.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'], factory);
|
||||
} else if (typeof module === 'object' && module.exports) {
|
||||
// CommonJS-like environments that support module.exports, like Node.
|
||||
module.exports = factory(require('../ApiClient'));
|
||||
} else {
|
||||
// Browser globals (root is window)
|
||||
if (!root.OpenApiPetstore) {
|
||||
root.OpenApiPetstore = {};
|
||||
}
|
||||
root.OpenApiPetstore.TypeHolderExample = factory(root.OpenApiPetstore.ApiClient);
|
||||
}
|
||||
}(this, function(ApiClient) {
|
||||
'use strict';
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* The TypeHolderExample model module.
|
||||
* @module model/TypeHolderExample
|
||||
* @version 1.0.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* Constructs a new <code>TypeHolderExample</code>.
|
||||
* @alias module:model/TypeHolderExample
|
||||
* @class
|
||||
* @param stringItem {String}
|
||||
* @param numberItem {Number}
|
||||
* @param integerItem {Number}
|
||||
* @param boolItem {Boolean}
|
||||
* @param arrayItem {Array.<Number>}
|
||||
*/
|
||||
var exports = function(stringItem, numberItem, integerItem, boolItem, arrayItem) {
|
||||
var _this = this;
|
||||
|
||||
_this['string_item'] = stringItem;
|
||||
_this['number_item'] = numberItem;
|
||||
_this['integer_item'] = integerItem;
|
||||
_this['bool_item'] = boolItem;
|
||||
_this['array_item'] = arrayItem;
|
||||
};
|
||||
|
||||
/**
|
||||
* Constructs a <code>TypeHolderExample</code> from a plain JavaScript object, optionally creating a new instance.
|
||||
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
||||
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
||||
* @param {module:model/TypeHolderExample} obj Optional instance to populate.
|
||||
* @return {module:model/TypeHolderExample} The populated <code>TypeHolderExample</code> instance.
|
||||
*/
|
||||
exports.constructFromObject = function(data, obj) {
|
||||
if (data) {
|
||||
obj = obj || new exports();
|
||||
if (data.hasOwnProperty('string_item')) {
|
||||
obj['string_item'] = ApiClient.convertToType(data['string_item'], 'String');
|
||||
}
|
||||
if (data.hasOwnProperty('number_item')) {
|
||||
obj['number_item'] = ApiClient.convertToType(data['number_item'], 'Number');
|
||||
}
|
||||
if (data.hasOwnProperty('integer_item')) {
|
||||
obj['integer_item'] = ApiClient.convertToType(data['integer_item'], 'Number');
|
||||
}
|
||||
if (data.hasOwnProperty('bool_item')) {
|
||||
obj['bool_item'] = ApiClient.convertToType(data['bool_item'], 'Boolean');
|
||||
}
|
||||
if (data.hasOwnProperty('array_item')) {
|
||||
obj['array_item'] = ApiClient.convertToType(data['array_item'], ['Number']);
|
||||
}
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
|
||||
/**
|
||||
* @member {String} string_item
|
||||
*/
|
||||
exports.prototype['string_item'] = undefined;
|
||||
/**
|
||||
* @member {Number} number_item
|
||||
*/
|
||||
exports.prototype['number_item'] = undefined;
|
||||
/**
|
||||
* @member {Number} integer_item
|
||||
*/
|
||||
exports.prototype['integer_item'] = undefined;
|
||||
/**
|
||||
* @member {Boolean} bool_item
|
||||
*/
|
||||
exports.prototype['bool_item'] = undefined;
|
||||
/**
|
||||
* @member {Array.<Number>} array_item
|
||||
*/
|
||||
exports.prototype['array_item'] = undefined;
|
||||
|
||||
|
||||
|
||||
return exports;
|
||||
}));
|
||||
|
||||
|
@ -0,0 +1,91 @@
|
||||
/**
|
||||
* OpenAPI 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
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
*
|
||||
* OpenAPI Generator version: 4.0.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.OpenApiPetstore);
|
||||
}
|
||||
}(this, function(expect, OpenApiPetstore) {
|
||||
'use strict';
|
||||
|
||||
var instance;
|
||||
|
||||
beforeEach(function() {
|
||||
instance = new OpenApiPetstore.TypeHolderDefault();
|
||||
});
|
||||
|
||||
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('TypeHolderDefault', function() {
|
||||
it('should create an instance of TypeHolderDefault', function() {
|
||||
// uncomment below and update the code to test TypeHolderDefault
|
||||
//var instance = new OpenApiPetstore.TypeHolderDefault();
|
||||
//expect(instance).to.be.a(OpenApiPetstore.TypeHolderDefault);
|
||||
});
|
||||
|
||||
it('should have the property stringItem (base name: "string_item")', function() {
|
||||
// uncomment below and update the code to test the property stringItem
|
||||
//var instance = new OpenApiPetstore.TypeHolderDefault();
|
||||
//expect(instance).to.be();
|
||||
});
|
||||
|
||||
it('should have the property numberItem (base name: "number_item")', function() {
|
||||
// uncomment below and update the code to test the property numberItem
|
||||
//var instance = new OpenApiPetstore.TypeHolderDefault();
|
||||
//expect(instance).to.be();
|
||||
});
|
||||
|
||||
it('should have the property integerItem (base name: "integer_item")', function() {
|
||||
// uncomment below and update the code to test the property integerItem
|
||||
//var instance = new OpenApiPetstore.TypeHolderDefault();
|
||||
//expect(instance).to.be();
|
||||
});
|
||||
|
||||
it('should have the property boolItem (base name: "bool_item")', function() {
|
||||
// uncomment below and update the code to test the property boolItem
|
||||
//var instance = new OpenApiPetstore.TypeHolderDefault();
|
||||
//expect(instance).to.be();
|
||||
});
|
||||
|
||||
it('should have the property arrayItem (base name: "array_item")', function() {
|
||||
// uncomment below and update the code to test the property arrayItem
|
||||
//var instance = new OpenApiPetstore.TypeHolderDefault();
|
||||
//expect(instance).to.be();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
}));
|
@ -0,0 +1,91 @@
|
||||
/**
|
||||
* OpenAPI 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
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
*
|
||||
* OpenAPI Generator version: 4.0.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.OpenApiPetstore);
|
||||
}
|
||||
}(this, function(expect, OpenApiPetstore) {
|
||||
'use strict';
|
||||
|
||||
var instance;
|
||||
|
||||
beforeEach(function() {
|
||||
instance = new OpenApiPetstore.TypeHolderExample();
|
||||
});
|
||||
|
||||
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('TypeHolderExample', function() {
|
||||
it('should create an instance of TypeHolderExample', function() {
|
||||
// uncomment below and update the code to test TypeHolderExample
|
||||
//var instance = new OpenApiPetstore.TypeHolderExample();
|
||||
//expect(instance).to.be.a(OpenApiPetstore.TypeHolderExample);
|
||||
});
|
||||
|
||||
it('should have the property stringItem (base name: "string_item")', function() {
|
||||
// uncomment below and update the code to test the property stringItem
|
||||
//var instance = new OpenApiPetstore.TypeHolderExample();
|
||||
//expect(instance).to.be();
|
||||
});
|
||||
|
||||
it('should have the property numberItem (base name: "number_item")', function() {
|
||||
// uncomment below and update the code to test the property numberItem
|
||||
//var instance = new OpenApiPetstore.TypeHolderExample();
|
||||
//expect(instance).to.be();
|
||||
});
|
||||
|
||||
it('should have the property integerItem (base name: "integer_item")', function() {
|
||||
// uncomment below and update the code to test the property integerItem
|
||||
//var instance = new OpenApiPetstore.TypeHolderExample();
|
||||
//expect(instance).to.be();
|
||||
});
|
||||
|
||||
it('should have the property boolItem (base name: "bool_item")', function() {
|
||||
// uncomment below and update the code to test the property boolItem
|
||||
//var instance = new OpenApiPetstore.TypeHolderExample();
|
||||
//expect(instance).to.be();
|
||||
});
|
||||
|
||||
it('should have the property arrayItem (base name: "array_item")', function() {
|
||||
// uncomment below and update the code to test the property arrayItem
|
||||
//var instance = new OpenApiPetstore.TypeHolderExample();
|
||||
//expect(instance).to.be();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
}));
|
3
samples/openapi3/client/petstore/javascript-es6/.babelrc
Normal file
3
samples/openapi3/client/petstore/javascript-es6/.babelrc
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"presets": ["env", "stage-0"]
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
# Swagger Codegen Ignore
|
||||
# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen
|
||||
|
||||
# Use this file to prevent files from being overwritten by the generator.
|
||||
# The patterns follow closely to .gitignore or .dockerignore.
|
||||
|
||||
# As an example, the C# client generator defines ApiClient.cs.
|
||||
# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line:
|
||||
#ApiClient.cs
|
||||
|
||||
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
|
||||
#foo/*/qux
|
||||
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
|
||||
|
||||
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
|
||||
#foo/**/qux
|
||||
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
|
||||
|
||||
# You can also negate patterns with an exclamation (!).
|
||||
# For example, you can ignore all files in a docs folder with the file extension .md:
|
||||
#docs/*.md
|
||||
# Then explicitly reverse the ignore rule for a single file:
|
||||
#!docs/README.md
|
@ -0,0 +1 @@
|
||||
4.0.0-SNAPSHOT
|
@ -0,0 +1,7 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- "6"
|
||||
- "6.1"
|
||||
- "5"
|
||||
- "5.11"
|
||||
|
204
samples/openapi3/client/petstore/javascript-es6/README.md
Normal file
204
samples/openapi3/client/petstore/javascript-es6/README.md
Normal file
@ -0,0 +1,204 @@
|
||||
# open_api_petstore
|
||||
|
||||
OpenApiPetstore - JavaScript client for open_api_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: \" \\
|
||||
This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
|
||||
|
||||
- API version: 1.0.0
|
||||
- Package version: 1.0.0
|
||||
- Build package: org.openapitools.codegen.languages.JavascriptClientCodegen
|
||||
|
||||
## Installation
|
||||
|
||||
### For [Node.js](https://nodejs.org/)
|
||||
|
||||
#### npm
|
||||
|
||||
To publish the library as a [npm](https://www.npmjs.com/),
|
||||
please follow the procedure in ["Publishing npm packages"](https://docs.npmjs.com/getting-started/publishing-npm-packages).
|
||||
|
||||
Then install it via:
|
||||
|
||||
```shell
|
||||
npm install open_api_petstore --save
|
||||
```
|
||||
|
||||
#### git
|
||||
#
|
||||
If the library is hosted at a git repository, e.g.
|
||||
https://github.com/GIT_USER_ID/GIT_REPO_ID
|
||||
then install it via:
|
||||
|
||||
```shell
|
||||
npm install GIT_USER_ID/GIT_REPO_ID --save
|
||||
```
|
||||
|
||||
### For browser
|
||||
|
||||
The library also works in the browser environment via npm and [browserify](http://browserify.org/). After following
|
||||
the above steps with Node.js and installing browserify with `npm install -g browserify`,
|
||||
perform the following (assuming *main.js* is your entry file):
|
||||
|
||||
```shell
|
||||
browserify main.js > bundle.js
|
||||
```
|
||||
|
||||
Then include *bundle.js* in the HTML pages.
|
||||
|
||||
### Webpack Configuration
|
||||
|
||||
Using Webpack you may encounter the following error: "Module not found: Error:
|
||||
Cannot resolve module", most certainly you should disable AMD loader. Add/merge
|
||||
the following section to your webpack config:
|
||||
|
||||
```javascript
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
parser: {
|
||||
amd: false
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## Getting Started
|
||||
|
||||
Please follow the [installation](#installation) instruction and execute the following JS code:
|
||||
|
||||
```javascript
|
||||
var OpenApiPetstore = require('open_api_petstore');
|
||||
|
||||
|
||||
var api = new OpenApiPetstore.AnotherFakeApi()
|
||||
var client = new OpenApiPetstore.Client(); // {Client} client model
|
||||
var callback = function(error, data, response) {
|
||||
if (error) {
|
||||
console.error(error);
|
||||
} else {
|
||||
console.log('API called successfully. Returned data: ' + data);
|
||||
}
|
||||
};
|
||||
api.call123testSpecialTags(client, callback);
|
||||
|
||||
```
|
||||
|
||||
## Documentation for API Endpoints
|
||||
|
||||
All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||
|
||||
Class | Method | HTTP request | Description
|
||||
------------ | ------------- | ------------- | -------------
|
||||
*OpenApiPetstore.AnotherFakeApi* | [**call123testSpecialTags**](docs/AnotherFakeApi.md#call123testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags
|
||||
*OpenApiPetstore.DefaultApi* | [**fooGet**](docs/DefaultApi.md#fooGet) | **GET** /foo |
|
||||
*OpenApiPetstore.FakeApi* | [**fakeOuterBooleanSerialize**](docs/FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean |
|
||||
*OpenApiPetstore.FakeApi* | [**fakeOuterCompositeSerialize**](docs/FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite |
|
||||
*OpenApiPetstore.FakeApi* | [**fakeOuterNumberSerialize**](docs/FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number |
|
||||
*OpenApiPetstore.FakeApi* | [**fakeOuterStringSerialize**](docs/FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string |
|
||||
*OpenApiPetstore.FakeApi* | [**testBodyWithFileSchema**](docs/FakeApi.md#testBodyWithFileSchema) | **PUT** /fake/body-with-file-schema |
|
||||
*OpenApiPetstore.FakeApi* | [**testBodyWithQueryParams**](docs/FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params |
|
||||
*OpenApiPetstore.FakeApi* | [**testClientModel**](docs/FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model
|
||||
*OpenApiPetstore.FakeApi* | [**testEndpointParameters**](docs/FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
*OpenApiPetstore.FakeApi* | [**testEnumParameters**](docs/FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters
|
||||
*OpenApiPetstore.FakeApi* | [**testGroupParameters**](docs/FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional)
|
||||
*OpenApiPetstore.FakeApi* | [**testInlineAdditionalProperties**](docs/FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties
|
||||
*OpenApiPetstore.FakeApi* | [**testJsonFormData**](docs/FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data
|
||||
*OpenApiPetstore.FakeClassnameTags123Api* | [**testClassname**](docs/FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case
|
||||
*OpenApiPetstore.PetApi* | [**addPet**](docs/PetApi.md#addPet) | **POST** /pet | Add a new pet to the store
|
||||
*OpenApiPetstore.PetApi* | [**deletePet**](docs/PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet
|
||||
*OpenApiPetstore.PetApi* | [**findPetsByStatus**](docs/PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status
|
||||
*OpenApiPetstore.PetApi* | [**findPetsByTags**](docs/PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags
|
||||
*OpenApiPetstore.PetApi* | [**getPetById**](docs/PetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID
|
||||
*OpenApiPetstore.PetApi* | [**updatePet**](docs/PetApi.md#updatePet) | **PUT** /pet | Update an existing pet
|
||||
*OpenApiPetstore.PetApi* | [**updatePetWithForm**](docs/PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data
|
||||
*OpenApiPetstore.PetApi* | [**uploadFile**](docs/PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image
|
||||
*OpenApiPetstore.PetApi* | [**uploadFileWithRequiredFile**](docs/PetApi.md#uploadFileWithRequiredFile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required)
|
||||
*OpenApiPetstore.StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID
|
||||
*OpenApiPetstore.StoreApi* | [**getInventory**](docs/StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status
|
||||
*OpenApiPetstore.StoreApi* | [**getOrderById**](docs/StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID
|
||||
*OpenApiPetstore.StoreApi* | [**placeOrder**](docs/StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet
|
||||
*OpenApiPetstore.UserApi* | [**createUser**](docs/UserApi.md#createUser) | **POST** /user | Create user
|
||||
*OpenApiPetstore.UserApi* | [**createUsersWithArrayInput**](docs/UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array
|
||||
*OpenApiPetstore.UserApi* | [**createUsersWithListInput**](docs/UserApi.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array
|
||||
*OpenApiPetstore.UserApi* | [**deleteUser**](docs/UserApi.md#deleteUser) | **DELETE** /user/{username} | Delete user
|
||||
*OpenApiPetstore.UserApi* | [**getUserByName**](docs/UserApi.md#getUserByName) | **GET** /user/{username} | Get user by user name
|
||||
*OpenApiPetstore.UserApi* | [**loginUser**](docs/UserApi.md#loginUser) | **GET** /user/login | Logs user into the system
|
||||
*OpenApiPetstore.UserApi* | [**logoutUser**](docs/UserApi.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session
|
||||
*OpenApiPetstore.UserApi* | [**updateUser**](docs/UserApi.md#updateUser) | **PUT** /user/{username} | Updated user
|
||||
|
||||
|
||||
## Documentation for Models
|
||||
|
||||
- [OpenApiPetstore.AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md)
|
||||
- [OpenApiPetstore.Animal](docs/Animal.md)
|
||||
- [OpenApiPetstore.ApiResponse](docs/ApiResponse.md)
|
||||
- [OpenApiPetstore.ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md)
|
||||
- [OpenApiPetstore.ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md)
|
||||
- [OpenApiPetstore.ArrayTest](docs/ArrayTest.md)
|
||||
- [OpenApiPetstore.Capitalization](docs/Capitalization.md)
|
||||
- [OpenApiPetstore.Cat](docs/Cat.md)
|
||||
- [OpenApiPetstore.Category](docs/Category.md)
|
||||
- [OpenApiPetstore.ClassModel](docs/ClassModel.md)
|
||||
- [OpenApiPetstore.Client](docs/Client.md)
|
||||
- [OpenApiPetstore.Dog](docs/Dog.md)
|
||||
- [OpenApiPetstore.EnumArrays](docs/EnumArrays.md)
|
||||
- [OpenApiPetstore.EnumClass](docs/EnumClass.md)
|
||||
- [OpenApiPetstore.EnumTest](docs/EnumTest.md)
|
||||
- [OpenApiPetstore.File](docs/File.md)
|
||||
- [OpenApiPetstore.FileSchemaTestClass](docs/FileSchemaTestClass.md)
|
||||
- [OpenApiPetstore.Foo](docs/Foo.md)
|
||||
- [OpenApiPetstore.FormatTest](docs/FormatTest.md)
|
||||
- [OpenApiPetstore.HasOnlyReadOnly](docs/HasOnlyReadOnly.md)
|
||||
- [OpenApiPetstore.InlineObject](docs/InlineObject.md)
|
||||
- [OpenApiPetstore.InlineObject1](docs/InlineObject1.md)
|
||||
- [OpenApiPetstore.InlineObject2](docs/InlineObject2.md)
|
||||
- [OpenApiPetstore.InlineObject3](docs/InlineObject3.md)
|
||||
- [OpenApiPetstore.InlineObject4](docs/InlineObject4.md)
|
||||
- [OpenApiPetstore.InlineObject5](docs/InlineObject5.md)
|
||||
- [OpenApiPetstore.InlineResponseDefault](docs/InlineResponseDefault.md)
|
||||
- [OpenApiPetstore.List](docs/List.md)
|
||||
- [OpenApiPetstore.MapTest](docs/MapTest.md)
|
||||
- [OpenApiPetstore.MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md)
|
||||
- [OpenApiPetstore.Model200Response](docs/Model200Response.md)
|
||||
- [OpenApiPetstore.ModelReturn](docs/ModelReturn.md)
|
||||
- [OpenApiPetstore.Name](docs/Name.md)
|
||||
- [OpenApiPetstore.NumberOnly](docs/NumberOnly.md)
|
||||
- [OpenApiPetstore.Order](docs/Order.md)
|
||||
- [OpenApiPetstore.OuterComposite](docs/OuterComposite.md)
|
||||
- [OpenApiPetstore.OuterEnum](docs/OuterEnum.md)
|
||||
- [OpenApiPetstore.Pet](docs/Pet.md)
|
||||
- [OpenApiPetstore.ReadOnlyFirst](docs/ReadOnlyFirst.md)
|
||||
- [OpenApiPetstore.SpecialModelName](docs/SpecialModelName.md)
|
||||
- [OpenApiPetstore.Tag](docs/Tag.md)
|
||||
- [OpenApiPetstore.User](docs/User.md)
|
||||
|
||||
|
||||
## Documentation for Authorization
|
||||
|
||||
|
||||
### api_key
|
||||
|
||||
- **Type**: API key
|
||||
- **API key parameter name**: api_key
|
||||
- **Location**: HTTP header
|
||||
|
||||
### api_key_query
|
||||
|
||||
- **Type**: API key
|
||||
- **API key parameter name**: api_key_query
|
||||
- **Location**: URL query string
|
||||
|
||||
### http_basic_test
|
||||
|
||||
- **Type**: HTTP basic authentication
|
||||
|
||||
### petstore_auth
|
||||
|
||||
- **Type**: OAuth
|
||||
- **Flow**: implicit
|
||||
- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog
|
||||
- **Scopes**:
|
||||
- write:pets: modify pets in your account
|
||||
- read:pets: read your pets
|
||||
|
@ -0,0 +1,9 @@
|
||||
# OpenApiPetstore.AdditionalPropertiesClass
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**mapProperty** | **{String: String}** | | [optional]
|
||||
**mapOfMapProperty** | **{String: {String: String}}** | | [optional]
|
||||
|
||||
|
@ -0,0 +1,9 @@
|
||||
# OpenApiPetstore.Animal
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**className** | **String** | |
|
||||
**color** | **String** | | [optional] [default to 'red']
|
||||
|
||||
|
@ -0,0 +1,7 @@
|
||||
# OpenApiPetstore.AnimalFarm
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
|
||||
|
@ -0,0 +1,51 @@
|
||||
# OpenApiPetstore.AnotherFakeApi
|
||||
|
||||
All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
[**call123testSpecialTags**](AnotherFakeApi.md#call123testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags
|
||||
|
||||
|
||||
<a name="call123testSpecialTags"></a>
|
||||
# **call123testSpecialTags**
|
||||
> Client call123testSpecialTags(client)
|
||||
|
||||
To test special tags
|
||||
|
||||
To test special tags and operation ID starting with number
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
import OpenApiPetstore from 'open_api_petstore';
|
||||
|
||||
let apiInstance = new OpenApiPetstore.AnotherFakeApi();
|
||||
let client = new OpenApiPetstore.Client(); // Client | client model
|
||||
apiInstance.call123testSpecialTags(client, (error, data, response) => {
|
||||
if (error) {
|
||||
console.error(error);
|
||||
} else {
|
||||
console.log('API called successfully. Returned data: ' + data);
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**client** | [**Client**](Client.md)| client model |
|
||||
|
||||
### Return type
|
||||
|
||||
[**Client**](Client.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: application/json
|
||||
|
@ -0,0 +1,10 @@
|
||||
# OpenApiPetstore.ApiResponse
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**code** | **Number** | | [optional]
|
||||
**type** | **String** | | [optional]
|
||||
**message** | **String** | | [optional]
|
||||
|
||||
|
@ -0,0 +1,8 @@
|
||||
# OpenApiPetstore.ArrayOfArrayOfNumberOnly
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**arrayArrayNumber** | **[[Number]]** | | [optional]
|
||||
|
||||
|
@ -0,0 +1,8 @@
|
||||
# OpenApiPetstore.ArrayOfNumberOnly
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**arrayNumber** | **[Number]** | | [optional]
|
||||
|
||||
|
@ -0,0 +1,10 @@
|
||||
# OpenApiPetstore.ArrayTest
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**arrayOfString** | **[String]** | | [optional]
|
||||
**arrayArrayOfInteger** | **[[Number]]** | | [optional]
|
||||
**arrayArrayOfModel** | **[[ReadOnlyFirst]]** | | [optional]
|
||||
|
||||
|
@ -0,0 +1,13 @@
|
||||
# OpenApiPetstore.Capitalization
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**smallCamel** | **String** | | [optional]
|
||||
**capitalCamel** | **String** | | [optional]
|
||||
**smallSnake** | **String** | | [optional]
|
||||
**capitalSnake** | **String** | | [optional]
|
||||
**sCAETHFlowPoints** | **String** | | [optional]
|
||||
**ATT_NAME** | **String** | Name of the pet | [optional]
|
||||
|
||||
|
@ -0,0 +1,8 @@
|
||||
# OpenApiPetstore.Cat
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**declawed** | **Boolean** | | [optional]
|
||||
|
||||
|
@ -0,0 +1,9 @@
|
||||
# OpenApiPetstore.Category
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**id** | **Number** | | [optional]
|
||||
**name** | **String** | | [default to 'default-name']
|
||||
|
||||
|
@ -0,0 +1,8 @@
|
||||
# OpenApiPetstore.ClassModel
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**_class** | **String** | | [optional]
|
||||
|
||||
|
@ -0,0 +1,8 @@
|
||||
# OpenApiPetstore.Client
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**client** | **String** | | [optional]
|
||||
|
||||
|
@ -0,0 +1,45 @@
|
||||
# OpenApiPetstore.DefaultApi
|
||||
|
||||
All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
[**fooGet**](DefaultApi.md#fooGet) | **GET** /foo |
|
||||
|
||||
|
||||
<a name="fooGet"></a>
|
||||
# **fooGet**
|
||||
> InlineResponseDefault fooGet()
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
import OpenApiPetstore from 'open_api_petstore';
|
||||
|
||||
let apiInstance = new OpenApiPetstore.DefaultApi();
|
||||
apiInstance.fooGet((error, data, response) => {
|
||||
if (error) {
|
||||
console.error(error);
|
||||
} else {
|
||||
console.log('API called successfully. Returned data: ' + data);
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
### Parameters
|
||||
This endpoint does not need any parameter.
|
||||
|
||||
### Return type
|
||||
|
||||
[**InlineResponseDefault**](InlineResponseDefault.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json
|
||||
|
@ -0,0 +1,8 @@
|
||||
# OpenApiPetstore.Dog
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**breed** | **String** | | [optional]
|
||||
|
||||
|
@ -0,0 +1,31 @@
|
||||
# OpenApiPetstore.EnumArrays
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**justSymbol** | **String** | | [optional]
|
||||
**arrayEnum** | **[String]** | | [optional]
|
||||
|
||||
|
||||
<a name="JustSymbolEnum"></a>
|
||||
## Enum: JustSymbolEnum
|
||||
|
||||
|
||||
* `GREATER_THAN_OR_EQUAL_TO` (value: `">="`)
|
||||
|
||||
* `DOLLAR` (value: `"$"`)
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="[ArrayEnumEnum]"></a>
|
||||
## Enum: [ArrayEnumEnum]
|
||||
|
||||
|
||||
* `fish` (value: `"fish"`)
|
||||
|
||||
* `crab` (value: `"crab"`)
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,12 @@
|
||||
# OpenApiPetstore.EnumClass
|
||||
|
||||
## Enum
|
||||
|
||||
|
||||
* `_abc` (value: `"_abc"`)
|
||||
|
||||
* `-efg` (value: `"-efg"`)
|
||||
|
||||
* `(xyz)` (value: `"(xyz)"`)
|
||||
|
||||
|
@ -0,0 +1,60 @@
|
||||
# OpenApiPetstore.EnumTest
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**enumString** | **String** | | [optional]
|
||||
**enumStringRequired** | **String** | |
|
||||
**enumInteger** | **Number** | | [optional]
|
||||
**enumNumber** | **Number** | | [optional]
|
||||
**outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional]
|
||||
|
||||
|
||||
<a name="EnumStringEnum"></a>
|
||||
## Enum: EnumStringEnum
|
||||
|
||||
|
||||
* `UPPER` (value: `"UPPER"`)
|
||||
|
||||
* `lower` (value: `"lower"`)
|
||||
|
||||
* `empty` (value: `""`)
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="EnumStringRequiredEnum"></a>
|
||||
## Enum: EnumStringRequiredEnum
|
||||
|
||||
|
||||
* `UPPER` (value: `"UPPER"`)
|
||||
|
||||
* `lower` (value: `"lower"`)
|
||||
|
||||
* `empty` (value: `""`)
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="EnumIntegerEnum"></a>
|
||||
## Enum: EnumIntegerEnum
|
||||
|
||||
|
||||
* `1` (value: `1`)
|
||||
|
||||
* `-1` (value: `-1`)
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="EnumNumberEnum"></a>
|
||||
## Enum: EnumNumberEnum
|
||||
|
||||
|
||||
* `1.1` (value: `1.1`)
|
||||
|
||||
* `-1.2` (value: `-1.2`)
|
||||
|
||||
|
||||
|
||||
|
592
samples/openapi3/client/petstore/javascript-es6/docs/FakeApi.md
Normal file
592
samples/openapi3/client/petstore/javascript-es6/docs/FakeApi.md
Normal file
@ -0,0 +1,592 @@
|
||||
# OpenApiPetstore.FakeApi
|
||||
|
||||
All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
[**fakeOuterBooleanSerialize**](FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean |
|
||||
[**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite |
|
||||
[**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number |
|
||||
[**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string |
|
||||
[**testBodyWithFileSchema**](FakeApi.md#testBodyWithFileSchema) | **PUT** /fake/body-with-file-schema |
|
||||
[**testBodyWithQueryParams**](FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params |
|
||||
[**testClientModel**](FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model
|
||||
[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
[**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters
|
||||
[**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional)
|
||||
[**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties
|
||||
[**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data
|
||||
|
||||
|
||||
<a name="fakeOuterBooleanSerialize"></a>
|
||||
# **fakeOuterBooleanSerialize**
|
||||
> Boolean fakeOuterBooleanSerialize(opts)
|
||||
|
||||
|
||||
|
||||
Test serialization of outer boolean types
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
import OpenApiPetstore from 'open_api_petstore';
|
||||
|
||||
let apiInstance = new OpenApiPetstore.FakeApi();
|
||||
let opts = {
|
||||
'body': true // Boolean | Input boolean as post body
|
||||
};
|
||||
apiInstance.fakeOuterBooleanSerialize(opts, (error, data, response) => {
|
||||
if (error) {
|
||||
console.error(error);
|
||||
} else {
|
||||
console.log('API called successfully. Returned data: ' + data);
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | **Boolean**| Input boolean as post body | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
**Boolean**
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: */*
|
||||
|
||||
<a name="fakeOuterCompositeSerialize"></a>
|
||||
# **fakeOuterCompositeSerialize**
|
||||
> OuterComposite fakeOuterCompositeSerialize(opts)
|
||||
|
||||
|
||||
|
||||
Test serialization of object with outer number type
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
import OpenApiPetstore from 'open_api_petstore';
|
||||
|
||||
let apiInstance = new OpenApiPetstore.FakeApi();
|
||||
let opts = {
|
||||
'outerComposite': new OpenApiPetstore.OuterComposite() // OuterComposite | Input composite as post body
|
||||
};
|
||||
apiInstance.fakeOuterCompositeSerialize(opts, (error, data, response) => {
|
||||
if (error) {
|
||||
console.error(error);
|
||||
} else {
|
||||
console.log('API called successfully. Returned data: ' + data);
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**outerComposite** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
[**OuterComposite**](OuterComposite.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: */*
|
||||
|
||||
<a name="fakeOuterNumberSerialize"></a>
|
||||
# **fakeOuterNumberSerialize**
|
||||
> Number fakeOuterNumberSerialize(opts)
|
||||
|
||||
|
||||
|
||||
Test serialization of outer number types
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
import OpenApiPetstore from 'open_api_petstore';
|
||||
|
||||
let apiInstance = new OpenApiPetstore.FakeApi();
|
||||
let opts = {
|
||||
'body': 3.4 // Number | Input number as post body
|
||||
};
|
||||
apiInstance.fakeOuterNumberSerialize(opts, (error, data, response) => {
|
||||
if (error) {
|
||||
console.error(error);
|
||||
} else {
|
||||
console.log('API called successfully. Returned data: ' + data);
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | **Number**| Input number as post body | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
**Number**
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: */*
|
||||
|
||||
<a name="fakeOuterStringSerialize"></a>
|
||||
# **fakeOuterStringSerialize**
|
||||
> String fakeOuterStringSerialize(opts)
|
||||
|
||||
|
||||
|
||||
Test serialization of outer string types
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
import OpenApiPetstore from 'open_api_petstore';
|
||||
|
||||
let apiInstance = new OpenApiPetstore.FakeApi();
|
||||
let opts = {
|
||||
'body': "body_example" // String | Input string as post body
|
||||
};
|
||||
apiInstance.fakeOuterStringSerialize(opts, (error, data, response) => {
|
||||
if (error) {
|
||||
console.error(error);
|
||||
} else {
|
||||
console.log('API called successfully. Returned data: ' + data);
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | **String**| Input string as post body | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
**String**
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: */*
|
||||
|
||||
<a name="testBodyWithFileSchema"></a>
|
||||
# **testBodyWithFileSchema**
|
||||
> testBodyWithFileSchema(fileSchemaTestClass)
|
||||
|
||||
|
||||
|
||||
For this test, the body for this request much reference a schema named `File`.
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
import OpenApiPetstore from 'open_api_petstore';
|
||||
|
||||
let apiInstance = new OpenApiPetstore.FakeApi();
|
||||
let fileSchemaTestClass = new OpenApiPetstore.FileSchemaTestClass(); // FileSchemaTestClass |
|
||||
apiInstance.testBodyWithFileSchema(fileSchemaTestClass, (error, data, response) => {
|
||||
if (error) {
|
||||
console.error(error);
|
||||
} else {
|
||||
console.log('API called successfully.');
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**fileSchemaTestClass** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| |
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
<a name="testBodyWithQueryParams"></a>
|
||||
# **testBodyWithQueryParams**
|
||||
> testBodyWithQueryParams(query, user)
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
import OpenApiPetstore from 'open_api_petstore';
|
||||
|
||||
let apiInstance = new OpenApiPetstore.FakeApi();
|
||||
let query = "query_example"; // String |
|
||||
let user = new OpenApiPetstore.User(); // User |
|
||||
apiInstance.testBodyWithQueryParams(query, user, (error, data, response) => {
|
||||
if (error) {
|
||||
console.error(error);
|
||||
} else {
|
||||
console.log('API called successfully.');
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**query** | **String**| |
|
||||
**user** | [**User**](User.md)| |
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
<a name="testClientModel"></a>
|
||||
# **testClientModel**
|
||||
> Client testClientModel(client)
|
||||
|
||||
To test \"client\" model
|
||||
|
||||
To test \"client\" model
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
import OpenApiPetstore from 'open_api_petstore';
|
||||
|
||||
let apiInstance = new OpenApiPetstore.FakeApi();
|
||||
let client = new OpenApiPetstore.Client(); // Client | client model
|
||||
apiInstance.testClientModel(client, (error, data, response) => {
|
||||
if (error) {
|
||||
console.error(error);
|
||||
} else {
|
||||
console.log('API called successfully. Returned data: ' + data);
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**client** | [**Client**](Client.md)| client model |
|
||||
|
||||
### Return type
|
||||
|
||||
[**Client**](Client.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: application/json
|
||||
|
||||
<a name="testEndpointParameters"></a>
|
||||
# **testEndpointParameters**
|
||||
> testEndpointParameters(_number, _double, patternWithoutDelimiter, _byte, opts)
|
||||
|
||||
Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
|
||||
Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
import OpenApiPetstore from 'open_api_petstore';
|
||||
let defaultClient = OpenApiPetstore.ApiClient.instance;
|
||||
|
||||
// Configure HTTP basic authorization: http_basic_test
|
||||
let http_basic_test = defaultClient.authentications['http_basic_test'];
|
||||
http_basic_test.username = 'YOUR USERNAME';
|
||||
http_basic_test.password = 'YOUR PASSWORD';
|
||||
|
||||
let apiInstance = new OpenApiPetstore.FakeApi();
|
||||
let _number = 3.4; // Number | None
|
||||
let _double = 3.4; // Number | None
|
||||
let patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None
|
||||
let _byte = null; // Blob | None
|
||||
let opts = {
|
||||
'integer': 56, // Number | None
|
||||
'int32': 56, // Number | None
|
||||
'int64': 789, // Number | None
|
||||
'_float': 3.4, // Number | None
|
||||
'_string': "_string_example", // String | None
|
||||
'binary': "/path/to/file", // File | None
|
||||
'_date': new Date("2013-10-20"), // Date | None
|
||||
'dateTime': new Date("2013-10-20T19:20:30+01:00"), // Date | None
|
||||
'password': "password_example", // String | None
|
||||
'callback': "callback_example" // String | None
|
||||
};
|
||||
apiInstance.testEndpointParameters(_number, _double, patternWithoutDelimiter, _byte, opts, (error, data, response) => {
|
||||
if (error) {
|
||||
console.error(error);
|
||||
} else {
|
||||
console.log('API called successfully.');
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**_number** | **Number**| None |
|
||||
**_double** | **Number**| None |
|
||||
**patternWithoutDelimiter** | **String**| None |
|
||||
**_byte** | **Blob**| None |
|
||||
**integer** | **Number**| None | [optional]
|
||||
**int32** | **Number**| None | [optional]
|
||||
**int64** | **Number**| None | [optional]
|
||||
**_float** | **Number**| None | [optional]
|
||||
**_string** | **String**| None | [optional]
|
||||
**binary** | **File**| None | [optional]
|
||||
**_date** | **Date**| None | [optional]
|
||||
**dateTime** | **Date**| None | [optional]
|
||||
**password** | **String**| None | [optional]
|
||||
**callback** | **String**| None | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
[http_basic_test](../README.md#http_basic_test)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/x-www-form-urlencoded
|
||||
- **Accept**: Not defined
|
||||
|
||||
<a name="testEnumParameters"></a>
|
||||
# **testEnumParameters**
|
||||
> testEnumParameters(opts)
|
||||
|
||||
To test enum parameters
|
||||
|
||||
To test enum parameters
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
import OpenApiPetstore from 'open_api_petstore';
|
||||
|
||||
let apiInstance = new OpenApiPetstore.FakeApi();
|
||||
let opts = {
|
||||
'enumHeaderStringArray': ["'$'"], // [String] | Header parameter enum test (string array)
|
||||
'enumHeaderString': "'-efg'", // String | Header parameter enum test (string)
|
||||
'enumQueryStringArray': ["'$'"], // [String] | Query parameter enum test (string array)
|
||||
'enumQueryString': "'-efg'", // String | Query parameter enum test (string)
|
||||
'enumQueryInteger': 56, // Number | Query parameter enum test (double)
|
||||
'enumQueryDouble': 3.4, // Number | Query parameter enum test (double)
|
||||
'enumFormStringArray': "'$'", // [String] | Form parameter enum test (string array)
|
||||
'enumFormString': "'-efg'" // String | Form parameter enum test (string)
|
||||
};
|
||||
apiInstance.testEnumParameters(opts, (error, data, response) => {
|
||||
if (error) {
|
||||
console.error(error);
|
||||
} else {
|
||||
console.log('API called successfully.');
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**enumHeaderStringArray** | [**[String]**](String.md)| Header parameter enum test (string array) | [optional]
|
||||
**enumHeaderString** | **String**| Header parameter enum test (string) | [optional] [default to '-efg']
|
||||
**enumQueryStringArray** | [**[String]**](String.md)| Query parameter enum test (string array) | [optional]
|
||||
**enumQueryString** | **String**| Query parameter enum test (string) | [optional] [default to '-efg']
|
||||
**enumQueryInteger** | **Number**| Query parameter enum test (double) | [optional]
|
||||
**enumQueryDouble** | **Number**| Query parameter enum test (double) | [optional]
|
||||
**enumFormStringArray** | [**[String]**](String.md)| Form parameter enum test (string array) | [optional] [default to '$']
|
||||
**enumFormString** | **String**| Form parameter enum test (string) | [optional] [default to '-efg']
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/x-www-form-urlencoded
|
||||
- **Accept**: Not defined
|
||||
|
||||
<a name="testGroupParameters"></a>
|
||||
# **testGroupParameters**
|
||||
> testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, opts)
|
||||
|
||||
Fake endpoint to test group parameters (optional)
|
||||
|
||||
Fake endpoint to test group parameters (optional)
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
import OpenApiPetstore from 'open_api_petstore';
|
||||
|
||||
let apiInstance = new OpenApiPetstore.FakeApi();
|
||||
let requiredStringGroup = 56; // Number | Required String in group parameters
|
||||
let requiredBooleanGroup = true; // Boolean | Required Boolean in group parameters
|
||||
let requiredInt64Group = 789; // Number | Required Integer in group parameters
|
||||
let opts = {
|
||||
'stringGroup': 56, // Number | String in group parameters
|
||||
'booleanGroup': true, // Boolean | Boolean in group parameters
|
||||
'int64Group': 789 // Number | Integer in group parameters
|
||||
};
|
||||
apiInstance.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, opts, (error, data, response) => {
|
||||
if (error) {
|
||||
console.error(error);
|
||||
} else {
|
||||
console.log('API called successfully.');
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**requiredStringGroup** | **Number**| Required String in group parameters |
|
||||
**requiredBooleanGroup** | **Boolean**| Required Boolean in group parameters |
|
||||
**requiredInt64Group** | **Number**| Required Integer in group parameters |
|
||||
**stringGroup** | **Number**| String in group parameters | [optional]
|
||||
**booleanGroup** | **Boolean**| Boolean in group parameters | [optional]
|
||||
**int64Group** | **Number**| Integer in group parameters | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: Not defined
|
||||
|
||||
<a name="testInlineAdditionalProperties"></a>
|
||||
# **testInlineAdditionalProperties**
|
||||
> testInlineAdditionalProperties(requestBody)
|
||||
|
||||
test inline additionalProperties
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
import OpenApiPetstore from 'open_api_petstore';
|
||||
|
||||
let apiInstance = new OpenApiPetstore.FakeApi();
|
||||
let requestBody = {key: "null"}; // {String: String} | request body
|
||||
apiInstance.testInlineAdditionalProperties(requestBody, (error, data, response) => {
|
||||
if (error) {
|
||||
console.error(error);
|
||||
} else {
|
||||
console.log('API called successfully.');
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**requestBody** | [**{String: String}**](String.md)| request body |
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
<a name="testJsonFormData"></a>
|
||||
# **testJsonFormData**
|
||||
> testJsonFormData(param, param2)
|
||||
|
||||
test json serialization of form data
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
import OpenApiPetstore from 'open_api_petstore';
|
||||
|
||||
let apiInstance = new OpenApiPetstore.FakeApi();
|
||||
let param = "param_example"; // String | field1
|
||||
let param2 = "param2_example"; // String | field2
|
||||
apiInstance.testJsonFormData(param, param2, (error, data, response) => {
|
||||
if (error) {
|
||||
console.error(error);
|
||||
} else {
|
||||
console.log('API called successfully.');
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**param** | **String**| field1 |
|
||||
**param2** | **String**| field2 |
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/x-www-form-urlencoded
|
||||
- **Accept**: Not defined
|
||||
|
@ -0,0 +1,58 @@
|
||||
# OpenApiPetstore.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(client)
|
||||
|
||||
To test class name in snake case
|
||||
|
||||
To test class name in snake case
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
import OpenApiPetstore from 'open_api_petstore';
|
||||
let defaultClient = OpenApiPetstore.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 OpenApiPetstore.FakeClassnameTags123Api();
|
||||
let client = new OpenApiPetstore.Client(); // Client | client model
|
||||
apiInstance.testClassname(client, (error, data, response) => {
|
||||
if (error) {
|
||||
console.error(error);
|
||||
} else {
|
||||
console.log('API called successfully. Returned data: ' + data);
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**client** | [**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
|
||||
|
@ -0,0 +1,59 @@
|
||||
# SwaggerPetstore.Fake_classname_tags123Api
|
||||
|
||||
All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
[**testClassname**](Fake_classname_tags123Api.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.Fake_classname_tags123Api();
|
||||
|
||||
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
|
||||
|
@ -0,0 +1,8 @@
|
||||
# OpenApiPetstore.File
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**sourceURI** | **String** | Test capitalization | [optional]
|
||||
|
||||
|
@ -0,0 +1,9 @@
|
||||
# OpenApiPetstore.FileSchemaTestClass
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**file** | **File** | | [optional]
|
||||
**files** | **[File]** | | [optional]
|
||||
|
||||
|
@ -0,0 +1,8 @@
|
||||
# OpenApiPetstore.Foo
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**bar** | **String** | | [optional] [default to 'bar']
|
||||
|
||||
|
@ -0,0 +1,22 @@
|
||||
# OpenApiPetstore.FormatTest
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**integer** | **Number** | | [optional]
|
||||
**int32** | **Number** | | [optional]
|
||||
**int64** | **Number** | | [optional]
|
||||
**_number** | **Number** | |
|
||||
**_float** | **Number** | | [optional]
|
||||
**_double** | **Number** | | [optional]
|
||||
**_string** | **String** | | [optional]
|
||||
**_byte** | **Blob** | |
|
||||
**binary** | **File** | | [optional]
|
||||
**_date** | **Date** | |
|
||||
**dateTime** | **Date** | | [optional]
|
||||
**uuid** | **String** | | [optional]
|
||||
**password** | **String** | |
|
||||
**patternWithDigits** | **String** | A string that is a 10 digit number. Can have leading zeros. | [optional]
|
||||
**patternWithDigitsAndDelimiter** | **String** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional]
|
||||
|
||||
|
@ -0,0 +1,9 @@
|
||||
# OpenApiPetstore.HasOnlyReadOnly
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**bar** | **String** | | [optional]
|
||||
**foo** | **String** | | [optional]
|
||||
|
||||
|
@ -0,0 +1,9 @@
|
||||
# OpenApiPetstore.InlineObject
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**name** | **String** | Updated name of the pet | [optional]
|
||||
**status** | **String** | Updated status of the pet | [optional]
|
||||
|
||||
|
@ -0,0 +1,9 @@
|
||||
# OpenApiPetstore.InlineObject1
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**additionalMetadata** | **String** | Additional data to pass to server | [optional]
|
||||
**file** | **File** | file to upload | [optional]
|
||||
|
||||
|
@ -0,0 +1,33 @@
|
||||
# OpenApiPetstore.InlineObject2
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**enumFormStringArray** | **[String]** | Form parameter enum test (string array) | [optional]
|
||||
**enumFormString** | **String** | Form parameter enum test (string) | [optional] [default to '-efg']
|
||||
|
||||
|
||||
<a name="[EnumFormStringArrayEnum]"></a>
|
||||
## Enum: [EnumFormStringArrayEnum]
|
||||
|
||||
|
||||
* `GREATER_THAN` (value: `">"`)
|
||||
|
||||
* `DOLLAR` (value: `"$"`)
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="EnumFormStringEnum"></a>
|
||||
## Enum: EnumFormStringEnum
|
||||
|
||||
|
||||
* `_abc` (value: `"_abc"`)
|
||||
|
||||
* `-efg` (value: `"-efg"`)
|
||||
|
||||
* `(xyz)` (value: `"(xyz)"`)
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,21 @@
|
||||
# OpenApiPetstore.InlineObject3
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**integer** | **Number** | None | [optional]
|
||||
**int32** | **Number** | None | [optional]
|
||||
**int64** | **Number** | None | [optional]
|
||||
**_number** | **Number** | None |
|
||||
**_float** | **Number** | None | [optional]
|
||||
**_double** | **Number** | None |
|
||||
**_string** | **String** | None | [optional]
|
||||
**patternWithoutDelimiter** | **String** | None |
|
||||
**_byte** | **Blob** | None |
|
||||
**binary** | **File** | None | [optional]
|
||||
**_date** | **Date** | None | [optional]
|
||||
**dateTime** | **Date** | None | [optional]
|
||||
**password** | **String** | None | [optional]
|
||||
**callback** | **String** | None | [optional]
|
||||
|
||||
|
@ -0,0 +1,9 @@
|
||||
# OpenApiPetstore.InlineObject4
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**param** | **String** | field1 |
|
||||
**param2** | **String** | field2 |
|
||||
|
||||
|
@ -0,0 +1,9 @@
|
||||
# OpenApiPetstore.InlineObject5
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**additionalMetadata** | **String** | Additional data to pass to server | [optional]
|
||||
**requiredFile** | **File** | file to upload |
|
||||
|
||||
|
@ -0,0 +1,8 @@
|
||||
# OpenApiPetstore.InlineResponseDefault
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**_string** | [**Foo**](Foo.md) | | [optional]
|
||||
|
||||
|
@ -0,0 +1,8 @@
|
||||
# OpenApiPetstore.List
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**_123list** | **String** | | [optional]
|
||||
|
||||
|
@ -0,0 +1,22 @@
|
||||
# OpenApiPetstore.MapTest
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**mapMapOfString** | **{String: {String: String}}** | | [optional]
|
||||
**mapOfEnumString** | **{String: String}** | | [optional]
|
||||
**directMap** | **{String: Boolean}** | | [optional]
|
||||
**indirectMap** | **{String: Boolean}** | | [optional]
|
||||
|
||||
|
||||
<a name="{String: String}"></a>
|
||||
## Enum: {String: String}
|
||||
|
||||
|
||||
* `UPPER` (value: `"UPPER"`)
|
||||
|
||||
* `lower` (value: `"lower"`)
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,10 @@
|
||||
# OpenApiPetstore.MixedPropertiesAndAdditionalPropertiesClass
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**uuid** | **String** | | [optional]
|
||||
**dateTime** | **Date** | | [optional]
|
||||
**map** | [**{String: Animal}**](Animal.md) | | [optional]
|
||||
|
||||
|
@ -0,0 +1,9 @@
|
||||
# OpenApiPetstore.Model200Response
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**name** | **Number** | | [optional]
|
||||
**_class** | **String** | | [optional]
|
||||
|
||||
|
@ -0,0 +1,8 @@
|
||||
# OpenApiPetstore.ModelReturn
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**_return** | **Number** | | [optional]
|
||||
|
||||
|
11
samples/openapi3/client/petstore/javascript-es6/docs/Name.md
Normal file
11
samples/openapi3/client/petstore/javascript-es6/docs/Name.md
Normal file
@ -0,0 +1,11 @@
|
||||
# OpenApiPetstore.Name
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**name** | **Number** | |
|
||||
**snakeCase** | **Number** | | [optional]
|
||||
**property** | **String** | | [optional]
|
||||
**_123number** | **Number** | | [optional]
|
||||
|
||||
|
@ -0,0 +1,8 @@
|
||||
# OpenApiPetstore.NumberOnly
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**justNumber** | **Number** | | [optional]
|
||||
|
||||
|
@ -0,0 +1,26 @@
|
||||
# OpenApiPetstore.Order
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**id** | **Number** | | [optional]
|
||||
**petId** | **Number** | | [optional]
|
||||
**quantity** | **Number** | | [optional]
|
||||
**shipDate** | **Date** | | [optional]
|
||||
**status** | **String** | Order Status | [optional]
|
||||
**complete** | **Boolean** | | [optional] [default to false]
|
||||
|
||||
|
||||
<a name="StatusEnum"></a>
|
||||
## Enum: StatusEnum
|
||||
|
||||
|
||||
* `placed` (value: `"placed"`)
|
||||
|
||||
* `approved` (value: `"approved"`)
|
||||
|
||||
* `delivered` (value: `"delivered"`)
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,7 @@
|
||||
# SwaggerPetstore.OuterBoolean
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
|
||||
|
@ -0,0 +1,10 @@
|
||||
# OpenApiPetstore.OuterComposite
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**myNumber** | **Number** | | [optional]
|
||||
**myString** | **String** | | [optional]
|
||||
**myBoolean** | **Boolean** | | [optional]
|
||||
|
||||
|
@ -0,0 +1,12 @@
|
||||
# OpenApiPetstore.OuterEnum
|
||||
|
||||
## Enum
|
||||
|
||||
|
||||
* `placed` (value: `"placed"`)
|
||||
|
||||
* `approved` (value: `"approved"`)
|
||||
|
||||
* `delivered` (value: `"delivered"`)
|
||||
|
||||
|
@ -0,0 +1,7 @@
|
||||
# SwaggerPetstore.OuterNumber
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
|
||||
|
@ -0,0 +1,7 @@
|
||||
# SwaggerPetstore.OuterString
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
|
||||
|
26
samples/openapi3/client/petstore/javascript-es6/docs/Pet.md
Normal file
26
samples/openapi3/client/petstore/javascript-es6/docs/Pet.md
Normal file
@ -0,0 +1,26 @@
|
||||
# OpenApiPetstore.Pet
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**id** | **Number** | | [optional]
|
||||
**category** | [**Category**](Category.md) | | [optional]
|
||||
**name** | **String** | |
|
||||
**photoUrls** | **[String]** | |
|
||||
**tags** | [**[Tag]**](Tag.md) | | [optional]
|
||||
**status** | **String** | pet status in the store | [optional]
|
||||
|
||||
|
||||
<a name="StatusEnum"></a>
|
||||
## Enum: StatusEnum
|
||||
|
||||
|
||||
* `available` (value: `"available"`)
|
||||
|
||||
* `pending` (value: `"pending"`)
|
||||
|
||||
* `sold` (value: `"sold"`)
|
||||
|
||||
|
||||
|
||||
|
452
samples/openapi3/client/petstore/javascript-es6/docs/PetApi.md
Normal file
452
samples/openapi3/client/petstore/javascript-es6/docs/PetApi.md
Normal file
@ -0,0 +1,452 @@
|
||||
# OpenApiPetstore.PetApi
|
||||
|
||||
All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
[**addPet**](PetApi.md#addPet) | **POST** /pet | Add a new pet to the store
|
||||
[**deletePet**](PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet
|
||||
[**findPetsByStatus**](PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status
|
||||
[**findPetsByTags**](PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags
|
||||
[**getPetById**](PetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID
|
||||
[**updatePet**](PetApi.md#updatePet) | **PUT** /pet | Update an existing pet
|
||||
[**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data
|
||||
[**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image
|
||||
[**uploadFileWithRequiredFile**](PetApi.md#uploadFileWithRequiredFile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required)
|
||||
|
||||
|
||||
<a name="addPet"></a>
|
||||
# **addPet**
|
||||
> addPet(pet)
|
||||
|
||||
Add a new pet to the store
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
import OpenApiPetstore from 'open_api_petstore';
|
||||
let defaultClient = OpenApiPetstore.ApiClient.instance;
|
||||
|
||||
// Configure OAuth2 access token for authorization: petstore_auth
|
||||
let petstore_auth = defaultClient.authentications['petstore_auth'];
|
||||
petstore_auth.accessToken = 'YOUR ACCESS TOKEN';
|
||||
|
||||
let apiInstance = new OpenApiPetstore.PetApi();
|
||||
let pet = new OpenApiPetstore.Pet(); // Pet | Pet object that needs to be added to the store
|
||||
apiInstance.addPet(pet, (error, data, response) => {
|
||||
if (error) {
|
||||
console.error(error);
|
||||
} else {
|
||||
console.log('API called successfully.');
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
[petstore_auth](../README.md#petstore_auth)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json, application/xml
|
||||
- **Accept**: Not defined
|
||||
|
||||
<a name="deletePet"></a>
|
||||
# **deletePet**
|
||||
> deletePet(petId, opts)
|
||||
|
||||
Deletes a pet
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
import OpenApiPetstore from 'open_api_petstore';
|
||||
let defaultClient = OpenApiPetstore.ApiClient.instance;
|
||||
|
||||
// Configure OAuth2 access token for authorization: petstore_auth
|
||||
let petstore_auth = defaultClient.authentications['petstore_auth'];
|
||||
petstore_auth.accessToken = 'YOUR ACCESS TOKEN';
|
||||
|
||||
let apiInstance = new OpenApiPetstore.PetApi();
|
||||
let petId = 789; // Number | Pet id to delete
|
||||
let opts = {
|
||||
'apiKey': "apiKey_example" // String |
|
||||
};
|
||||
apiInstance.deletePet(petId, opts, (error, data, response) => {
|
||||
if (error) {
|
||||
console.error(error);
|
||||
} else {
|
||||
console.log('API called successfully.');
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**petId** | **Number**| Pet id to delete |
|
||||
**apiKey** | **String**| | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
[petstore_auth](../README.md#petstore_auth)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: Not defined
|
||||
|
||||
<a name="findPetsByStatus"></a>
|
||||
# **findPetsByStatus**
|
||||
> [Pet] findPetsByStatus(status)
|
||||
|
||||
Finds Pets by status
|
||||
|
||||
Multiple status values can be provided with comma separated strings
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
import OpenApiPetstore from 'open_api_petstore';
|
||||
let defaultClient = OpenApiPetstore.ApiClient.instance;
|
||||
|
||||
// Configure OAuth2 access token for authorization: petstore_auth
|
||||
let petstore_auth = defaultClient.authentications['petstore_auth'];
|
||||
petstore_auth.accessToken = 'YOUR ACCESS TOKEN';
|
||||
|
||||
let apiInstance = new OpenApiPetstore.PetApi();
|
||||
let status = ["'available'"]; // [String] | Status values that need to be considered for filter
|
||||
apiInstance.findPetsByStatus(status, (error, data, response) => {
|
||||
if (error) {
|
||||
console.error(error);
|
||||
} else {
|
||||
console.log('API called successfully. Returned data: ' + data);
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**status** | [**[String]**](String.md)| Status values that need to be considered for filter |
|
||||
|
||||
### Return type
|
||||
|
||||
[**[Pet]**](Pet.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
[petstore_auth](../README.md#petstore_auth)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
<a name="findPetsByTags"></a>
|
||||
# **findPetsByTags**
|
||||
> [Pet] findPetsByTags(tags)
|
||||
|
||||
Finds Pets by tags
|
||||
|
||||
Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
import OpenApiPetstore from 'open_api_petstore';
|
||||
let defaultClient = OpenApiPetstore.ApiClient.instance;
|
||||
|
||||
// Configure OAuth2 access token for authorization: petstore_auth
|
||||
let petstore_auth = defaultClient.authentications['petstore_auth'];
|
||||
petstore_auth.accessToken = 'YOUR ACCESS TOKEN';
|
||||
|
||||
let apiInstance = new OpenApiPetstore.PetApi();
|
||||
let tags = ["null"]; // [String] | Tags to filter by
|
||||
apiInstance.findPetsByTags(tags, (error, data, response) => {
|
||||
if (error) {
|
||||
console.error(error);
|
||||
} else {
|
||||
console.log('API called successfully. Returned data: ' + data);
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**tags** | [**[String]**](String.md)| Tags to filter by |
|
||||
|
||||
### Return type
|
||||
|
||||
[**[Pet]**](Pet.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
[petstore_auth](../README.md#petstore_auth)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
<a name="getPetById"></a>
|
||||
# **getPetById**
|
||||
> Pet getPetById(petId)
|
||||
|
||||
Find pet by ID
|
||||
|
||||
Returns a single pet
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
import OpenApiPetstore from 'open_api_petstore';
|
||||
let defaultClient = OpenApiPetstore.ApiClient.instance;
|
||||
|
||||
// Configure API key authorization: api_key
|
||||
let api_key = defaultClient.authentications['api_key'];
|
||||
api_key.apiKey = 'YOUR API KEY';
|
||||
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
|
||||
//api_key.apiKeyPrefix = 'Token';
|
||||
|
||||
let apiInstance = new OpenApiPetstore.PetApi();
|
||||
let petId = 789; // Number | ID of pet to return
|
||||
apiInstance.getPetById(petId, (error, data, response) => {
|
||||
if (error) {
|
||||
console.error(error);
|
||||
} else {
|
||||
console.log('API called successfully. Returned data: ' + data);
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**petId** | **Number**| ID of pet to return |
|
||||
|
||||
### Return type
|
||||
|
||||
[**Pet**](Pet.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
[api_key](../README.md#api_key)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
<a name="updatePet"></a>
|
||||
# **updatePet**
|
||||
> updatePet(pet)
|
||||
|
||||
Update an existing pet
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
import OpenApiPetstore from 'open_api_petstore';
|
||||
let defaultClient = OpenApiPetstore.ApiClient.instance;
|
||||
|
||||
// Configure OAuth2 access token for authorization: petstore_auth
|
||||
let petstore_auth = defaultClient.authentications['petstore_auth'];
|
||||
petstore_auth.accessToken = 'YOUR ACCESS TOKEN';
|
||||
|
||||
let apiInstance = new OpenApiPetstore.PetApi();
|
||||
let pet = new OpenApiPetstore.Pet(); // Pet | Pet object that needs to be added to the store
|
||||
apiInstance.updatePet(pet, (error, data, response) => {
|
||||
if (error) {
|
||||
console.error(error);
|
||||
} else {
|
||||
console.log('API called successfully.');
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
[petstore_auth](../README.md#petstore_auth)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json, application/xml
|
||||
- **Accept**: Not defined
|
||||
|
||||
<a name="updatePetWithForm"></a>
|
||||
# **updatePetWithForm**
|
||||
> updatePetWithForm(petId, opts)
|
||||
|
||||
Updates a pet in the store with form data
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
import OpenApiPetstore from 'open_api_petstore';
|
||||
let defaultClient = OpenApiPetstore.ApiClient.instance;
|
||||
|
||||
// Configure OAuth2 access token for authorization: petstore_auth
|
||||
let petstore_auth = defaultClient.authentications['petstore_auth'];
|
||||
petstore_auth.accessToken = 'YOUR ACCESS TOKEN';
|
||||
|
||||
let apiInstance = new OpenApiPetstore.PetApi();
|
||||
let petId = 789; // Number | ID of pet that needs to be updated
|
||||
let opts = {
|
||||
'name': "name_example", // String | Updated name of the pet
|
||||
'status': "status_example" // String | Updated status of the pet
|
||||
};
|
||||
apiInstance.updatePetWithForm(petId, opts, (error, data, response) => {
|
||||
if (error) {
|
||||
console.error(error);
|
||||
} else {
|
||||
console.log('API called successfully.');
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**petId** | **Number**| ID of pet that needs to be updated |
|
||||
**name** | **String**| Updated name of the pet | [optional]
|
||||
**status** | **String**| Updated status of the pet | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
[petstore_auth](../README.md#petstore_auth)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/x-www-form-urlencoded
|
||||
- **Accept**: Not defined
|
||||
|
||||
<a name="uploadFile"></a>
|
||||
# **uploadFile**
|
||||
> ApiResponse uploadFile(petId, opts)
|
||||
|
||||
uploads an image
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
import OpenApiPetstore from 'open_api_petstore';
|
||||
let defaultClient = OpenApiPetstore.ApiClient.instance;
|
||||
|
||||
// Configure OAuth2 access token for authorization: petstore_auth
|
||||
let petstore_auth = defaultClient.authentications['petstore_auth'];
|
||||
petstore_auth.accessToken = 'YOUR ACCESS TOKEN';
|
||||
|
||||
let apiInstance = new OpenApiPetstore.PetApi();
|
||||
let petId = 789; // Number | ID of pet to update
|
||||
let opts = {
|
||||
'additionalMetadata': "additionalMetadata_example", // String | Additional data to pass to server
|
||||
'file': "/path/to/file" // File | file to upload
|
||||
};
|
||||
apiInstance.uploadFile(petId, opts, (error, data, response) => {
|
||||
if (error) {
|
||||
console.error(error);
|
||||
} else {
|
||||
console.log('API called successfully. Returned data: ' + data);
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**petId** | **Number**| ID of pet to update |
|
||||
**additionalMetadata** | **String**| Additional data to pass to server | [optional]
|
||||
**file** | **File**| file to upload | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
[**ApiResponse**](ApiResponse.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
[petstore_auth](../README.md#petstore_auth)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: multipart/form-data
|
||||
- **Accept**: application/json
|
||||
|
||||
<a name="uploadFileWithRequiredFile"></a>
|
||||
# **uploadFileWithRequiredFile**
|
||||
> ApiResponse uploadFileWithRequiredFile(petId, requiredFile, opts)
|
||||
|
||||
uploads an image (required)
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
import OpenApiPetstore from 'open_api_petstore';
|
||||
let defaultClient = OpenApiPetstore.ApiClient.instance;
|
||||
|
||||
// Configure OAuth2 access token for authorization: petstore_auth
|
||||
let petstore_auth = defaultClient.authentications['petstore_auth'];
|
||||
petstore_auth.accessToken = 'YOUR ACCESS TOKEN';
|
||||
|
||||
let apiInstance = new OpenApiPetstore.PetApi();
|
||||
let petId = 789; // Number | ID of pet to update
|
||||
let requiredFile = "/path/to/file"; // File | file to upload
|
||||
let opts = {
|
||||
'additionalMetadata': "additionalMetadata_example" // String | Additional data to pass to server
|
||||
};
|
||||
apiInstance.uploadFileWithRequiredFile(petId, requiredFile, opts, (error, data, response) => {
|
||||
if (error) {
|
||||
console.error(error);
|
||||
} else {
|
||||
console.log('API called successfully. Returned data: ' + data);
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**petId** | **Number**| ID of pet to update |
|
||||
**requiredFile** | **File**| file to upload |
|
||||
**additionalMetadata** | **String**| Additional data to pass to server | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
[**ApiResponse**](ApiResponse.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
[petstore_auth](../README.md#petstore_auth)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: multipart/form-data
|
||||
- **Accept**: application/json
|
||||
|
@ -0,0 +1,9 @@
|
||||
# OpenApiPetstore.ReadOnlyFirst
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**bar** | **String** | | [optional]
|
||||
**baz** | **String** | | [optional]
|
||||
|
||||
|
@ -0,0 +1,8 @@
|
||||
# OpenApiPetstore.SpecialModelName
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**specialPropertyName** | **Number** | | [optional]
|
||||
|
||||
|
181
samples/openapi3/client/petstore/javascript-es6/docs/StoreApi.md
Normal file
181
samples/openapi3/client/petstore/javascript-es6/docs/StoreApi.md
Normal file
@ -0,0 +1,181 @@
|
||||
# OpenApiPetstore.StoreApi
|
||||
|
||||
All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID
|
||||
[**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status
|
||||
[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID
|
||||
[**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet
|
||||
|
||||
|
||||
<a name="deleteOrder"></a>
|
||||
# **deleteOrder**
|
||||
> deleteOrder(orderId)
|
||||
|
||||
Delete purchase order by ID
|
||||
|
||||
For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
import OpenApiPetstore from 'open_api_petstore';
|
||||
|
||||
let apiInstance = new OpenApiPetstore.StoreApi();
|
||||
let orderId = "orderId_example"; // String | ID of the order that needs to be deleted
|
||||
apiInstance.deleteOrder(orderId, (error, data, response) => {
|
||||
if (error) {
|
||||
console.error(error);
|
||||
} else {
|
||||
console.log('API called successfully.');
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**orderId** | **String**| ID of the order that needs to be deleted |
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: Not defined
|
||||
|
||||
<a name="getInventory"></a>
|
||||
# **getInventory**
|
||||
> {String: Number} getInventory()
|
||||
|
||||
Returns pet inventories by status
|
||||
|
||||
Returns a map of status codes to quantities
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
import OpenApiPetstore from 'open_api_petstore';
|
||||
let defaultClient = OpenApiPetstore.ApiClient.instance;
|
||||
|
||||
// Configure API key authorization: api_key
|
||||
let api_key = defaultClient.authentications['api_key'];
|
||||
api_key.apiKey = 'YOUR API KEY';
|
||||
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
|
||||
//api_key.apiKeyPrefix = 'Token';
|
||||
|
||||
let apiInstance = new OpenApiPetstore.StoreApi();
|
||||
apiInstance.getInventory((error, data, response) => {
|
||||
if (error) {
|
||||
console.error(error);
|
||||
} else {
|
||||
console.log('API called successfully. Returned data: ' + data);
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
### Parameters
|
||||
This endpoint does not need any parameter.
|
||||
|
||||
### Return type
|
||||
|
||||
**{String: Number}**
|
||||
|
||||
### Authorization
|
||||
|
||||
[api_key](../README.md#api_key)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json
|
||||
|
||||
<a name="getOrderById"></a>
|
||||
# **getOrderById**
|
||||
> Order getOrderById(orderId)
|
||||
|
||||
Find purchase order by ID
|
||||
|
||||
For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
import OpenApiPetstore from 'open_api_petstore';
|
||||
|
||||
let apiInstance = new OpenApiPetstore.StoreApi();
|
||||
let orderId = 789; // Number | ID of pet that needs to be fetched
|
||||
apiInstance.getOrderById(orderId, (error, data, response) => {
|
||||
if (error) {
|
||||
console.error(error);
|
||||
} else {
|
||||
console.log('API called successfully. Returned data: ' + data);
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**orderId** | **Number**| ID of pet that needs to be fetched |
|
||||
|
||||
### Return type
|
||||
|
||||
[**Order**](Order.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
<a name="placeOrder"></a>
|
||||
# **placeOrder**
|
||||
> Order placeOrder(order)
|
||||
|
||||
Place an order for a pet
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
import OpenApiPetstore from 'open_api_petstore';
|
||||
|
||||
let apiInstance = new OpenApiPetstore.StoreApi();
|
||||
let order = new OpenApiPetstore.Order(); // Order | order placed for purchasing the pet
|
||||
apiInstance.placeOrder(order, (error, data, response) => {
|
||||
if (error) {
|
||||
console.error(error);
|
||||
} else {
|
||||
console.log('API called successfully. Returned data: ' + data);
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**order** | [**Order**](Order.md)| order placed for purchasing the pet |
|
||||
|
||||
### Return type
|
||||
|
||||
[**Order**](Order.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: application/xml, application/json
|
||||
|
@ -0,0 +1,7 @@
|
||||
# OpenApiPetstore.StringBooleanMap
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
|
||||
|
@ -0,0 +1,9 @@
|
||||
# OpenApiPetstore.Tag
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**id** | **Number** | | [optional]
|
||||
**name** | **String** | | [optional]
|
||||
|
||||
|
@ -0,0 +1,12 @@
|
||||
# OpenApiPetstore.TypeHolderDefault
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**stringItem** | **String** | | [default to 'what']
|
||||
**numberItem** | **Number** | |
|
||||
**integerItem** | **Number** | |
|
||||
**boolItem** | **Boolean** | | [default to true]
|
||||
**arrayItem** | **[Number]** | |
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user