forked from loafle/openapi-generator-original
Fix JS test using baseName in default value (#5)
* fix js test using baseName in default value * re-enable JS test
This commit is contained in:
parent
e33f9e52b2
commit
d80e295852
@ -617,7 +617,7 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo
|
|||||||
public String toDefaultValueWithParam(String name, Schema p) {
|
public String toDefaultValueWithParam(String name, Schema p) {
|
||||||
String type = normalizeType(getTypeDeclaration(p));
|
String type = normalizeType(getTypeDeclaration(p));
|
||||||
if (!StringUtils.isEmpty(p.get$ref())) {
|
if (!StringUtils.isEmpty(p.get$ref())) {
|
||||||
return " = " + type + ".constructFromObject(data['" + getSchemaType(p) + "']);";
|
return " = " + type + ".constructFromObject(data['" + name + "']);";
|
||||||
} else {
|
} else {
|
||||||
return " = ApiClient.convertToType(data['" + name + "'], " + type + ");";
|
return " = ApiClient.convertToType(data['" + name + "'], " + type + ");";
|
||||||
}
|
}
|
||||||
|
2
pom.xml
2
pom.xml
@ -857,7 +857,7 @@
|
|||||||
<module>samples/openapi3/client/petstore/php/OpenAPIClient-php</module>
|
<module>samples/openapi3/client/petstore/php/OpenAPIClient-php</module>
|
||||||
<module>samples/client/petstore/scala</module>
|
<module>samples/client/petstore/scala</module>
|
||||||
<module>samples/client/petstore/akka-scala</module>
|
<module>samples/client/petstore/akka-scala</module>
|
||||||
<!--<module>samples/client/petstore/javascript</module>-->
|
<module>samples/client/petstore/javascript</module>
|
||||||
<module>samples/client/petstore/python</module>
|
<module>samples/client/petstore/python</module>
|
||||||
<module>samples/client/petstore/python-tornado</module>
|
<module>samples/client/petstore/python-tornado</module>
|
||||||
<module>samples/client/petstore/python-asyncio</module>
|
<module>samples/client/petstore/python-asyncio</module>
|
||||||
|
@ -1,9 +0,0 @@
|
|||||||
# OpenApiPetstore.AdditionalPropertiesClass
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------ | ------------- | ------------- | -------------
|
|
||||||
**mapProperty** | **{String: String}** | | [optional]
|
|
||||||
**mapOfMapProperty** | **{String: {String: String}}** | | [optional]
|
|
||||||
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
|||||||
# OpenApiPetstore.Animal
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------ | ------------- | ------------- | -------------
|
|
||||||
**className** | **String** | |
|
|
||||||
**color** | **String** | | [optional] [default to 'red']
|
|
||||||
|
|
||||||
|
|
@ -1,7 +0,0 @@
|
|||||||
# OpenApiPetstore.AnimalFarm
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------ | ------------- | ------------- | -------------
|
|
||||||
|
|
||||||
|
|
@ -1,52 +0,0 @@
|
|||||||
# OpenApiPetstore.AnotherFakeApi
|
|
||||||
|
|
||||||
All URIs are relative to *http://petstore.swagger.io:80/v2*
|
|
||||||
|
|
||||||
Method | HTTP request | Description
|
|
||||||
------------- | ------------- | -------------
|
|
||||||
[**testSpecialTags**](AnotherFakeApi.md#testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags
|
|
||||||
|
|
||||||
|
|
||||||
<a name="testSpecialTags"></a>
|
|
||||||
# **testSpecialTags**
|
|
||||||
> Client testSpecialTags(client)
|
|
||||||
|
|
||||||
To test special tags
|
|
||||||
|
|
||||||
To test special tags
|
|
||||||
|
|
||||||
### Example
|
|
||||||
```javascript
|
|
||||||
var OpenApiPetstore = require('open_api_petstore');
|
|
||||||
|
|
||||||
var apiInstance = 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);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
apiInstance.testSpecialTags(client, callback);
|
|
||||||
```
|
|
||||||
|
|
||||||
### 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
|
|
||||||
|
|
@ -1,10 +0,0 @@
|
|||||||
# OpenApiPetstore.ApiResponse
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------ | ------------- | ------------- | -------------
|
|
||||||
**code** | **Number** | | [optional]
|
|
||||||
**type** | **String** | | [optional]
|
|
||||||
**message** | **String** | | [optional]
|
|
||||||
|
|
||||||
|
|
@ -1,8 +0,0 @@
|
|||||||
# OpenApiPetstore.ArrayOfArrayOfNumberOnly
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------ | ------------- | ------------- | -------------
|
|
||||||
**arrayArrayNumber** | **[[Number]]** | | [optional]
|
|
||||||
|
|
||||||
|
|
@ -1,8 +0,0 @@
|
|||||||
# OpenApiPetstore.ArrayOfNumberOnly
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------ | ------------- | ------------- | -------------
|
|
||||||
**arrayNumber** | **[Number]** | | [optional]
|
|
||||||
|
|
||||||
|
|
@ -1,10 +0,0 @@
|
|||||||
# OpenApiPetstore.ArrayTest
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------ | ------------- | ------------- | -------------
|
|
||||||
**arrayOfString** | **[String]** | | [optional]
|
|
||||||
**arrayArrayOfInteger** | **[[Number]]** | | [optional]
|
|
||||||
**arrayArrayOfModel** | **[[ReadOnlyFirst]]** | | [optional]
|
|
||||||
|
|
||||||
|
|
@ -1,13 +0,0 @@
|
|||||||
# 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]
|
|
||||||
|
|
||||||
|
|
@ -1,8 +0,0 @@
|
|||||||
# OpenApiPetstore.Cat
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------ | ------------- | ------------- | -------------
|
|
||||||
**declawed** | **Boolean** | | [optional]
|
|
||||||
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
|||||||
# OpenApiPetstore.Category
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------ | ------------- | ------------- | -------------
|
|
||||||
**id** | **Number** | | [optional]
|
|
||||||
**name** | **String** | | [optional]
|
|
||||||
|
|
||||||
|
|
@ -1,8 +0,0 @@
|
|||||||
# OpenApiPetstore.ClassModel
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------ | ------------- | ------------- | -------------
|
|
||||||
**_class** | **String** | | [optional]
|
|
||||||
|
|
||||||
|
|
@ -1,8 +0,0 @@
|
|||||||
# OpenApiPetstore.Client
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------ | ------------- | ------------- | -------------
|
|
||||||
**client** | **String** | | [optional]
|
|
||||||
|
|
||||||
|
|
@ -1,8 +0,0 @@
|
|||||||
# OpenApiPetstore.Dog
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------ | ------------- | ------------- | -------------
|
|
||||||
**breed** | **String** | | [optional]
|
|
||||||
|
|
||||||
|
|
@ -1,31 +0,0 @@
|
|||||||
# 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"`)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,12 +0,0 @@
|
|||||||
# OpenApiPetstore.EnumClass
|
|
||||||
|
|
||||||
## Enum
|
|
||||||
|
|
||||||
|
|
||||||
* `_abc` (value: `"_abc"`)
|
|
||||||
|
|
||||||
* `-efg` (value: `"-efg"`)
|
|
||||||
|
|
||||||
* `(xyz)` (value: `"(xyz)"`)
|
|
||||||
|
|
||||||
|
|
@ -1,60 +0,0 @@
|
|||||||
# 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`)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,504 +0,0 @@
|
|||||||
# 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 |
|
|
||||||
[**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
|
|
||||||
[**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
|
|
||||||
var OpenApiPetstore = require('open_api_petstore');
|
|
||||||
|
|
||||||
var apiInstance = new OpenApiPetstore.FakeApi();
|
|
||||||
var opts = {
|
|
||||||
'body': true // Boolean | Input boolean as post body
|
|
||||||
};
|
|
||||||
var callback = function(error, data, response) {
|
|
||||||
if (error) {
|
|
||||||
console.error(error);
|
|
||||||
} else {
|
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
apiInstance.fakeOuterBooleanSerialize(opts, callback);
|
|
||||||
```
|
|
||||||
|
|
||||||
### 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**: Not defined
|
|
||||||
- **Accept**: */*
|
|
||||||
|
|
||||||
<a name="fakeOuterCompositeSerialize"></a>
|
|
||||||
# **fakeOuterCompositeSerialize**
|
|
||||||
> OuterComposite fakeOuterCompositeSerialize(opts)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Test serialization of object with outer number type
|
|
||||||
|
|
||||||
### Example
|
|
||||||
```javascript
|
|
||||||
var OpenApiPetstore = require('open_api_petstore');
|
|
||||||
|
|
||||||
var apiInstance = new OpenApiPetstore.FakeApi();
|
|
||||||
var opts = {
|
|
||||||
'outerComposite': new OpenApiPetstore.OuterComposite() // OuterComposite | Input composite as post body
|
|
||||||
};
|
|
||||||
var callback = function(error, data, response) {
|
|
||||||
if (error) {
|
|
||||||
console.error(error);
|
|
||||||
} else {
|
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
apiInstance.fakeOuterCompositeSerialize(opts, callback);
|
|
||||||
```
|
|
||||||
|
|
||||||
### 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**: Not defined
|
|
||||||
- **Accept**: */*
|
|
||||||
|
|
||||||
<a name="fakeOuterNumberSerialize"></a>
|
|
||||||
# **fakeOuterNumberSerialize**
|
|
||||||
> Number fakeOuterNumberSerialize(opts)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Test serialization of outer number types
|
|
||||||
|
|
||||||
### Example
|
|
||||||
```javascript
|
|
||||||
var OpenApiPetstore = require('open_api_petstore');
|
|
||||||
|
|
||||||
var apiInstance = new OpenApiPetstore.FakeApi();
|
|
||||||
var opts = {
|
|
||||||
'body': 3.4 // Number | Input number as post body
|
|
||||||
};
|
|
||||||
var callback = function(error, data, response) {
|
|
||||||
if (error) {
|
|
||||||
console.error(error);
|
|
||||||
} else {
|
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
apiInstance.fakeOuterNumberSerialize(opts, callback);
|
|
||||||
```
|
|
||||||
|
|
||||||
### 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**: Not defined
|
|
||||||
- **Accept**: */*
|
|
||||||
|
|
||||||
<a name="fakeOuterStringSerialize"></a>
|
|
||||||
# **fakeOuterStringSerialize**
|
|
||||||
> String fakeOuterStringSerialize(opts)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Test serialization of outer string types
|
|
||||||
|
|
||||||
### Example
|
|
||||||
```javascript
|
|
||||||
var OpenApiPetstore = require('open_api_petstore');
|
|
||||||
|
|
||||||
var apiInstance = new OpenApiPetstore.FakeApi();
|
|
||||||
var opts = {
|
|
||||||
'body': "body_example" // String | Input string as post body
|
|
||||||
};
|
|
||||||
var callback = function(error, data, response) {
|
|
||||||
if (error) {
|
|
||||||
console.error(error);
|
|
||||||
} else {
|
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
apiInstance.fakeOuterStringSerialize(opts, callback);
|
|
||||||
```
|
|
||||||
|
|
||||||
### 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**: Not defined
|
|
||||||
- **Accept**: */*
|
|
||||||
|
|
||||||
<a name="testBodyWithQueryParams"></a>
|
|
||||||
# **testBodyWithQueryParams**
|
|
||||||
> testBodyWithQueryParams(query, user)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Example
|
|
||||||
```javascript
|
|
||||||
var OpenApiPetstore = require('open_api_petstore');
|
|
||||||
|
|
||||||
var apiInstance = new OpenApiPetstore.FakeApi();
|
|
||||||
var query = "query_example"; // String |
|
|
||||||
var user = new OpenApiPetstore.User(); // User |
|
|
||||||
var callback = function(error, data, response) {
|
|
||||||
if (error) {
|
|
||||||
console.error(error);
|
|
||||||
} else {
|
|
||||||
console.log('API called successfully.');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
apiInstance.testBodyWithQueryParams(query, user, callback);
|
|
||||||
```
|
|
||||||
|
|
||||||
### 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
|
|
||||||
var OpenApiPetstore = require('open_api_petstore');
|
|
||||||
|
|
||||||
var apiInstance = new OpenApiPetstore.FakeApi();
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
apiInstance.testClientModel(client, callback);
|
|
||||||
```
|
|
||||||
|
|
||||||
### 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
|
|
||||||
var OpenApiPetstore = require('open_api_petstore');
|
|
||||||
var defaultClient = OpenApiPetstore.ApiClient.instance;
|
|
||||||
|
|
||||||
// Configure HTTP basic authorization: http_basic_test
|
|
||||||
var http_basic_test = defaultClient.authentications['http_basic_test'];
|
|
||||||
http_basic_test.username = 'YOUR USERNAME';
|
|
||||||
http_basic_test.password = 'YOUR PASSWORD';
|
|
||||||
|
|
||||||
var apiInstance = new OpenApiPetstore.FakeApi();
|
|
||||||
var _number = 3.4; // Number | None
|
|
||||||
var _double = 3.4; // Number | None
|
|
||||||
var patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None
|
|
||||||
var _byte = null; // Blob | None
|
|
||||||
var 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
|
|
||||||
};
|
|
||||||
var callback = function(error, data, response) {
|
|
||||||
if (error) {
|
|
||||||
console.error(error);
|
|
||||||
} else {
|
|
||||||
console.log('API called successfully.');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
apiInstance.testEndpointParameters(_number, _double, patternWithoutDelimiter, _byte, opts, callback);
|
|
||||||
```
|
|
||||||
|
|
||||||
### 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
|
|
||||||
var OpenApiPetstore = require('open_api_petstore');
|
|
||||||
|
|
||||||
var apiInstance = new OpenApiPetstore.FakeApi();
|
|
||||||
var 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)
|
|
||||||
};
|
|
||||||
var callback = function(error, data, response) {
|
|
||||||
if (error) {
|
|
||||||
console.error(error);
|
|
||||||
} else {
|
|
||||||
console.log('API called successfully.');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
apiInstance.testEnumParameters(opts, callback);
|
|
||||||
```
|
|
||||||
|
|
||||||
### 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]**| 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="testInlineAdditionalProperties"></a>
|
|
||||||
# **testInlineAdditionalProperties**
|
|
||||||
> testInlineAdditionalProperties(requestBody)
|
|
||||||
|
|
||||||
test inline additionalProperties
|
|
||||||
|
|
||||||
### Example
|
|
||||||
```javascript
|
|
||||||
var OpenApiPetstore = require('open_api_petstore');
|
|
||||||
|
|
||||||
var apiInstance = new OpenApiPetstore.FakeApi();
|
|
||||||
var requestBody = {key: "inner_example"}; // {String: String} | request body
|
|
||||||
var callback = function(error, data, response) {
|
|
||||||
if (error) {
|
|
||||||
console.error(error);
|
|
||||||
} else {
|
|
||||||
console.log('API called successfully.');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
apiInstance.testInlineAdditionalProperties(requestBody, callback);
|
|
||||||
```
|
|
||||||
|
|
||||||
### 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
|
|
||||||
var OpenApiPetstore = require('open_api_petstore');
|
|
||||||
|
|
||||||
var apiInstance = new OpenApiPetstore.FakeApi();
|
|
||||||
var param = "param_example"; // String | field1
|
|
||||||
var param2 = "param2_example"; // String | field2
|
|
||||||
var callback = function(error, data, response) {
|
|
||||||
if (error) {
|
|
||||||
console.error(error);
|
|
||||||
} else {
|
|
||||||
console.log('API called successfully.');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
apiInstance.testJsonFormData(param, param2, callback);
|
|
||||||
```
|
|
||||||
|
|
||||||
### 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
|
|
||||||
|
|
@ -1,58 +0,0 @@
|
|||||||
# 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
|
|
||||||
var OpenApiPetstore = require('open_api_petstore');
|
|
||||||
var defaultClient = OpenApiPetstore.ApiClient.instance;
|
|
||||||
// Configure API key authorization: api_key_query
|
|
||||||
var api_key_query = defaultClient.authentications['api_key_query'];
|
|
||||||
api_key_query.apiKey = 'YOUR API KEY';
|
|
||||||
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
|
|
||||||
//api_key_query.apiKeyPrefix = 'Token';
|
|
||||||
|
|
||||||
var apiInstance = new OpenApiPetstore.FakeClassnameTags123Api();
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
apiInstance.testClassname(client, callback);
|
|
||||||
```
|
|
||||||
|
|
||||||
### 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
|
|
||||||
|
|
@ -1,20 +0,0 @@
|
|||||||
# 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** | |
|
|
||||||
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
|||||||
# OpenApiPetstore.HasOnlyReadOnly
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------ | ------------- | ------------- | -------------
|
|
||||||
**bar** | **String** | | [optional]
|
|
||||||
**foo** | **String** | | [optional]
|
|
||||||
|
|
||||||
|
|
@ -1,8 +0,0 @@
|
|||||||
# OpenApiPetstore.List
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------ | ------------- | ------------- | -------------
|
|
||||||
**_123list** | **String** | | [optional]
|
|
||||||
|
|
||||||
|
|
@ -1,20 +0,0 @@
|
|||||||
# OpenApiPetstore.MapTest
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------ | ------------- | ------------- | -------------
|
|
||||||
**mapMapOfString** | **{String: {String: String}}** | | [optional]
|
|
||||||
**mapOfEnumString** | **{String: String}** | | [optional]
|
|
||||||
|
|
||||||
|
|
||||||
<a name="{String: String}"></a>
|
|
||||||
## Enum: {String: String}
|
|
||||||
|
|
||||||
|
|
||||||
* `UPPER` (value: `"UPPER"`)
|
|
||||||
|
|
||||||
* `lower` (value: `"lower"`)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,10 +0,0 @@
|
|||||||
# OpenApiPetstore.MixedPropertiesAndAdditionalPropertiesClass
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------ | ------------- | ------------- | -------------
|
|
||||||
**uuid** | **String** | | [optional]
|
|
||||||
**dateTime** | **Date** | | [optional]
|
|
||||||
**map** | [**{String: Animal}**](Animal.md) | | [optional]
|
|
||||||
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
|||||||
# OpenApiPetstore.Model200Response
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------ | ------------- | ------------- | -------------
|
|
||||||
**name** | **Number** | | [optional]
|
|
||||||
**_class** | **String** | | [optional]
|
|
||||||
|
|
||||||
|
|
@ -1,8 +0,0 @@
|
|||||||
# OpenApiPetstore.ModelReturn
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------ | ------------- | ------------- | -------------
|
|
||||||
**_return** | **Number** | | [optional]
|
|
||||||
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
|||||||
# OpenApiPetstore.Name
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------ | ------------- | ------------- | -------------
|
|
||||||
**name** | **Number** | |
|
|
||||||
**snakeCase** | **Number** | | [optional]
|
|
||||||
**property** | **String** | | [optional]
|
|
||||||
**_123number** | **Number** | | [optional]
|
|
||||||
|
|
||||||
|
|
@ -1,8 +0,0 @@
|
|||||||
# OpenApiPetstore.NumberOnly
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------ | ------------- | ------------- | -------------
|
|
||||||
**justNumber** | **Number** | | [optional]
|
|
||||||
|
|
||||||
|
|
@ -1,26 +0,0 @@
|
|||||||
# 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"`)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,10 +0,0 @@
|
|||||||
# OpenApiPetstore.OuterComposite
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------ | ------------- | ------------- | -------------
|
|
||||||
**myNumber** | **Number** | | [optional]
|
|
||||||
**myString** | **String** | | [optional]
|
|
||||||
**myBoolean** | **Boolean** | | [optional]
|
|
||||||
|
|
||||||
|
|
@ -1,12 +0,0 @@
|
|||||||
# OpenApiPetstore.OuterEnum
|
|
||||||
|
|
||||||
## Enum
|
|
||||||
|
|
||||||
|
|
||||||
* `placed` (value: `"placed"`)
|
|
||||||
|
|
||||||
* `approved` (value: `"approved"`)
|
|
||||||
|
|
||||||
* `delivered` (value: `"delivered"`)
|
|
||||||
|
|
||||||
|
|
@ -1,26 +0,0 @@
|
|||||||
# 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"`)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,400 +0,0 @@
|
|||||||
# 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
|
|
||||||
|
|
||||||
|
|
||||||
<a name="addPet"></a>
|
|
||||||
# **addPet**
|
|
||||||
> addPet(pet)
|
|
||||||
|
|
||||||
Add a new pet to the store
|
|
||||||
|
|
||||||
### Example
|
|
||||||
```javascript
|
|
||||||
var OpenApiPetstore = require('open_api_petstore');
|
|
||||||
var defaultClient = OpenApiPetstore.ApiClient.instance;
|
|
||||||
// Configure OAuth2 access token for authorization: petstore_auth
|
|
||||||
var petstore_auth = defaultClient.authentications['petstore_auth'];
|
|
||||||
petstore_auth.accessToken = 'YOUR ACCESS TOKEN';
|
|
||||||
|
|
||||||
var apiInstance = new OpenApiPetstore.PetApi();
|
|
||||||
var pet = new OpenApiPetstore.Pet(); // Pet | Pet object that needs to be added to the store
|
|
||||||
var callback = function(error, data, response) {
|
|
||||||
if (error) {
|
|
||||||
console.error(error);
|
|
||||||
} else {
|
|
||||||
console.log('API called successfully.');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
apiInstance.addPet(pet, callback);
|
|
||||||
```
|
|
||||||
|
|
||||||
### 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
|
|
||||||
var OpenApiPetstore = require('open_api_petstore');
|
|
||||||
var defaultClient = OpenApiPetstore.ApiClient.instance;
|
|
||||||
// Configure OAuth2 access token for authorization: petstore_auth
|
|
||||||
var petstore_auth = defaultClient.authentications['petstore_auth'];
|
|
||||||
petstore_auth.accessToken = 'YOUR ACCESS TOKEN';
|
|
||||||
|
|
||||||
var apiInstance = new OpenApiPetstore.PetApi();
|
|
||||||
var petId = 789; // Number | Pet id to delete
|
|
||||||
var opts = {
|
|
||||||
'apiKey': "apiKey_example" // String |
|
|
||||||
};
|
|
||||||
var callback = function(error, data, response) {
|
|
||||||
if (error) {
|
|
||||||
console.error(error);
|
|
||||||
} else {
|
|
||||||
console.log('API called successfully.');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
apiInstance.deletePet(petId, opts, callback);
|
|
||||||
```
|
|
||||||
|
|
||||||
### 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
|
|
||||||
var OpenApiPetstore = require('open_api_petstore');
|
|
||||||
var defaultClient = OpenApiPetstore.ApiClient.instance;
|
|
||||||
// Configure OAuth2 access token for authorization: petstore_auth
|
|
||||||
var petstore_auth = defaultClient.authentications['petstore_auth'];
|
|
||||||
petstore_auth.accessToken = 'YOUR ACCESS TOKEN';
|
|
||||||
|
|
||||||
var apiInstance = new OpenApiPetstore.PetApi();
|
|
||||||
var status = ["'available'"]; // [String] | Status values that need to be considered for filter
|
|
||||||
var callback = function(error, data, response) {
|
|
||||||
if (error) {
|
|
||||||
console.error(error);
|
|
||||||
} else {
|
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
apiInstance.findPetsByStatus(status, callback);
|
|
||||||
```
|
|
||||||
|
|
||||||
### 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
|
|
||||||
var OpenApiPetstore = require('open_api_petstore');
|
|
||||||
var defaultClient = OpenApiPetstore.ApiClient.instance;
|
|
||||||
// Configure OAuth2 access token for authorization: petstore_auth
|
|
||||||
var petstore_auth = defaultClient.authentications['petstore_auth'];
|
|
||||||
petstore_auth.accessToken = 'YOUR ACCESS TOKEN';
|
|
||||||
|
|
||||||
var apiInstance = new OpenApiPetstore.PetApi();
|
|
||||||
var tags = ["inner_example"]; // [String] | Tags to filter by
|
|
||||||
var callback = function(error, data, response) {
|
|
||||||
if (error) {
|
|
||||||
console.error(error);
|
|
||||||
} else {
|
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
apiInstance.findPetsByTags(tags, callback);
|
|
||||||
```
|
|
||||||
|
|
||||||
### 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
|
|
||||||
var OpenApiPetstore = require('open_api_petstore');
|
|
||||||
var defaultClient = OpenApiPetstore.ApiClient.instance;
|
|
||||||
// Configure API key authorization: api_key
|
|
||||||
var 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';
|
|
||||||
|
|
||||||
var apiInstance = new OpenApiPetstore.PetApi();
|
|
||||||
var petId = 789; // Number | ID of pet to return
|
|
||||||
var callback = function(error, data, response) {
|
|
||||||
if (error) {
|
|
||||||
console.error(error);
|
|
||||||
} else {
|
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
apiInstance.getPetById(petId, callback);
|
|
||||||
```
|
|
||||||
|
|
||||||
### 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
|
|
||||||
var OpenApiPetstore = require('open_api_petstore');
|
|
||||||
var defaultClient = OpenApiPetstore.ApiClient.instance;
|
|
||||||
// Configure OAuth2 access token for authorization: petstore_auth
|
|
||||||
var petstore_auth = defaultClient.authentications['petstore_auth'];
|
|
||||||
petstore_auth.accessToken = 'YOUR ACCESS TOKEN';
|
|
||||||
|
|
||||||
var apiInstance = new OpenApiPetstore.PetApi();
|
|
||||||
var pet = new OpenApiPetstore.Pet(); // Pet | Pet object that needs to be added to the store
|
|
||||||
var callback = function(error, data, response) {
|
|
||||||
if (error) {
|
|
||||||
console.error(error);
|
|
||||||
} else {
|
|
||||||
console.log('API called successfully.');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
apiInstance.updatePet(pet, callback);
|
|
||||||
```
|
|
||||||
|
|
||||||
### 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
|
|
||||||
var OpenApiPetstore = require('open_api_petstore');
|
|
||||||
var defaultClient = OpenApiPetstore.ApiClient.instance;
|
|
||||||
// Configure OAuth2 access token for authorization: petstore_auth
|
|
||||||
var petstore_auth = defaultClient.authentications['petstore_auth'];
|
|
||||||
petstore_auth.accessToken = 'YOUR ACCESS TOKEN';
|
|
||||||
|
|
||||||
var apiInstance = new OpenApiPetstore.PetApi();
|
|
||||||
var petId = 789; // Number | ID of pet that needs to be updated
|
|
||||||
var opts = {
|
|
||||||
'name': "name_example", // String | Updated name of the pet
|
|
||||||
'status': "status_example" // String | Updated status of the pet
|
|
||||||
};
|
|
||||||
var callback = function(error, data, response) {
|
|
||||||
if (error) {
|
|
||||||
console.error(error);
|
|
||||||
} else {
|
|
||||||
console.log('API called successfully.');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
apiInstance.updatePetWithForm(petId, opts, callback);
|
|
||||||
```
|
|
||||||
|
|
||||||
### 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
|
|
||||||
var OpenApiPetstore = require('open_api_petstore');
|
|
||||||
var defaultClient = OpenApiPetstore.ApiClient.instance;
|
|
||||||
// Configure OAuth2 access token for authorization: petstore_auth
|
|
||||||
var petstore_auth = defaultClient.authentications['petstore_auth'];
|
|
||||||
petstore_auth.accessToken = 'YOUR ACCESS TOKEN';
|
|
||||||
|
|
||||||
var apiInstance = new OpenApiPetstore.PetApi();
|
|
||||||
var petId = 789; // Number | ID of pet to update
|
|
||||||
var opts = {
|
|
||||||
'additionalMetadata': "additionalMetadata_example", // String | Additional data to pass to server
|
|
||||||
'file': "/path/to/file" // File | file to upload
|
|
||||||
};
|
|
||||||
var callback = function(error, data, response) {
|
|
||||||
if (error) {
|
|
||||||
console.error(error);
|
|
||||||
} else {
|
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
apiInstance.uploadFile(petId, opts, callback);
|
|
||||||
```
|
|
||||||
|
|
||||||
### 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
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
|||||||
# OpenApiPetstore.ReadOnlyFirst
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------ | ------------- | ------------- | -------------
|
|
||||||
**bar** | **String** | | [optional]
|
|
||||||
**baz** | **String** | | [optional]
|
|
||||||
|
|
||||||
|
|
@ -1,8 +0,0 @@
|
|||||||
# OpenApiPetstore.SpecialModelName
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------ | ------------- | ------------- | -------------
|
|
||||||
**specialPropertyName** | **Number** | | [optional]
|
|
||||||
|
|
||||||
|
|
@ -1,184 +0,0 @@
|
|||||||
# 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
|
|
||||||
var OpenApiPetstore = require('open_api_petstore');
|
|
||||||
|
|
||||||
var apiInstance = new OpenApiPetstore.StoreApi();
|
|
||||||
var orderId = "orderId_example"; // String | ID of the order that needs to be deleted
|
|
||||||
var callback = function(error, data, response) {
|
|
||||||
if (error) {
|
|
||||||
console.error(error);
|
|
||||||
} else {
|
|
||||||
console.log('API called successfully.');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
apiInstance.deleteOrder(orderId, callback);
|
|
||||||
```
|
|
||||||
|
|
||||||
### 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
|
|
||||||
var OpenApiPetstore = require('open_api_petstore');
|
|
||||||
var defaultClient = OpenApiPetstore.ApiClient.instance;
|
|
||||||
// Configure API key authorization: api_key
|
|
||||||
var 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';
|
|
||||||
|
|
||||||
var apiInstance = new OpenApiPetstore.StoreApi();
|
|
||||||
var callback = function(error, data, response) {
|
|
||||||
if (error) {
|
|
||||||
console.error(error);
|
|
||||||
} else {
|
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
apiInstance.getInventory(callback);
|
|
||||||
```
|
|
||||||
|
|
||||||
### 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
|
|
||||||
var OpenApiPetstore = require('open_api_petstore');
|
|
||||||
|
|
||||||
var apiInstance = new OpenApiPetstore.StoreApi();
|
|
||||||
var orderId = 789; // Number | ID of pet that needs to be fetched
|
|
||||||
var callback = function(error, data, response) {
|
|
||||||
if (error) {
|
|
||||||
console.error(error);
|
|
||||||
} else {
|
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
apiInstance.getOrderById(orderId, callback);
|
|
||||||
```
|
|
||||||
|
|
||||||
### 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
|
|
||||||
var OpenApiPetstore = require('open_api_petstore');
|
|
||||||
|
|
||||||
var apiInstance = new OpenApiPetstore.StoreApi();
|
|
||||||
var order = new OpenApiPetstore.Order(); // Order | order placed for purchasing the pet
|
|
||||||
var callback = function(error, data, response) {
|
|
||||||
if (error) {
|
|
||||||
console.error(error);
|
|
||||||
} else {
|
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
apiInstance.placeOrder(order, callback);
|
|
||||||
```
|
|
||||||
|
|
||||||
### 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**: Not defined
|
|
||||||
- **Accept**: application/xml, application/json
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
|||||||
# OpenApiPetstore.Tag
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------ | ------------- | ------------- | -------------
|
|
||||||
**id** | **Number** | | [optional]
|
|
||||||
**name** | **String** | | [optional]
|
|
||||||
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
|||||||
# OpenApiPetstore.User
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------ | ------------- | ------------- | -------------
|
|
||||||
**id** | **Number** | | [optional]
|
|
||||||
**username** | **String** | | [optional]
|
|
||||||
**firstName** | **String** | | [optional]
|
|
||||||
**lastName** | **String** | | [optional]
|
|
||||||
**email** | **String** | | [optional]
|
|
||||||
**password** | **String** | | [optional]
|
|
||||||
**phone** | **String** | | [optional]
|
|
||||||
**userStatus** | **Number** | User Status | [optional]
|
|
||||||
|
|
||||||
|
|
@ -1,350 +0,0 @@
|
|||||||
# OpenApiPetstore.UserApi
|
|
||||||
|
|
||||||
All URIs are relative to *http://petstore.swagger.io:80/v2*
|
|
||||||
|
|
||||||
Method | HTTP request | Description
|
|
||||||
------------- | ------------- | -------------
|
|
||||||
[**createUser**](UserApi.md#createUser) | **POST** /user | Create user
|
|
||||||
[**createUsersWithArrayInput**](UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array
|
|
||||||
[**createUsersWithListInput**](UserApi.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array
|
|
||||||
[**deleteUser**](UserApi.md#deleteUser) | **DELETE** /user/{username} | Delete user
|
|
||||||
[**getUserByName**](UserApi.md#getUserByName) | **GET** /user/{username} | Get user by user name
|
|
||||||
[**loginUser**](UserApi.md#loginUser) | **GET** /user/login | Logs user into the system
|
|
||||||
[**logoutUser**](UserApi.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session
|
|
||||||
[**updateUser**](UserApi.md#updateUser) | **PUT** /user/{username} | Updated user
|
|
||||||
|
|
||||||
|
|
||||||
<a name="createUser"></a>
|
|
||||||
# **createUser**
|
|
||||||
> createUser(user)
|
|
||||||
|
|
||||||
Create user
|
|
||||||
|
|
||||||
This can only be done by the logged in user.
|
|
||||||
|
|
||||||
### Example
|
|
||||||
```javascript
|
|
||||||
var OpenApiPetstore = require('open_api_petstore');
|
|
||||||
|
|
||||||
var apiInstance = new OpenApiPetstore.UserApi();
|
|
||||||
var user = new OpenApiPetstore.User(); // User | Created user object
|
|
||||||
var callback = function(error, data, response) {
|
|
||||||
if (error) {
|
|
||||||
console.error(error);
|
|
||||||
} else {
|
|
||||||
console.log('API called successfully.');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
apiInstance.createUser(user, callback);
|
|
||||||
```
|
|
||||||
|
|
||||||
### Parameters
|
|
||||||
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------- | ------------- | ------------- | -------------
|
|
||||||
**user** | [**User**](User.md)| Created user object |
|
|
||||||
|
|
||||||
### Return type
|
|
||||||
|
|
||||||
null (empty response body)
|
|
||||||
|
|
||||||
### Authorization
|
|
||||||
|
|
||||||
No authorization required
|
|
||||||
|
|
||||||
### HTTP request headers
|
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
|
||||||
- **Accept**: Not defined
|
|
||||||
|
|
||||||
<a name="createUsersWithArrayInput"></a>
|
|
||||||
# **createUsersWithArrayInput**
|
|
||||||
> createUsersWithArrayInput(user)
|
|
||||||
|
|
||||||
Creates list of users with given input array
|
|
||||||
|
|
||||||
### Example
|
|
||||||
```javascript
|
|
||||||
var OpenApiPetstore = require('open_api_petstore');
|
|
||||||
|
|
||||||
var apiInstance = new OpenApiPetstore.UserApi();
|
|
||||||
var user = [new OpenApiPetstore.User()]; // [User] | List of user object
|
|
||||||
var callback = function(error, data, response) {
|
|
||||||
if (error) {
|
|
||||||
console.error(error);
|
|
||||||
} else {
|
|
||||||
console.log('API called successfully.');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
apiInstance.createUsersWithArrayInput(user, callback);
|
|
||||||
```
|
|
||||||
|
|
||||||
### Parameters
|
|
||||||
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------- | ------------- | ------------- | -------------
|
|
||||||
**user** | [**[User]**](Array.md)| List of user object |
|
|
||||||
|
|
||||||
### Return type
|
|
||||||
|
|
||||||
null (empty response body)
|
|
||||||
|
|
||||||
### Authorization
|
|
||||||
|
|
||||||
No authorization required
|
|
||||||
|
|
||||||
### HTTP request headers
|
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
|
||||||
- **Accept**: Not defined
|
|
||||||
|
|
||||||
<a name="createUsersWithListInput"></a>
|
|
||||||
# **createUsersWithListInput**
|
|
||||||
> createUsersWithListInput(user)
|
|
||||||
|
|
||||||
Creates list of users with given input array
|
|
||||||
|
|
||||||
### Example
|
|
||||||
```javascript
|
|
||||||
var OpenApiPetstore = require('open_api_petstore');
|
|
||||||
|
|
||||||
var apiInstance = new OpenApiPetstore.UserApi();
|
|
||||||
var user = [new OpenApiPetstore.User()]; // [User] | List of user object
|
|
||||||
var callback = function(error, data, response) {
|
|
||||||
if (error) {
|
|
||||||
console.error(error);
|
|
||||||
} else {
|
|
||||||
console.log('API called successfully.');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
apiInstance.createUsersWithListInput(user, callback);
|
|
||||||
```
|
|
||||||
|
|
||||||
### Parameters
|
|
||||||
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------- | ------------- | ------------- | -------------
|
|
||||||
**user** | [**[User]**](Array.md)| List of user object |
|
|
||||||
|
|
||||||
### Return type
|
|
||||||
|
|
||||||
null (empty response body)
|
|
||||||
|
|
||||||
### Authorization
|
|
||||||
|
|
||||||
No authorization required
|
|
||||||
|
|
||||||
### HTTP request headers
|
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
|
||||||
- **Accept**: Not defined
|
|
||||||
|
|
||||||
<a name="deleteUser"></a>
|
|
||||||
# **deleteUser**
|
|
||||||
> deleteUser(username)
|
|
||||||
|
|
||||||
Delete user
|
|
||||||
|
|
||||||
This can only be done by the logged in user.
|
|
||||||
|
|
||||||
### Example
|
|
||||||
```javascript
|
|
||||||
var OpenApiPetstore = require('open_api_petstore');
|
|
||||||
|
|
||||||
var apiInstance = new OpenApiPetstore.UserApi();
|
|
||||||
var username = "username_example"; // String | The name that needs to be deleted
|
|
||||||
var callback = function(error, data, response) {
|
|
||||||
if (error) {
|
|
||||||
console.error(error);
|
|
||||||
} else {
|
|
||||||
console.log('API called successfully.');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
apiInstance.deleteUser(username, callback);
|
|
||||||
```
|
|
||||||
|
|
||||||
### Parameters
|
|
||||||
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------- | ------------- | ------------- | -------------
|
|
||||||
**username** | **String**| The name 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="getUserByName"></a>
|
|
||||||
# **getUserByName**
|
|
||||||
> User getUserByName(username)
|
|
||||||
|
|
||||||
Get user by user name
|
|
||||||
|
|
||||||
### Example
|
|
||||||
```javascript
|
|
||||||
var OpenApiPetstore = require('open_api_petstore');
|
|
||||||
|
|
||||||
var apiInstance = new OpenApiPetstore.UserApi();
|
|
||||||
var username = "username_example"; // String | The name that needs to be fetched. Use user1 for testing.
|
|
||||||
var callback = function(error, data, response) {
|
|
||||||
if (error) {
|
|
||||||
console.error(error);
|
|
||||||
} else {
|
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
apiInstance.getUserByName(username, callback);
|
|
||||||
```
|
|
||||||
|
|
||||||
### Parameters
|
|
||||||
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------- | ------------- | ------------- | -------------
|
|
||||||
**username** | **String**| The name that needs to be fetched. Use user1 for testing. |
|
|
||||||
|
|
||||||
### Return type
|
|
||||||
|
|
||||||
[**User**](User.md)
|
|
||||||
|
|
||||||
### Authorization
|
|
||||||
|
|
||||||
No authorization required
|
|
||||||
|
|
||||||
### HTTP request headers
|
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
|
||||||
- **Accept**: application/xml, application/json
|
|
||||||
|
|
||||||
<a name="loginUser"></a>
|
|
||||||
# **loginUser**
|
|
||||||
> String loginUser(username, password)
|
|
||||||
|
|
||||||
Logs user into the system
|
|
||||||
|
|
||||||
### Example
|
|
||||||
```javascript
|
|
||||||
var OpenApiPetstore = require('open_api_petstore');
|
|
||||||
|
|
||||||
var apiInstance = new OpenApiPetstore.UserApi();
|
|
||||||
var username = "username_example"; // String | The user name for login
|
|
||||||
var password = "password_example"; // String | The password for login in clear text
|
|
||||||
var callback = function(error, data, response) {
|
|
||||||
if (error) {
|
|
||||||
console.error(error);
|
|
||||||
} else {
|
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
apiInstance.loginUser(username, password, callback);
|
|
||||||
```
|
|
||||||
|
|
||||||
### Parameters
|
|
||||||
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------- | ------------- | ------------- | -------------
|
|
||||||
**username** | **String**| The user name for login |
|
|
||||||
**password** | **String**| The password for login in clear text |
|
|
||||||
|
|
||||||
### Return type
|
|
||||||
|
|
||||||
**String**
|
|
||||||
|
|
||||||
### Authorization
|
|
||||||
|
|
||||||
No authorization required
|
|
||||||
|
|
||||||
### HTTP request headers
|
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
|
||||||
- **Accept**: application/xml, application/json
|
|
||||||
|
|
||||||
<a name="logoutUser"></a>
|
|
||||||
# **logoutUser**
|
|
||||||
> logoutUser()
|
|
||||||
|
|
||||||
Logs out current logged in user session
|
|
||||||
|
|
||||||
### Example
|
|
||||||
```javascript
|
|
||||||
var OpenApiPetstore = require('open_api_petstore');
|
|
||||||
|
|
||||||
var apiInstance = new OpenApiPetstore.UserApi();
|
|
||||||
var callback = function(error, data, response) {
|
|
||||||
if (error) {
|
|
||||||
console.error(error);
|
|
||||||
} else {
|
|
||||||
console.log('API called successfully.');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
apiInstance.logoutUser(callback);
|
|
||||||
```
|
|
||||||
|
|
||||||
### Parameters
|
|
||||||
This endpoint does not need any parameter.
|
|
||||||
|
|
||||||
### Return type
|
|
||||||
|
|
||||||
null (empty response body)
|
|
||||||
|
|
||||||
### Authorization
|
|
||||||
|
|
||||||
No authorization required
|
|
||||||
|
|
||||||
### HTTP request headers
|
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
|
||||||
- **Accept**: Not defined
|
|
||||||
|
|
||||||
<a name="updateUser"></a>
|
|
||||||
# **updateUser**
|
|
||||||
> updateUser(username, user)
|
|
||||||
|
|
||||||
Updated user
|
|
||||||
|
|
||||||
This can only be done by the logged in user.
|
|
||||||
|
|
||||||
### Example
|
|
||||||
```javascript
|
|
||||||
var OpenApiPetstore = require('open_api_petstore');
|
|
||||||
|
|
||||||
var apiInstance = new OpenApiPetstore.UserApi();
|
|
||||||
var username = "username_example"; // String | name that need to be deleted
|
|
||||||
var user = new OpenApiPetstore.User(); // User | Updated user object
|
|
||||||
var callback = function(error, data, response) {
|
|
||||||
if (error) {
|
|
||||||
console.error(error);
|
|
||||||
} else {
|
|
||||||
console.log('API called successfully.');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
apiInstance.updateUser(username, user, callback);
|
|
||||||
```
|
|
||||||
|
|
||||||
### Parameters
|
|
||||||
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------- | ------------- | ------------- | -------------
|
|
||||||
**username** | **String**| name that need to be deleted |
|
|
||||||
**user** | [**User**](User.md)| Updated user object |
|
|
||||||
|
|
||||||
### Return type
|
|
||||||
|
|
||||||
null (empty response body)
|
|
||||||
|
|
||||||
### Authorization
|
|
||||||
|
|
||||||
No authorization required
|
|
||||||
|
|
||||||
### HTTP request headers
|
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
|
||||||
- **Accept**: Not defined
|
|
||||||
|
|
@ -79,7 +79,7 @@
|
|||||||
obj['enum_number'] = ApiClient.convertToType(data['enum_number'], 'Number');
|
obj['enum_number'] = ApiClient.convertToType(data['enum_number'], 'Number');
|
||||||
}
|
}
|
||||||
if (data.hasOwnProperty('outerEnum')) {
|
if (data.hasOwnProperty('outerEnum')) {
|
||||||
obj['outerEnum'] = OuterEnum.constructFromObject(data['OuterEnum']);
|
obj['outerEnum'] = OuterEnum.constructFromObject(data['outerEnum']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return obj;
|
return obj;
|
||||||
|
@ -64,13 +64,13 @@
|
|||||||
obj = obj || new exports();
|
obj = obj || new exports();
|
||||||
|
|
||||||
if (data.hasOwnProperty('my_number')) {
|
if (data.hasOwnProperty('my_number')) {
|
||||||
obj['my_number'] = 'Number'.constructFromObject(data['Number']);
|
obj['my_number'] = 'Number'.constructFromObject(data['my_number']);
|
||||||
}
|
}
|
||||||
if (data.hasOwnProperty('my_string')) {
|
if (data.hasOwnProperty('my_string')) {
|
||||||
obj['my_string'] = 'String'.constructFromObject(data['String']);
|
obj['my_string'] = 'String'.constructFromObject(data['my_string']);
|
||||||
}
|
}
|
||||||
if (data.hasOwnProperty('my_boolean')) {
|
if (data.hasOwnProperty('my_boolean')) {
|
||||||
obj['my_boolean'] = 'Boolean'.constructFromObject(data['Boolean']);
|
obj['my_boolean'] = 'Boolean'.constructFromObject(data['my_boolean']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return obj;
|
return obj;
|
||||||
|
@ -72,7 +72,7 @@
|
|||||||
obj['id'] = ApiClient.convertToType(data['id'], 'Number');
|
obj['id'] = ApiClient.convertToType(data['id'], 'Number');
|
||||||
}
|
}
|
||||||
if (data.hasOwnProperty('category')) {
|
if (data.hasOwnProperty('category')) {
|
||||||
obj['category'] = Category.constructFromObject(data['Category']);
|
obj['category'] = Category.constructFromObject(data['category']);
|
||||||
}
|
}
|
||||||
if (data.hasOwnProperty('name')) {
|
if (data.hasOwnProperty('name')) {
|
||||||
obj['name'] = ApiClient.convertToType(data['name'], 'String');
|
obj['name'] = ApiClient.convertToType(data['name'], 'String');
|
||||||
|
@ -3,12 +3,11 @@
|
|||||||
* 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 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
|
* OpenAPI spec version: 1.0.0
|
||||||
* Contact: apiteam@swagger.io
|
|
||||||
*
|
*
|
||||||
* NOTE: This class is auto generated by the swagger code generator program.
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
* https://github.com/swagger-api/swagger-codegen.git
|
* https://openapi-generator.tech
|
||||||
*
|
*
|
||||||
* OpenAPI Codegen version: 2.3.0-SNAPSHOT
|
* OpenAPI Generator version: 3.0.0-SNAPSHOT
|
||||||
*
|
*
|
||||||
* Do not edit the class manually.
|
* Do not edit the class manually.
|
||||||
*
|
*
|
||||||
@ -23,15 +22,15 @@
|
|||||||
factory(require('expect.js'), require('../../src/index'));
|
factory(require('expect.js'), require('../../src/index'));
|
||||||
} else {
|
} else {
|
||||||
// Browser globals (root is window)
|
// Browser globals (root is window)
|
||||||
factory(root.expect, root.OpenAPIPetstore);
|
factory(root.expect, root.OpenApiPetstore);
|
||||||
}
|
}
|
||||||
}(this, function(expect, OpenAPIPetstore) {
|
}(this, function(expect, OpenApiPetstore) {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var instance;
|
var instance;
|
||||||
|
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
instance = new OpenAPIPetstore.AnotherFakeApi();
|
instance = new OpenApiPetstore.AnotherFakeApi();
|
||||||
});
|
});
|
||||||
|
|
||||||
var getProperty = function(object, getter, property) {
|
var getProperty = function(object, getter, property) {
|
||||||
|
@ -3,12 +3,11 @@
|
|||||||
* 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 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
|
* OpenAPI spec version: 1.0.0
|
||||||
* Contact: apiteam@swagger.io
|
|
||||||
*
|
*
|
||||||
* NOTE: This class is auto generated by the swagger code generator program.
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
* https://github.com/swagger-api/swagger-codegen.git
|
* https://openapi-generator.tech
|
||||||
*
|
*
|
||||||
* OpenAPI Codegen version: 2.3.0-SNAPSHOT
|
* OpenAPI Generator version: 3.0.0-SNAPSHOT
|
||||||
*
|
*
|
||||||
* Do not edit the class manually.
|
* Do not edit the class manually.
|
||||||
*
|
*
|
||||||
@ -23,15 +22,15 @@
|
|||||||
factory(require('expect.js'), require('../../src/index'));
|
factory(require('expect.js'), require('../../src/index'));
|
||||||
} else {
|
} else {
|
||||||
// Browser globals (root is window)
|
// Browser globals (root is window)
|
||||||
factory(root.expect, root.OpenAPIPetstore);
|
factory(root.expect, root.OpenApiPetstore);
|
||||||
}
|
}
|
||||||
}(this, function(expect, OpenAPIPetstore) {
|
}(this, function(expect, OpenApiPetstore) {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var instance;
|
var instance;
|
||||||
|
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
instance = new OpenAPIPetstore.FakeClassnameTags123Api();
|
instance = new OpenApiPetstore.FakeClassnameTags123Api();
|
||||||
});
|
});
|
||||||
|
|
||||||
var getProperty = function(object, getter, property) {
|
var getProperty = function(object, getter, property) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user