forked from loafle/openapi-generator-original
Gh-4044: Enabling ES6 in javascript client (#5593)
* gh-4044: Added useES6 as an option for javascript templates * gh-4044: Enabled ES6 in `javascript/api.mustache` * gh-4044: Enabled ES6 in `javascript/ApiClient.mustache` * gh-4044: Enabled ES6 in `javascript/enumClass.mustache` * gh-4044: Added useES6 cli option to `javascript` clients and updated the test cases * gh-4044: Enabled ES6 in `javascript/index.mustache` * gh-4044: Enabled ES6 in `javascript` model templates * `javascript/model.mustache` * `javascript/partial_model_generic.mustache` * `javascript/partial_model_enum_class.mustache` * `javascript/partial_model_inner_enum.mustache` * gh-4044: Separated `javascript-es6` templates to another folder * gh-4044: Updated `javascript-es6/index.mustache` * gh-4044: Enabled ES6 in `javascript-es6/api_doc.mustache` * gh-4044: Added required dependencies for ES6 * gh-4044: Updated Supportig files for ES6 and non ES6 * gh-4044: Added test scripts to verify `javascript` useEs6 option * gh-4044: Commented `javascript-es6` scripts due to the permission issues.
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
# SwaggerPetstore.AdditionalPropertiesClass
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**mapProperty** | **{String: String}** | | [optional]
|
||||
**mapOfMapProperty** | **{String: {String: String}}** | | [optional]
|
||||
|
||||
|
||||
9
samples/client/petstore/javascript-es6/docs/Animal.md
Normal file
9
samples/client/petstore/javascript-es6/docs/Animal.md
Normal file
@@ -0,0 +1,9 @@
|
||||
# SwaggerPetstore.Animal
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**className** | **String** | |
|
||||
**color** | **String** | | [optional] [default to 'red']
|
||||
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
# SwaggerPetstore.AnimalFarm
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
|
||||
|
||||
10
samples/client/petstore/javascript-es6/docs/ApiResponse.md
Normal file
10
samples/client/petstore/javascript-es6/docs/ApiResponse.md
Normal file
@@ -0,0 +1,10 @@
|
||||
# SwaggerPetstore.ApiResponse
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**code** | **Number** | | [optional]
|
||||
**type** | **String** | | [optional]
|
||||
**message** | **String** | | [optional]
|
||||
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
# SwaggerPetstore.ArrayOfArrayOfNumberOnly
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**arrayArrayNumber** | **[[Number]]** | | [optional]
|
||||
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
# SwaggerPetstore.ArrayOfNumberOnly
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**arrayNumber** | **[Number]** | | [optional]
|
||||
|
||||
|
||||
10
samples/client/petstore/javascript-es6/docs/ArrayTest.md
Normal file
10
samples/client/petstore/javascript-es6/docs/ArrayTest.md
Normal file
@@ -0,0 +1,10 @@
|
||||
# SwaggerPetstore.ArrayTest
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**arrayOfString** | **[String]** | | [optional]
|
||||
**arrayArrayOfInteger** | **[[Number]]** | | [optional]
|
||||
**arrayArrayOfModel** | **[[ReadOnlyFirst]]** | | [optional]
|
||||
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
# SwaggerPetstore.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]
|
||||
|
||||
|
||||
8
samples/client/petstore/javascript-es6/docs/Cat.md
Normal file
8
samples/client/petstore/javascript-es6/docs/Cat.md
Normal file
@@ -0,0 +1,8 @@
|
||||
# SwaggerPetstore.Cat
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**declawed** | **Boolean** | | [optional]
|
||||
|
||||
|
||||
9
samples/client/petstore/javascript-es6/docs/Category.md
Normal file
9
samples/client/petstore/javascript-es6/docs/Category.md
Normal file
@@ -0,0 +1,9 @@
|
||||
# SwaggerPetstore.Category
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**id** | **Number** | | [optional]
|
||||
**name** | **String** | | [optional]
|
||||
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
# SwaggerPetstore.ClassModel
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**_class** | **String** | | [optional]
|
||||
|
||||
|
||||
8
samples/client/petstore/javascript-es6/docs/Client.md
Normal file
8
samples/client/petstore/javascript-es6/docs/Client.md
Normal file
@@ -0,0 +1,8 @@
|
||||
# SwaggerPetstore.Client
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**client** | **String** | | [optional]
|
||||
|
||||
|
||||
8
samples/client/petstore/javascript-es6/docs/Dog.md
Normal file
8
samples/client/petstore/javascript-es6/docs/Dog.md
Normal file
@@ -0,0 +1,8 @@
|
||||
# SwaggerPetstore.Dog
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**breed** | **String** | | [optional]
|
||||
|
||||
|
||||
31
samples/client/petstore/javascript-es6/docs/EnumArrays.md
Normal file
31
samples/client/petstore/javascript-es6/docs/EnumArrays.md
Normal file
@@ -0,0 +1,31 @@
|
||||
# SwaggerPetstore.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"`)
|
||||
|
||||
|
||||
|
||||
|
||||
12
samples/client/petstore/javascript-es6/docs/EnumClass.md
Normal file
12
samples/client/petstore/javascript-es6/docs/EnumClass.md
Normal file
@@ -0,0 +1,12 @@
|
||||
# SwaggerPetstore.EnumClass
|
||||
|
||||
## Enum
|
||||
|
||||
|
||||
* `_abc` (value: `"_abc"`)
|
||||
|
||||
* `-efg` (value: `"-efg"`)
|
||||
|
||||
* `(xyz)` (value: `"(xyz)"`)
|
||||
|
||||
|
||||
46
samples/client/petstore/javascript-es6/docs/EnumTest.md
Normal file
46
samples/client/petstore/javascript-es6/docs/EnumTest.md
Normal file
@@ -0,0 +1,46 @@
|
||||
# SwaggerPetstore.EnumTest
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**enumString** | **String** | | [optional]
|
||||
**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="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`)
|
||||
|
||||
|
||||
|
||||
|
||||
201
samples/client/petstore/javascript-es6/docs/FakeApi.md
Normal file
201
samples/client/petstore/javascript-es6/docs/FakeApi.md
Normal file
@@ -0,0 +1,201 @@
|
||||
# SwaggerPetstore.FakeApi
|
||||
|
||||
All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
[**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
|
||||
|
||||
|
||||
<a name="testClientModel"></a>
|
||||
# **testClientModel**
|
||||
> Client testClientModel(body)
|
||||
|
||||
To test \"client\" model
|
||||
|
||||
To test \"client\" model
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
var SwaggerPetstore = require('swagger_petstore');
|
||||
|
||||
var apiInstance = new SwaggerPetstore.FakeApi();
|
||||
|
||||
var body = new SwaggerPetstore.Client(); // Client | client model
|
||||
|
||||
|
||||
var callback = function(error, data, response) {
|
||||
if (error) {
|
||||
console.error(error);
|
||||
} else {
|
||||
console.log('API called successfully. Returned data: ' + data);
|
||||
}
|
||||
};
|
||||
apiInstance.testClientModel(body, callback);
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**Client**](Client.md)| client model |
|
||||
|
||||
### Return type
|
||||
|
||||
[**Client**](Client.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: application/json
|
||||
|
||||
<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 SwaggerPetstore = require('swagger_petstore');
|
||||
var defaultClient = SwaggerPetstore.ApiClient.default;
|
||||
|
||||
// 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 SwaggerPetstore.FakeApi();
|
||||
|
||||
var _number = 3.4; // Number | None
|
||||
|
||||
var _double = 1.2; // Number | None
|
||||
|
||||
var patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None
|
||||
|
||||
var _byte = B; // 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': B, // Blob | 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** | **Blob**| 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/xml; charset=utf-8, application/json; charset=utf-8
|
||||
- **Accept**: application/xml; charset=utf-8, application/json; charset=utf-8
|
||||
|
||||
<a name="testEnumParameters"></a>
|
||||
# **testEnumParameters**
|
||||
> testEnumParameters(opts)
|
||||
|
||||
To test enum parameters
|
||||
|
||||
To test enum parameters
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
var SwaggerPetstore = require('swagger_petstore');
|
||||
|
||||
var apiInstance = new SwaggerPetstore.FakeApi();
|
||||
|
||||
var opts = {
|
||||
'enumFormStringArray': ["enumFormStringArray_example"], // [String] | Form parameter enum test (string array)
|
||||
'enumFormString': "-efg", // String | Form parameter enum test (string)
|
||||
'enumHeaderStringArray': ["enumHeaderStringArray_example"], // [String] | Header parameter enum test (string array)
|
||||
'enumHeaderString': "-efg", // String | Header parameter enum test (string)
|
||||
'enumQueryStringArray': ["enumQueryStringArray_example"], // [String] | Query parameter enum test (string array)
|
||||
'enumQueryString': "-efg", // String | Query parameter enum test (string)
|
||||
'enumQueryInteger': 56, // Number | Query parameter enum test (double)
|
||||
'enumQueryDouble': 1.2 // Number | Query parameter enum test (double)
|
||||
};
|
||||
|
||||
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
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**enumFormStringArray** | [**[String]**](String.md)| Form parameter enum test (string array) | [optional]
|
||||
**enumFormString** | **String**| Form parameter enum test (string) | [optional] [default to -efg]
|
||||
**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]
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: */*
|
||||
- **Accept**: */*
|
||||
|
||||
20
samples/client/petstore/javascript-es6/docs/FormatTest.md
Normal file
20
samples/client/petstore/javascript-es6/docs/FormatTest.md
Normal file
@@ -0,0 +1,20 @@
|
||||
# SwaggerPetstore.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** | **Blob** | | [optional]
|
||||
**_date** | **Date** | |
|
||||
**dateTime** | **Date** | | [optional]
|
||||
**uuid** | **String** | | [optional]
|
||||
**password** | **String** | |
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
# SwaggerPetstore.HasOnlyReadOnly
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**bar** | **String** | | [optional]
|
||||
**foo** | **String** | | [optional]
|
||||
|
||||
|
||||
8
samples/client/petstore/javascript-es6/docs/List.md
Normal file
8
samples/client/petstore/javascript-es6/docs/List.md
Normal file
@@ -0,0 +1,8 @@
|
||||
# SwaggerPetstore.List
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**_123List** | **String** | | [optional]
|
||||
|
||||
|
||||
20
samples/client/petstore/javascript-es6/docs/MapTest.md
Normal file
20
samples/client/petstore/javascript-es6/docs/MapTest.md
Normal file
@@ -0,0 +1,20 @@
|
||||
# SwaggerPetstore.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"`)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
# SwaggerPetstore.MixedPropertiesAndAdditionalPropertiesClass
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**uuid** | **String** | | [optional]
|
||||
**dateTime** | **Date** | | [optional]
|
||||
**map** | [**{String: Animal}**](Animal.md) | | [optional]
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
# SwaggerPetstore.Model200Response
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**name** | **Number** | | [optional]
|
||||
**_class** | **String** | | [optional]
|
||||
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
# SwaggerPetstore.ModelReturn
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**_return** | **Number** | | [optional]
|
||||
|
||||
|
||||
11
samples/client/petstore/javascript-es6/docs/Name.md
Normal file
11
samples/client/petstore/javascript-es6/docs/Name.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# SwaggerPetstore.Name
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**name** | **Number** | |
|
||||
**snakeCase** | **Number** | | [optional]
|
||||
**property** | **String** | | [optional]
|
||||
**_123Number** | **Number** | | [optional]
|
||||
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
# SwaggerPetstore.NumberOnly
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**justNumber** | **Number** | | [optional]
|
||||
|
||||
|
||||
26
samples/client/petstore/javascript-es6/docs/Order.md
Normal file
26
samples/client/petstore/javascript-es6/docs/Order.md
Normal file
@@ -0,0 +1,26 @@
|
||||
# SwaggerPetstore.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"`)
|
||||
|
||||
|
||||
|
||||
|
||||
12
samples/client/petstore/javascript-es6/docs/OuterEnum.md
Normal file
12
samples/client/petstore/javascript-es6/docs/OuterEnum.md
Normal file
@@ -0,0 +1,12 @@
|
||||
# SwaggerPetstore.OuterEnum
|
||||
|
||||
## Enum
|
||||
|
||||
|
||||
* `placed` (value: `"placed"`)
|
||||
|
||||
* `approved` (value: `"approved"`)
|
||||
|
||||
* `delivered` (value: `"delivered"`)
|
||||
|
||||
|
||||
26
samples/client/petstore/javascript-es6/docs/Pet.md
Normal file
26
samples/client/petstore/javascript-es6/docs/Pet.md
Normal file
@@ -0,0 +1,26 @@
|
||||
# SwaggerPetstore.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"`)
|
||||
|
||||
|
||||
|
||||
|
||||
442
samples/client/petstore/javascript-es6/docs/PetApi.md
Normal file
442
samples/client/petstore/javascript-es6/docs/PetApi.md
Normal file
@@ -0,0 +1,442 @@
|
||||
# SwaggerPetstore.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(body)
|
||||
|
||||
Add a new pet to the store
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
var SwaggerPetstore = require('swagger_petstore');
|
||||
var defaultClient = SwaggerPetstore.ApiClient.default;
|
||||
|
||||
// Configure OAuth2 access token for authorization: petstore_auth
|
||||
var petstore_auth = defaultClient.authentications['petstore_auth'];
|
||||
petstore_auth.accessToken = 'YOUR ACCESS TOKEN';
|
||||
|
||||
var apiInstance = new SwaggerPetstore.PetApi();
|
||||
|
||||
var body = new SwaggerPetstore.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(body, callback);
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**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**: application/xml, application/json
|
||||
|
||||
<a name="deletePet"></a>
|
||||
# **deletePet**
|
||||
> deletePet(petId, opts)
|
||||
|
||||
Deletes a pet
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
var SwaggerPetstore = require('swagger_petstore');
|
||||
var defaultClient = SwaggerPetstore.ApiClient.default;
|
||||
|
||||
// Configure OAuth2 access token for authorization: petstore_auth
|
||||
var petstore_auth = defaultClient.authentications['petstore_auth'];
|
||||
petstore_auth.accessToken = 'YOUR ACCESS TOKEN';
|
||||
|
||||
var apiInstance = new SwaggerPetstore.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**: application/xml, application/json
|
||||
|
||||
<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 SwaggerPetstore = require('swagger_petstore');
|
||||
var defaultClient = SwaggerPetstore.ApiClient.default;
|
||||
|
||||
// Configure OAuth2 access token for authorization: petstore_auth
|
||||
var petstore_auth = defaultClient.authentications['petstore_auth'];
|
||||
petstore_auth.accessToken = 'YOUR ACCESS TOKEN';
|
||||
|
||||
var apiInstance = new SwaggerPetstore.PetApi();
|
||||
|
||||
var status = ["status_example"]; // [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 SwaggerPetstore = require('swagger_petstore');
|
||||
var defaultClient = SwaggerPetstore.ApiClient.default;
|
||||
|
||||
// Configure OAuth2 access token for authorization: petstore_auth
|
||||
var petstore_auth = defaultClient.authentications['petstore_auth'];
|
||||
petstore_auth.accessToken = 'YOUR ACCESS TOKEN';
|
||||
|
||||
var apiInstance = new SwaggerPetstore.PetApi();
|
||||
|
||||
var tags = ["tags_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 SwaggerPetstore = require('swagger_petstore');
|
||||
var defaultClient = SwaggerPetstore.ApiClient.default;
|
||||
|
||||
// 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 SwaggerPetstore.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(body)
|
||||
|
||||
Update an existing pet
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
var SwaggerPetstore = require('swagger_petstore');
|
||||
var defaultClient = SwaggerPetstore.ApiClient.default;
|
||||
|
||||
// Configure OAuth2 access token for authorization: petstore_auth
|
||||
var petstore_auth = defaultClient.authentications['petstore_auth'];
|
||||
petstore_auth.accessToken = 'YOUR ACCESS TOKEN';
|
||||
|
||||
var apiInstance = new SwaggerPetstore.PetApi();
|
||||
|
||||
var body = new SwaggerPetstore.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(body, callback);
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**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**: application/xml, application/json
|
||||
|
||||
<a name="updatePetWithForm"></a>
|
||||
# **updatePetWithForm**
|
||||
> updatePetWithForm(petId, opts)
|
||||
|
||||
Updates a pet in the store with form data
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
var SwaggerPetstore = require('swagger_petstore');
|
||||
var defaultClient = SwaggerPetstore.ApiClient.default;
|
||||
|
||||
// Configure OAuth2 access token for authorization: petstore_auth
|
||||
var petstore_auth = defaultClient.authentications['petstore_auth'];
|
||||
petstore_auth.accessToken = 'YOUR ACCESS TOKEN';
|
||||
|
||||
var apiInstance = new SwaggerPetstore.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**: application/xml, application/json
|
||||
|
||||
<a name="uploadFile"></a>
|
||||
# **uploadFile**
|
||||
> ApiResponse uploadFile(petId, opts)
|
||||
|
||||
uploads an image
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
var SwaggerPetstore = require('swagger_petstore');
|
||||
var defaultClient = SwaggerPetstore.ApiClient.default;
|
||||
|
||||
// Configure OAuth2 access token for authorization: petstore_auth
|
||||
var petstore_auth = defaultClient.authentications['petstore_auth'];
|
||||
petstore_auth.accessToken = 'YOUR ACCESS TOKEN';
|
||||
|
||||
var apiInstance = new SwaggerPetstore.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.txt" // 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
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
# SwaggerPetstore.ReadOnlyFirst
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**bar** | **String** | | [optional]
|
||||
**baz** | **String** | | [optional]
|
||||
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
# SwaggerPetstore.SpecialModelName
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**specialPropertyName** | **Number** | | [optional]
|
||||
|
||||
|
||||
197
samples/client/petstore/javascript-es6/docs/StoreApi.md
Normal file
197
samples/client/petstore/javascript-es6/docs/StoreApi.md
Normal file
@@ -0,0 +1,197 @@
|
||||
# SwaggerPetstore.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 SwaggerPetstore = require('swagger_petstore');
|
||||
|
||||
var apiInstance = new SwaggerPetstore.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**: application/xml, application/json
|
||||
|
||||
<a name="getInventory"></a>
|
||||
# **getInventory**
|
||||
> {'String': 'Number'} getInventory()
|
||||
|
||||
Returns pet inventories by status
|
||||
|
||||
Returns a map of status codes to quantities
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
var SwaggerPetstore = require('swagger_petstore');
|
||||
var defaultClient = SwaggerPetstore.ApiClient.default;
|
||||
|
||||
// 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 SwaggerPetstore.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 SwaggerPetstore = require('swagger_petstore');
|
||||
|
||||
var apiInstance = new SwaggerPetstore.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(body)
|
||||
|
||||
Place an order for a pet
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
var SwaggerPetstore = require('swagger_petstore');
|
||||
|
||||
var apiInstance = new SwaggerPetstore.StoreApi();
|
||||
|
||||
var body = new SwaggerPetstore.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(body, callback);
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**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
|
||||
|
||||
9
samples/client/petstore/javascript-es6/docs/Tag.md
Normal file
9
samples/client/petstore/javascript-es6/docs/Tag.md
Normal file
@@ -0,0 +1,9 @@
|
||||
# SwaggerPetstore.Tag
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**id** | **Number** | | [optional]
|
||||
**name** | **String** | | [optional]
|
||||
|
||||
|
||||
15
samples/client/petstore/javascript-es6/docs/User.md
Normal file
15
samples/client/petstore/javascript-es6/docs/User.md
Normal file
@@ -0,0 +1,15 @@
|
||||
# SwaggerPetstore.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]
|
||||
|
||||
|
||||
384
samples/client/petstore/javascript-es6/docs/UserApi.md
Normal file
384
samples/client/petstore/javascript-es6/docs/UserApi.md
Normal file
@@ -0,0 +1,384 @@
|
||||
# SwaggerPetstore.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(body)
|
||||
|
||||
Create user
|
||||
|
||||
This can only be done by the logged in user.
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
var SwaggerPetstore = require('swagger_petstore');
|
||||
|
||||
var apiInstance = new SwaggerPetstore.UserApi();
|
||||
|
||||
var body = new SwaggerPetstore.User(); // User | Created user object
|
||||
|
||||
|
||||
var callback = function(error, data, response) {
|
||||
if (error) {
|
||||
console.error(error);
|
||||
} else {
|
||||
console.log('API called successfully.');
|
||||
}
|
||||
};
|
||||
apiInstance.createUser(body, callback);
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**User**](User.md)| Created user object |
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
<a name="createUsersWithArrayInput"></a>
|
||||
# **createUsersWithArrayInput**
|
||||
> createUsersWithArrayInput(body)
|
||||
|
||||
Creates list of users with given input array
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
var SwaggerPetstore = require('swagger_petstore');
|
||||
|
||||
var apiInstance = new SwaggerPetstore.UserApi();
|
||||
|
||||
var body = [new SwaggerPetstore.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(body, callback);
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**[User]**](User.md)| List of user object |
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
<a name="createUsersWithListInput"></a>
|
||||
# **createUsersWithListInput**
|
||||
> createUsersWithListInput(body)
|
||||
|
||||
Creates list of users with given input array
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
var SwaggerPetstore = require('swagger_petstore');
|
||||
|
||||
var apiInstance = new SwaggerPetstore.UserApi();
|
||||
|
||||
var body = [new SwaggerPetstore.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(body, callback);
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**[User]**](User.md)| List of user object |
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
<a name="deleteUser"></a>
|
||||
# **deleteUser**
|
||||
> deleteUser(username)
|
||||
|
||||
Delete user
|
||||
|
||||
This can only be done by the logged in user.
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
var SwaggerPetstore = require('swagger_petstore');
|
||||
|
||||
var apiInstance = new SwaggerPetstore.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**: application/xml, application/json
|
||||
|
||||
<a name="getUserByName"></a>
|
||||
# **getUserByName**
|
||||
> User getUserByName(username)
|
||||
|
||||
Get user by user name
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
var SwaggerPetstore = require('swagger_petstore');
|
||||
|
||||
var apiInstance = new SwaggerPetstore.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 SwaggerPetstore = require('swagger_petstore');
|
||||
|
||||
var apiInstance = new SwaggerPetstore.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 SwaggerPetstore = require('swagger_petstore');
|
||||
|
||||
var apiInstance = new SwaggerPetstore.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**: application/xml, application/json
|
||||
|
||||
<a name="updateUser"></a>
|
||||
# **updateUser**
|
||||
> updateUser(username, body)
|
||||
|
||||
Updated user
|
||||
|
||||
This can only be done by the logged in user.
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
var SwaggerPetstore = require('swagger_petstore');
|
||||
|
||||
var apiInstance = new SwaggerPetstore.UserApi();
|
||||
|
||||
var username = "username_example"; // String | name that need to be deleted
|
||||
|
||||
var body = new SwaggerPetstore.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, body, callback);
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**username** | **String**| name that need to be deleted |
|
||||
**body** | [**User**](User.md)| Updated user object |
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
Reference in New Issue
Block a user