Update petstore sample for JS-promise client

This commit is contained in:
xhh 2016-05-06 18:02:32 +08:00
parent 3dbab1b893
commit 5acef6d634
40 changed files with 1014 additions and 444 deletions

View File

@ -27,7 +27,7 @@ fi
# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="$@ generate -t modules/swagger-codegen/src/main/resources/Javascript \
-i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l javascript \
-i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l javascript \
-o samples/client/petstore/javascript-promise \
--additional-properties usePromises=true"

View File

@ -1,12 +1,12 @@
# swagger-petstore
SwaggerPetstore - JavaScript client for swagger-petstore
This is a sample server Petstore server. You can find out more about Swagger at <a href=\"http://swagger.io\">http://swagger.io</a> or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose.
This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
- API version: 1.0.0
- Package version: 1.0.0
- Build date: 2016-05-01T12:08:53.092+08:00
- Build date: 2016-05-06T17:51:36.114+08:00
- Build package: class io.swagger.codegen.languages.JavascriptClientCodegen
## Installation
@ -53,18 +53,27 @@ Please follow the [installation](#installation) instruction and execute the foll
```javascript
var SwaggerPetstore = require('swagger-petstore');
var defaultClient = SwaggerPetstore.ApiClient.default;
var api = new SwaggerPetstore.FakeApi()
// Configure OAuth2 access token for authorization: petstore_auth
var petstore_auth = defaultClient.authentications['petstore_auth'];
petstore_auth.accessToken = "YOUR ACCESS TOKEN"
var _number = 3.4; // {Number} None
var api = new SwaggerPetstore.PetApi()
var _double = 1.2; // {Number} None
var _string = "_string_example"; // {String} None
var _byte = "B"; // {String} None
var opts = {
'body': new SwaggerPetstore.Pet() // {Pet} Pet object that needs to be added to the store
'integer': 56, // {Integer} None
'int32': 56, // {Integer} None
'int64': 789, // {Integer} None
'_float': 3.4, // {Number} None
'binary': "B", // {String} 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
};
api.addPet(opts).then(function() {
api.testEndpointParameters(_number, _double, _string, _byte, opts).then(function() {
console.log('API called successfully.');
}, function(error) {
console.error(error);
@ -79,6 +88,7 @@ All URIs are relative to *http://petstore.swagger.io/v2*
Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*SwaggerPetstore.FakeApi* | [**testEndpointParameters**](docs/FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters
*SwaggerPetstore.PetApi* | [**addPet**](docs/PetApi.md#addPet) | **POST** /pet | Add a new pet to the store
*SwaggerPetstore.PetApi* | [**deletePet**](docs/PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet
*SwaggerPetstore.PetApi* | [**findPetsByStatus**](docs/PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status
@ -103,9 +113,21 @@ Class | Method | HTTP request | Description
## Documentation for Models
- [SwaggerPetstore.Animal](docs/Animal.md)
- [SwaggerPetstore.AnimalFarm](docs/AnimalFarm.md)
- [SwaggerPetstore.ApiResponse](docs/ApiResponse.md)
- [SwaggerPetstore.Cat](docs/Cat.md)
- [SwaggerPetstore.Category](docs/Category.md)
- [SwaggerPetstore.Dog](docs/Dog.md)
- [SwaggerPetstore.EnumClass](docs/EnumClass.md)
- [SwaggerPetstore.EnumTest](docs/EnumTest.md)
- [SwaggerPetstore.FormatTest](docs/FormatTest.md)
- [SwaggerPetstore.Model200Response](docs/Model200Response.md)
- [SwaggerPetstore.ModelReturn](docs/ModelReturn.md)
- [SwaggerPetstore.Name](docs/Name.md)
- [SwaggerPetstore.Order](docs/Order.md)
- [SwaggerPetstore.Pet](docs/Pet.md)
- [SwaggerPetstore.SpecialModelName](docs/SpecialModelName.md)
- [SwaggerPetstore.Tag](docs/Tag.md)
- [SwaggerPetstore.User](docs/User.md)
@ -113,12 +135,6 @@ Class | Method | HTTP request | Description
## Documentation for Authorization
### api_key
- **Type**: API key
- **API key parameter name**: api_key
- **Location**: HTTP header
### petstore_auth
- **Type**: OAuth
@ -128,3 +144,9 @@ Class | Method | HTTP request | Description
- write:pets: modify pets in your account
- read:pets: read your pets
### api_key
- **Type**: API key
- **API key parameter name**: api_key
- **Location**: HTTP header

View File

@ -0,0 +1,7 @@
# SwaggerPetstore.AnimalFarm
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------

View File

@ -0,0 +1,10 @@
# SwaggerPetstore.ApiResponse
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**code** | **Integer** | | [optional]
**type** | **String** | | [optional]
**message** | **String** | | [optional]

View File

@ -0,0 +1,7 @@
# SwaggerPetstore.EnumClass
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------

View File

@ -0,0 +1,10 @@
# SwaggerPetstore.EnumTest
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**enumString** | **String** | | [optional]
**enumInteger** | **Integer** | | [optional]
**enumNumber** | **Number** | | [optional]

View File

@ -0,0 +1,79 @@
# SwaggerPetstore.FakeApi
All URIs are relative to *http://petstore.swagger.io/v2*
Method | HTTP request | Description
------------- | ------------- | -------------
[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters
<a name="testEndpointParameters"></a>
# **testEndpointParameters**
> testEndpointParameters(_number, _double, _string, _byte, opts)
Fake endpoint for testing various parameters
Fake endpoint for testing various parameters
### Example
```javascript
var SwaggerPetstore = require('swagger-petstore');
var apiInstance = new SwaggerPetstore.FakeApi();
var _number = 3.4; // Number | None
var _double = 1.2; // Number | None
var _string = "_string_example"; // String | None
var _byte = "B"; // String | None
var opts = {
'integer': 56, // Integer | None
'int32': 56, // Integer | None
'int64': 789, // Integer | None
'_float': 3.4, // Number | None
'binary': "B", // String | 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
};
apiInstance.testEndpointParameters(_number, _double, _string, _byte, opts).then(function() {
console.log('API called successfully.');
}, function(error) {
console.error(error);
});
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**_number** | **Number**| None |
**_double** | **Number**| None |
**_string** | **String**| None |
**_byte** | **String**| None |
**integer** | **Integer**| None | [optional]
**int32** | **Integer**| None | [optional]
**int64** | **Integer**| None | [optional]
**_float** | **Number**| None | [optional]
**binary** | **String**| None | [optional]
**_date** | **Date**| None | [optional]
**dateTime** | **Date**| None | [optional]
**password** | **String**| None | [optional]
### Return type
null (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/xml, application/json

View File

@ -10,9 +10,11 @@ Name | Type | Description | Notes
**_float** | **Number** | | [optional]
**_double** | **Number** | | [optional]
**_string** | **String** | | [optional]
**_byte** | **String** | | [optional]
**_byte** | **String** | |
**binary** | **String** | | [optional]
**_date** | **Date** | | [optional]
**dateTime** | **String** | | [optional]
**_date** | **Date** | |
**dateTime** | **Date** | | [optional]
**uuid** | **String** | | [optional]
**password** | **String** | |

View File

@ -1,13 +0,0 @@
# SwaggerPetstore.InlineResponse200
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**tags** | [**[Tag]**](Tag.md) | | [optional]
**id** | **Integer** | |
**category** | **Object** | | [optional]
**status** | **String** | pet status in the store | [optional]
**name** | **String** | | [optional]
**photoUrls** | **[String]** | | [optional]

View File

@ -5,5 +5,6 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **Integer** | |
**snakeCase** | **Integer** | | [optional]
**property** | **String** | | [optional]

View File

@ -8,6 +8,6 @@ Name | Type | Description | Notes
**quantity** | **Integer** | | [optional]
**shipDate** | **Date** | | [optional]
**status** | **String** | Order Status | [optional]
**complete** | **Boolean** | | [optional]
**complete** | **Boolean** | | [optional] [default to false]

View File

@ -16,7 +16,7 @@ Method | HTTP request | Description
<a name="addPet"></a>
# **addPet**
> addPet(opts)
> addPet(body)
Add a new pet to the store
@ -33,10 +33,9 @@ petstore_auth.accessToken = 'YOUR ACCESS TOKEN';
var apiInstance = new SwaggerPetstore.PetApi();
var opts = {
'body': new SwaggerPetstore.Pet() // Pet | Pet object that needs to be added to the store
};
apiInstance.addPet(opts).then(function() {
var body = new SwaggerPetstore.Pet(); // Pet | Pet object that needs to be added to the store
apiInstance.addPet(body).then(function() {
console.log('API called successfully.');
}, function(error) {
console.error(error);
@ -48,7 +47,7 @@ apiInstance.addPet(opts).then(function() {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | [optional]
**body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
### Return type
@ -61,7 +60,7 @@ null (empty response body)
### HTTP request headers
- **Content-Type**: application/json, application/xml
- **Accept**: application/json, application/xml
- **Accept**: application/xml, application/json
<a name="deletePet"></a>
# **deletePet**
@ -113,15 +112,15 @@ null (empty response body)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json, application/xml
- **Accept**: application/xml, application/json
<a name="findPetsByStatus"></a>
# **findPetsByStatus**
> [Pet] findPetsByStatus(opts)
> [Pet] findPetsByStatus(status)
Finds Pets by status
Multiple status values can be provided with comma seperated strings
Multiple status values can be provided with comma separated strings
### Example
```javascript
@ -134,10 +133,9 @@ petstore_auth.accessToken = 'YOUR ACCESS TOKEN';
var apiInstance = new SwaggerPetstore.PetApi();
var opts = {
'status': ["available"] // [String] | Status values that need to be considered for filter
};
apiInstance.findPetsByStatus(opts).then(function(data) {
var status = ["status_example"]; // [String] | Status values that need to be considered for filter
apiInstance.findPetsByStatus(status).then(function(data) {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
@ -149,7 +147,7 @@ apiInstance.findPetsByStatus(opts).then(function(data) {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**status** | [**[String]**](String.md)| Status values that need to be considered for filter | [optional] [default to available]
**status** | [**[String]**](String.md)| Status values that need to be considered for filter |
### Return type
@ -162,15 +160,15 @@ Name | Type | Description | Notes
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json, application/xml
- **Accept**: application/xml, application/json
<a name="findPetsByTags"></a>
# **findPetsByTags**
> [Pet] findPetsByTags(opts)
> [Pet] findPetsByTags(tags)
Finds Pets by tags
Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.
Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
### Example
```javascript
@ -183,10 +181,9 @@ petstore_auth.accessToken = 'YOUR ACCESS TOKEN';
var apiInstance = new SwaggerPetstore.PetApi();
var opts = {
'tags': ["tags_example"] // [String] | Tags to filter by
};
apiInstance.findPetsByTags(opts).then(function(data) {
var tags = ["tags_example"]; // [String] | Tags to filter by
apiInstance.findPetsByTags(tags).then(function(data) {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
@ -198,7 +195,7 @@ apiInstance.findPetsByTags(opts).then(function(data) {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**tags** | [**[String]**](String.md)| Tags to filter by | [optional]
**tags** | [**[String]**](String.md)| Tags to filter by |
### Return type
@ -211,7 +208,7 @@ Name | Type | Description | Notes
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json, application/xml
- **Accept**: application/xml, application/json
<a name="getPetById"></a>
# **getPetById**
@ -219,7 +216,7 @@ Name | Type | Description | Notes
Find pet by ID
Returns a pet when ID &lt; 10. ID &gt; 10 or nonintegers will simulate API error conditions
Returns a single pet
### Example
```javascript
@ -232,13 +229,9 @@ 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';
// 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; // Integer | ID of pet that needs to be fetched
var petId = 789; // Integer | ID of pet to return
apiInstance.getPetById(petId).then(function(data) {
console.log('API called successfully. Returned data: ' + data);
@ -252,7 +245,7 @@ apiInstance.getPetById(petId).then(function(data) {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**petId** | **Integer**| ID of pet that needs to be fetched |
**petId** | **Integer**| ID of pet to return |
### Return type
@ -260,16 +253,16 @@ Name | Type | Description | Notes
### Authorization
[api_key](../README.md#api_key), [petstore_auth](../README.md#petstore_auth)
[api_key](../README.md#api_key)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json, application/xml
- **Accept**: application/xml, application/json
<a name="updatePet"></a>
# **updatePet**
> updatePet(opts)
> updatePet(body)
Update an existing pet
@ -286,10 +279,9 @@ petstore_auth.accessToken = 'YOUR ACCESS TOKEN';
var apiInstance = new SwaggerPetstore.PetApi();
var opts = {
'body': new SwaggerPetstore.Pet() // Pet | Pet object that needs to be added to the store
};
apiInstance.updatePet(opts).then(function() {
var body = new SwaggerPetstore.Pet(); // Pet | Pet object that needs to be added to the store
apiInstance.updatePet(body).then(function() {
console.log('API called successfully.');
}, function(error) {
console.error(error);
@ -301,7 +293,7 @@ apiInstance.updatePet(opts).then(function() {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | [optional]
**body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
### Return type
@ -314,7 +306,7 @@ null (empty response body)
### HTTP request headers
- **Content-Type**: application/json, application/xml
- **Accept**: application/json, application/xml
- **Accept**: application/xml, application/json
<a name="updatePetWithForm"></a>
# **updatePetWithForm**
@ -335,7 +327,7 @@ petstore_auth.accessToken = 'YOUR ACCESS TOKEN';
var apiInstance = new SwaggerPetstore.PetApi();
var petId = "petId_example"; // String | ID of pet that needs to be updated
var petId = 789; // Integer | ID of pet that needs to be updated
var opts = {
'name': "name_example", // String | Updated name of the pet
@ -353,7 +345,7 @@ apiInstance.updatePetWithForm(petId, opts).then(function() {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**petId** | **String**| ID of pet that needs to be updated |
**petId** | **Integer**| ID of pet that needs to be updated |
**name** | **String**| Updated name of the pet | [optional]
**status** | **String**| Updated status of the pet | [optional]
@ -368,11 +360,11 @@ null (empty response body)
### HTTP request headers
- **Content-Type**: application/x-www-form-urlencoded
- **Accept**: application/json, application/xml
- **Accept**: application/xml, application/json
<a name="uploadFile"></a>
# **uploadFile**
> uploadFile(petId, opts)
> ApiResponse uploadFile(petId, opts)
uploads an image
@ -395,8 +387,8 @@ var opts = {
'additionalMetadata': "additionalMetadata_example", // String | Additional data to pass to server
'file': "/path/to/file.txt" // File | file to upload
};
apiInstance.uploadFile(petId, opts).then(function() {
console.log('API called successfully.');
apiInstance.uploadFile(petId, opts).then(function(data) {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
});
@ -413,7 +405,7 @@ Name | Type | Description | Notes
### Return type
null (empty response body)
[**ApiResponse**](ApiResponse.md)
### Authorization
@ -422,5 +414,5 @@ null (empty response body)
### HTTP request headers
- **Content-Type**: multipart/form-data
- **Accept**: application/json, application/xml
- **Accept**: application/json

View File

@ -51,7 +51,7 @@ No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json, application/xml
- **Accept**: application/xml, application/json
<a name="getInventory"></a>
# **getInventory**
@ -95,7 +95,7 @@ This endpoint does not need any parameter.
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json, application/xml
- **Accept**: application/json
<a name="getOrderById"></a>
# **getOrderById**
@ -111,7 +111,7 @@ var SwaggerPetstore = require('swagger-petstore');
var apiInstance = new SwaggerPetstore.StoreApi();
var orderId = "orderId_example"; // String | ID of pet that needs to be fetched
var orderId = 789; // Integer | ID of pet that needs to be fetched
apiInstance.getOrderById(orderId).then(function(data) {
console.log('API called successfully. Returned data: ' + data);
@ -125,7 +125,7 @@ apiInstance.getOrderById(orderId).then(function(data) {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**orderId** | **String**| ID of pet that needs to be fetched |
**orderId** | **Integer**| ID of pet that needs to be fetched |
### Return type
@ -138,11 +138,11 @@ No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json, application/xml
- **Accept**: application/xml, application/json
<a name="placeOrder"></a>
# **placeOrder**
> Order placeOrder(opts)
> Order placeOrder(body)
Place an order for a pet
@ -154,10 +154,9 @@ var SwaggerPetstore = require('swagger-petstore');
var apiInstance = new SwaggerPetstore.StoreApi();
var opts = {
'body': new SwaggerPetstore.Order() // Order | order placed for purchasing the pet
};
apiInstance.placeOrder(opts).then(function(data) {
var body = new SwaggerPetstore.Order(); // Order | order placed for purchasing the pet
apiInstance.placeOrder(body).then(function(data) {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
@ -169,7 +168,7 @@ apiInstance.placeOrder(opts).then(function(data) {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**Order**](Order.md)| order placed for purchasing the pet | [optional]
**body** | [**Order**](Order.md)| order placed for purchasing the pet |
### Return type
@ -182,5 +181,5 @@ No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json, application/xml
- **Accept**: application/xml, application/json

View File

@ -16,7 +16,7 @@ Method | HTTP request | Description
<a name="createUser"></a>
# **createUser**
> createUser(opts)
> createUser(body)
Create user
@ -28,10 +28,9 @@ var SwaggerPetstore = require('swagger-petstore');
var apiInstance = new SwaggerPetstore.UserApi();
var opts = {
'body': new SwaggerPetstore.User() // User | Created user object
};
apiInstance.createUser(opts).then(function() {
var body = new SwaggerPetstore.User(); // User | Created user object
apiInstance.createUser(body).then(function() {
console.log('API called successfully.');
}, function(error) {
console.error(error);
@ -43,7 +42,7 @@ apiInstance.createUser(opts).then(function() {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**User**](User.md)| Created user object | [optional]
**body** | [**User**](User.md)| Created user object |
### Return type
@ -56,11 +55,11 @@ No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json, application/xml
- **Accept**: application/xml, application/json
<a name="createUsersWithArrayInput"></a>
# **createUsersWithArrayInput**
> createUsersWithArrayInput(opts)
> createUsersWithArrayInput(body)
Creates list of users with given input array
@ -72,10 +71,9 @@ var SwaggerPetstore = require('swagger-petstore');
var apiInstance = new SwaggerPetstore.UserApi();
var opts = {
'body': [new SwaggerPetstore.User()] // [User] | List of user object
};
apiInstance.createUsersWithArrayInput(opts).then(function() {
var body = [new SwaggerPetstore.User()]; // [User] | List of user object
apiInstance.createUsersWithArrayInput(body).then(function() {
console.log('API called successfully.');
}, function(error) {
console.error(error);
@ -87,7 +85,7 @@ apiInstance.createUsersWithArrayInput(opts).then(function() {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**[User]**](User.md)| List of user object | [optional]
**body** | [**[User]**](User.md)| List of user object |
### Return type
@ -100,11 +98,11 @@ No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json, application/xml
- **Accept**: application/xml, application/json
<a name="createUsersWithListInput"></a>
# **createUsersWithListInput**
> createUsersWithListInput(opts)
> createUsersWithListInput(body)
Creates list of users with given input array
@ -116,10 +114,9 @@ var SwaggerPetstore = require('swagger-petstore');
var apiInstance = new SwaggerPetstore.UserApi();
var opts = {
'body': [new SwaggerPetstore.User()] // [User] | List of user object
};
apiInstance.createUsersWithListInput(opts).then(function() {
var body = [new SwaggerPetstore.User()]; // [User] | List of user object
apiInstance.createUsersWithListInput(body).then(function() {
console.log('API called successfully.');
}, function(error) {
console.error(error);
@ -131,7 +128,7 @@ apiInstance.createUsersWithListInput(opts).then(function() {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**[User]**](User.md)| List of user object | [optional]
**body** | [**[User]**](User.md)| List of user object |
### Return type
@ -144,7 +141,7 @@ No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json, application/xml
- **Accept**: application/xml, application/json
<a name="deleteUser"></a>
# **deleteUser**
@ -187,7 +184,7 @@ No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json, application/xml
- **Accept**: application/xml, application/json
<a name="getUserByName"></a>
# **getUserByName**
@ -230,11 +227,11 @@ No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json, application/xml
- **Accept**: application/xml, application/json
<a name="loginUser"></a>
# **loginUser**
> &#39;String&#39; loginUser(opts)
> &#39;String&#39; loginUser(username, password)
Logs user into the system
@ -246,11 +243,11 @@ var SwaggerPetstore = require('swagger-petstore');
var apiInstance = new SwaggerPetstore.UserApi();
var opts = {
'username': "username_example", // String | The user name for login
'password': "password_example" // String | The password for login in clear text
};
apiInstance.loginUser(opts).then(function(data) {
var username = "username_example"; // String | The user name for login
var password = "password_example"; // String | The password for login in clear text
apiInstance.loginUser(username, password).then(function(data) {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
@ -262,8 +259,8 @@ apiInstance.loginUser(opts).then(function(data) {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**username** | **String**| The user name for login | [optional]
**password** | **String**| The password for login in clear text | [optional]
**username** | **String**| The user name for login |
**password** | **String**| The password for login in clear text |
### Return type
@ -276,7 +273,7 @@ No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json, application/xml
- **Accept**: application/xml, application/json
<a name="logoutUser"></a>
# **logoutUser**
@ -313,11 +310,11 @@ No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json, application/xml
- **Accept**: application/xml, application/json
<a name="updateUser"></a>
# **updateUser**
> updateUser(username, opts)
> updateUser(username, body)
Updated user
@ -331,10 +328,9 @@ var apiInstance = new SwaggerPetstore.UserApi();
var username = "username_example"; // String | name that need to be deleted
var opts = {
'body': new SwaggerPetstore.User() // User | Updated user object
};
apiInstance.updateUser(username, opts).then(function() {
var body = new SwaggerPetstore.User(); // User | Updated user object
apiInstance.updateUser(username, body).then(function() {
console.log('API called successfully.');
}, function(error) {
console.error(error);
@ -347,7 +343,7 @@ apiInstance.updateUser(username, opts).then(function() {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**username** | **String**| name that need to be deleted |
**body** | [**User**](User.md)| Updated user object | [optional]
**body** | [**User**](User.md)| Updated user object |
### Return type
@ -360,5 +356,5 @@ No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json, application/xml
- **Accept**: application/xml, application/json

View File

@ -1,7 +1,7 @@
{
"name": "swagger-petstore",
"version": "1.0.0",
"description": "This is a sample server Petstore server. You can find out more about Swagger at <a href=\"http://swagger.io\">http://swagger.io</a> or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters",
"description": "This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose.",
"license": "Apache 2.0",
"main": "src/index.js",
"scripts": {

View File

@ -40,8 +40,8 @@
* @type {Array.<String>}
*/
this.authentications = {
'api_key': {type: 'apiKey', 'in': 'header', name: 'api_key'},
'petstore_auth': {type: 'oauth2'}
'petstore_auth': {type: 'oauth2'},
'api_key': {type: 'apiKey', 'in': 'header', name: 'api_key'}
};
/**
* The default HTTP headers to be included for all API calls.

View File

@ -0,0 +1,113 @@
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['ApiClient'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('../ApiClient'));
} else {
// Browser globals (root is window)
if (!root.SwaggerPetstore) {
root.SwaggerPetstore = {};
}
root.SwaggerPetstore.FakeApi = factory(root.SwaggerPetstore.ApiClient);
}
}(this, function(ApiClient) {
'use strict';
/**
* Fake service.
* @module api/FakeApi
* @version 1.0.0
*/
/**
* Constructs a new FakeApi.
* @alias module:api/FakeApi
* @class
* @param {module:ApiClient} apiClient Optional API client implementation to use,
* default to {@link module:ApiClient#instance} if unspecified.
*/
var exports = function(apiClient) {
this.apiClient = apiClient || ApiClient.instance;
/**
* Fake endpoint for testing various parameters
* Fake endpoint for testing various parameters
* @param {Number} _number None
* @param {Number} _double None
* @param {String} _string None
* @param {String} _byte None
* @param {Object} opts Optional parameters
* @param {Integer} opts.integer None
* @param {Integer} opts.int32 None
* @param {Integer} opts.int64 None
* @param {Number} opts._float None
* @param {String} opts.binary None
* @param {Date} opts._date None
* @param {Date} opts.dateTime None
* @param {String} opts.password None
*/
this.testEndpointParameters = function(_number, _double, _string, _byte, opts) {
opts = opts || {};
var postBody = null;
// verify the required parameter '_number' is set
if (_number == undefined || _number == null) {
throw "Missing the required parameter '_number' when calling testEndpointParameters";
}
// verify the required parameter '_double' is set
if (_double == undefined || _double == null) {
throw "Missing the required parameter '_double' when calling testEndpointParameters";
}
// verify the required parameter '_string' is set
if (_string == undefined || _string == null) {
throw "Missing the required parameter '_string' when calling testEndpointParameters";
}
// verify the required parameter '_byte' is set
if (_byte == undefined || _byte == null) {
throw "Missing the required parameter '_byte' when calling testEndpointParameters";
}
var pathParams = {
};
var queryParams = {
};
var headerParams = {
};
var formParams = {
'integer': opts['integer'],
'int32': opts['int32'],
'int64': opts['int64'],
'number': _number,
'float': opts['_float'],
'double': _double,
'string': _string,
'byte': _byte,
'binary': opts['binary'],
'date': opts['_date'],
'dateTime': opts['dateTime'],
'password': opts['password']
};
var authNames = [];
var contentTypes = [];
var accepts = ['application/xml', 'application/json'];
var returnType = null;
return this.apiClient.callApi(
'/fake', 'POST',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType
);
}
};
return exports;
}));

View File

@ -1,18 +1,18 @@
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['ApiClient', 'model/Pet'], factory);
define(['ApiClient', 'model/Pet', 'model/ApiResponse'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('../ApiClient'), require('../model/Pet'));
module.exports = factory(require('../ApiClient'), require('../model/Pet'), require('../model/ApiResponse'));
} else {
// Browser globals (root is window)
if (!root.SwaggerPetstore) {
root.SwaggerPetstore = {};
}
root.SwaggerPetstore.PetApi = factory(root.SwaggerPetstore.ApiClient, root.SwaggerPetstore.Pet);
root.SwaggerPetstore.PetApi = factory(root.SwaggerPetstore.ApiClient, root.SwaggerPetstore.Pet, root.SwaggerPetstore.ApiResponse);
}
}(this, function(ApiClient, Pet) {
}(this, function(ApiClient, Pet, ApiResponse) {
'use strict';
/**
@ -36,12 +36,15 @@
/**
* Add a new pet to the store
*
* @param {Object} opts Optional parameters
* @param {module:model/Pet} opts.body Pet object that needs to be added to the store
* @param {module:model/Pet} body Pet object that needs to be added to the store
*/
this.addPet = function(opts) {
opts = opts || {};
var postBody = opts['body'];
this.addPet = function(body) {
var postBody = body;
// verify the required parameter 'body' is set
if (body == undefined || body == null) {
throw "Missing the required parameter 'body' when calling addPet";
}
var pathParams = {
@ -55,7 +58,7 @@
var authNames = ['petstore_auth'];
var contentTypes = ['application/json', 'application/xml'];
var accepts = ['application/json', 'application/xml'];
var accepts = ['application/xml', 'application/json'];
var returnType = null;
return this.apiClient.callApi(
@ -96,7 +99,7 @@
var authNames = ['petstore_auth'];
var contentTypes = [];
var accepts = ['application/json', 'application/xml'];
var accepts = ['application/xml', 'application/json'];
var returnType = null;
return this.apiClient.callApi(
@ -109,20 +112,23 @@
/**
* Finds Pets by status
* Multiple status values can be provided with comma seperated strings
* @param {Object} opts Optional parameters
* @param {Array.<String>} opts.status Status values that need to be considered for filter (default to available)
* Multiple status values can be provided with comma separated strings
* @param {Array.<String>} status Status values that need to be considered for filter
* data is of type: {Array.<module:model/Pet>}
*/
this.findPetsByStatus = function(opts) {
opts = opts || {};
this.findPetsByStatus = function(status) {
var postBody = null;
// verify the required parameter 'status' is set
if (status == undefined || status == null) {
throw "Missing the required parameter 'status' when calling findPetsByStatus";
}
var pathParams = {
};
var queryParams = {
'status': this.apiClient.buildCollectionParam(opts['status'], 'multi')
'status': this.apiClient.buildCollectionParam(status, 'csv')
};
var headerParams = {
};
@ -131,7 +137,7 @@
var authNames = ['petstore_auth'];
var contentTypes = [];
var accepts = ['application/json', 'application/xml'];
var accepts = ['application/xml', 'application/json'];
var returnType = [Pet];
return this.apiClient.callApi(
@ -144,20 +150,23 @@
/**
* Finds Pets by tags
* Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.
* @param {Object} opts Optional parameters
* @param {Array.<String>} opts.tags Tags to filter by
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
* @param {Array.<String>} tags Tags to filter by
* data is of type: {Array.<module:model/Pet>}
*/
this.findPetsByTags = function(opts) {
opts = opts || {};
this.findPetsByTags = function(tags) {
var postBody = null;
// verify the required parameter 'tags' is set
if (tags == undefined || tags == null) {
throw "Missing the required parameter 'tags' when calling findPetsByTags";
}
var pathParams = {
};
var queryParams = {
'tags': this.apiClient.buildCollectionParam(opts['tags'], 'multi')
'tags': this.apiClient.buildCollectionParam(tags, 'csv')
};
var headerParams = {
};
@ -166,7 +175,7 @@
var authNames = ['petstore_auth'];
var contentTypes = [];
var accepts = ['application/json', 'application/xml'];
var accepts = ['application/xml', 'application/json'];
var returnType = [Pet];
return this.apiClient.callApi(
@ -179,8 +188,8 @@
/**
* Find pet by ID
* Returns a pet when ID &lt; 10. ID &gt; 10 or nonintegers will simulate API error conditions
* @param {Integer} petId ID of pet that needs to be fetched
* Returns a single pet
* @param {Integer} petId ID of pet to return
* data is of type: {module:model/Pet}
*/
this.getPetById = function(petId) {
@ -202,9 +211,9 @@
var formParams = {
};
var authNames = ['api_key', 'petstore_auth'];
var authNames = ['api_key'];
var contentTypes = [];
var accepts = ['application/json', 'application/xml'];
var accepts = ['application/xml', 'application/json'];
var returnType = Pet;
return this.apiClient.callApi(
@ -218,12 +227,15 @@
/**
* Update an existing pet
*
* @param {Object} opts Optional parameters
* @param {module:model/Pet} opts.body Pet object that needs to be added to the store
* @param {module:model/Pet} body Pet object that needs to be added to the store
*/
this.updatePet = function(opts) {
opts = opts || {};
var postBody = opts['body'];
this.updatePet = function(body) {
var postBody = body;
// verify the required parameter 'body' is set
if (body == undefined || body == null) {
throw "Missing the required parameter 'body' when calling updatePet";
}
var pathParams = {
@ -237,7 +249,7 @@
var authNames = ['petstore_auth'];
var contentTypes = ['application/json', 'application/xml'];
var accepts = ['application/json', 'application/xml'];
var accepts = ['application/xml', 'application/json'];
var returnType = null;
return this.apiClient.callApi(
@ -251,7 +263,7 @@
/**
* Updates a pet in the store with form data
*
* @param {String} petId ID of pet that needs to be updated
* @param {Integer} petId ID of pet that needs to be updated
* @param {Object} opts Optional parameters
* @param {String} opts.name Updated name of the pet
* @param {String} opts.status Updated status of the pet
@ -280,7 +292,7 @@
var authNames = ['petstore_auth'];
var contentTypes = ['application/x-www-form-urlencoded'];
var accepts = ['application/json', 'application/xml'];
var accepts = ['application/xml', 'application/json'];
var returnType = null;
return this.apiClient.callApi(
@ -298,6 +310,7 @@
* @param {Object} opts Optional parameters
* @param {String} opts.additionalMetadata Additional data to pass to server
* @param {File} opts.file file to upload
* data is of type: {module:model/ApiResponse}
*/
this.uploadFile = function(petId, opts) {
opts = opts || {};
@ -323,8 +336,8 @@
var authNames = ['petstore_auth'];
var contentTypes = ['multipart/form-data'];
var accepts = ['application/json', 'application/xml'];
var returnType = null;
var accepts = ['application/json'];
var returnType = ApiResponse;
return this.apiClient.callApi(
'/pet/{petId}/uploadImage', 'POST',

View File

@ -59,7 +59,7 @@
var authNames = [];
var contentTypes = [];
var accepts = ['application/json', 'application/xml'];
var accepts = ['application/xml', 'application/json'];
var returnType = null;
return this.apiClient.callApi(
@ -90,7 +90,7 @@
var authNames = ['api_key'];
var contentTypes = [];
var accepts = ['application/json', 'application/xml'];
var accepts = ['application/json'];
var returnType = {'String': 'Integer'};
return this.apiClient.callApi(
@ -104,7 +104,7 @@
/**
* Find purchase order by ID
* For valid response try integer IDs with value &lt;&#x3D; 5 or &gt; 10. Other values will generated exceptions
* @param {String} orderId ID of pet that needs to be fetched
* @param {Integer} orderId ID of pet that needs to be fetched
* data is of type: {module:model/Order}
*/
this.getOrderById = function(orderId) {
@ -128,7 +128,7 @@
var authNames = [];
var contentTypes = [];
var accepts = ['application/json', 'application/xml'];
var accepts = ['application/xml', 'application/json'];
var returnType = Order;
return this.apiClient.callApi(
@ -142,13 +142,16 @@
/**
* Place an order for a pet
*
* @param {Object} opts Optional parameters
* @param {module:model/Order} opts.body order placed for purchasing the pet
* @param {module:model/Order} body order placed for purchasing the pet
* data is of type: {module:model/Order}
*/
this.placeOrder = function(opts) {
opts = opts || {};
var postBody = opts['body'];
this.placeOrder = function(body) {
var postBody = body;
// verify the required parameter 'body' is set
if (body == undefined || body == null) {
throw "Missing the required parameter 'body' when calling placeOrder";
}
var pathParams = {
@ -162,7 +165,7 @@
var authNames = [];
var contentTypes = [];
var accepts = ['application/json', 'application/xml'];
var accepts = ['application/xml', 'application/json'];
var returnType = Order;
return this.apiClient.callApi(

View File

@ -36,12 +36,15 @@
/**
* Create user
* This can only be done by the logged in user.
* @param {Object} opts Optional parameters
* @param {module:model/User} opts.body Created user object
* @param {module:model/User} body Created user object
*/
this.createUser = function(opts) {
opts = opts || {};
var postBody = opts['body'];
this.createUser = function(body) {
var postBody = body;
// verify the required parameter 'body' is set
if (body == undefined || body == null) {
throw "Missing the required parameter 'body' when calling createUser";
}
var pathParams = {
@ -55,7 +58,7 @@
var authNames = [];
var contentTypes = [];
var accepts = ['application/json', 'application/xml'];
var accepts = ['application/xml', 'application/json'];
var returnType = null;
return this.apiClient.callApi(
@ -69,12 +72,15 @@
/**
* Creates list of users with given input array
*
* @param {Object} opts Optional parameters
* @param {Array.<module:model/User>} opts.body List of user object
* @param {Array.<module:model/User>} body List of user object
*/
this.createUsersWithArrayInput = function(opts) {
opts = opts || {};
var postBody = opts['body'];
this.createUsersWithArrayInput = function(body) {
var postBody = body;
// verify the required parameter 'body' is set
if (body == undefined || body == null) {
throw "Missing the required parameter 'body' when calling createUsersWithArrayInput";
}
var pathParams = {
@ -88,7 +94,7 @@
var authNames = [];
var contentTypes = [];
var accepts = ['application/json', 'application/xml'];
var accepts = ['application/xml', 'application/json'];
var returnType = null;
return this.apiClient.callApi(
@ -102,12 +108,15 @@
/**
* Creates list of users with given input array
*
* @param {Object} opts Optional parameters
* @param {Array.<module:model/User>} opts.body List of user object
* @param {Array.<module:model/User>} body List of user object
*/
this.createUsersWithListInput = function(opts) {
opts = opts || {};
var postBody = opts['body'];
this.createUsersWithListInput = function(body) {
var postBody = body;
// verify the required parameter 'body' is set
if (body == undefined || body == null) {
throw "Missing the required parameter 'body' when calling createUsersWithListInput";
}
var pathParams = {
@ -121,7 +130,7 @@
var authNames = [];
var contentTypes = [];
var accepts = ['application/json', 'application/xml'];
var accepts = ['application/xml', 'application/json'];
var returnType = null;
return this.apiClient.callApi(
@ -158,7 +167,7 @@
var authNames = [];
var contentTypes = [];
var accepts = ['application/json', 'application/xml'];
var accepts = ['application/xml', 'application/json'];
var returnType = null;
return this.apiClient.callApi(
@ -196,7 +205,7 @@
var authNames = [];
var contentTypes = [];
var accepts = ['application/json', 'application/xml'];
var accepts = ['application/xml', 'application/json'];
var returnType = User;
return this.apiClient.callApi(
@ -210,21 +219,29 @@
/**
* Logs user into the system
*
* @param {Object} opts Optional parameters
* @param {String} opts.username The user name for login
* @param {String} opts.password The password for login in clear text
* @param {String} username The user name for login
* @param {String} password The password for login in clear text
* data is of type: {'String'}
*/
this.loginUser = function(opts) {
opts = opts || {};
this.loginUser = function(username, password) {
var postBody = null;
// verify the required parameter 'username' is set
if (username == undefined || username == null) {
throw "Missing the required parameter 'username' when calling loginUser";
}
// verify the required parameter 'password' is set
if (password == undefined || password == null) {
throw "Missing the required parameter 'password' when calling loginUser";
}
var pathParams = {
};
var queryParams = {
'username': opts['username'],
'password': opts['password']
'username': username,
'password': password
};
var headerParams = {
};
@ -233,7 +250,7 @@
var authNames = [];
var contentTypes = [];
var accepts = ['application/json', 'application/xml'];
var accepts = ['application/xml', 'application/json'];
var returnType = 'String';
return this.apiClient.callApi(
@ -263,7 +280,7 @@
var authNames = [];
var contentTypes = [];
var accepts = ['application/json', 'application/xml'];
var accepts = ['application/xml', 'application/json'];
var returnType = null;
return this.apiClient.callApi(
@ -278,18 +295,21 @@
* Updated user
* This can only be done by the logged in user.
* @param {String} username name that need to be deleted
* @param {Object} opts Optional parameters
* @param {module:model/User} opts.body Updated user object
* @param {module:model/User} body Updated user object
*/
this.updateUser = function(username, opts) {
opts = opts || {};
var postBody = opts['body'];
this.updateUser = function(username, body) {
var postBody = body;
// verify the required parameter 'username' is set
if (username == undefined || username == null) {
throw "Missing the required parameter 'username' when calling updateUser";
}
// verify the required parameter 'body' is set
if (body == undefined || body == null) {
throw "Missing the required parameter 'body' when calling updateUser";
}
var pathParams = {
'username': username
@ -303,7 +323,7 @@
var authNames = [];
var contentTypes = [];
var accepts = ['application/json', 'application/xml'];
var accepts = ['application/xml', 'application/json'];
var returnType = null;
return this.apiClient.callApi(

View File

@ -1,16 +1,16 @@
(function(factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['ApiClient', 'model/Category', 'model/Order', 'model/Pet', 'model/Tag', 'model/User', 'api/PetApi', 'api/StoreApi', 'api/UserApi'], factory);
define(['ApiClient', 'model/Animal', 'model/AnimalFarm', 'model/ApiResponse', 'model/Cat', 'model/Category', 'model/Dog', 'model/EnumClass', 'model/EnumTest', 'model/FormatTest', 'model/Model200Response', 'model/ModelReturn', 'model/Name', 'model/Order', 'model/Pet', 'model/SpecialModelName', 'model/Tag', 'model/User', 'api/FakeApi', 'api/PetApi', 'api/StoreApi', 'api/UserApi'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('./ApiClient'), require('./model/Category'), require('./model/Order'), require('./model/Pet'), require('./model/Tag'), require('./model/User'), require('./api/PetApi'), require('./api/StoreApi'), require('./api/UserApi'));
module.exports = factory(require('./ApiClient'), require('./model/Animal'), require('./model/AnimalFarm'), require('./model/ApiResponse'), require('./model/Cat'), require('./model/Category'), require('./model/Dog'), require('./model/EnumClass'), require('./model/EnumTest'), require('./model/FormatTest'), require('./model/Model200Response'), require('./model/ModelReturn'), require('./model/Name'), require('./model/Order'), require('./model/Pet'), require('./model/SpecialModelName'), require('./model/Tag'), require('./model/User'), require('./api/FakeApi'), require('./api/PetApi'), require('./api/StoreApi'), require('./api/UserApi'));
}
}(function(ApiClient, Category, Order, Pet, Tag, User, PetApi, StoreApi, UserApi) {
}(function(ApiClient, Animal, AnimalFarm, ApiResponse, Cat, Category, Dog, EnumClass, EnumTest, FormatTest, Model200Response, ModelReturn, Name, Order, Pet, SpecialModelName, Tag, User, FakeApi, PetApi, StoreApi, UserApi) {
'use strict';
/**
* This is a sample server Petstore server. You can find out more about Swagger at &lt;a href&#x3D;\&quot;http://swagger.io\&quot;&gt;http://swagger.io&lt;/a&gt; or on irc.freenode.net, #swagger. For this sample, you can use the api key \&quot;special-key\&quot; to test the authorization filters.<br>
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose..<br>
* The <code>index</code> module provides access to constructors for all the classes which comprise the public API.
* <p>
* An AMD (recommended!) or CommonJS application will generally do something equivalent to the following:
@ -46,11 +46,66 @@
* @property {module:ApiClient}
*/
ApiClient: ApiClient,
/**
* The Animal model constructor.
* @property {module:model/Animal}
*/
Animal: Animal,
/**
* The AnimalFarm model constructor.
* @property {module:model/AnimalFarm}
*/
AnimalFarm: AnimalFarm,
/**
* The ApiResponse model constructor.
* @property {module:model/ApiResponse}
*/
ApiResponse: ApiResponse,
/**
* The Cat model constructor.
* @property {module:model/Cat}
*/
Cat: Cat,
/**
* The Category model constructor.
* @property {module:model/Category}
*/
Category: Category,
/**
* The Dog model constructor.
* @property {module:model/Dog}
*/
Dog: Dog,
/**
* The EnumClass model constructor.
* @property {module:model/EnumClass}
*/
EnumClass: EnumClass,
/**
* The EnumTest model constructor.
* @property {module:model/EnumTest}
*/
EnumTest: EnumTest,
/**
* The FormatTest model constructor.
* @property {module:model/FormatTest}
*/
FormatTest: FormatTest,
/**
* The Model200Response model constructor.
* @property {module:model/Model200Response}
*/
Model200Response: Model200Response,
/**
* The ModelReturn model constructor.
* @property {module:model/ModelReturn}
*/
ModelReturn: ModelReturn,
/**
* The Name model constructor.
* @property {module:model/Name}
*/
Name: Name,
/**
* The Order model constructor.
* @property {module:model/Order}
@ -61,6 +116,11 @@
* @property {module:model/Pet}
*/
Pet: Pet,
/**
* The SpecialModelName model constructor.
* @property {module:model/SpecialModelName}
*/
SpecialModelName: SpecialModelName,
/**
* The Tag model constructor.
* @property {module:model/Tag}
@ -71,6 +131,11 @@
* @property {module:model/User}
*/
User: User,
/**
* The FakeApi service constructor.
* @property {module:api/FakeApi}
*/
FakeApi: FakeApi,
/**
* The PetApi service constructor.
* @property {module:api/PetApi}

View File

@ -1,7 +1,7 @@
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['../ApiClient'], factory);
define(['ApiClient'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('../ApiClient'));
@ -15,6 +15,9 @@
}(this, function(ApiClient) {
'use strict';
/**
* The Animal model module.
* @module model/Animal
@ -28,8 +31,9 @@
* @param className
*/
var exports = function(className) {
var _this = this;
this['className'] = className;
_this['className'] = className;
};
/**
@ -40,7 +44,7 @@
* @return {module:model/Animal} The populated <code>Animal</code> instance.
*/
exports.constructFromObject = function(data, obj) {
if (data) {
if (data) {
obj = obj || new exports();
if (data.hasOwnProperty('className')) {
@ -50,7 +54,6 @@
return obj;
}
/**
* @member {String} className
*/
@ -61,3 +64,5 @@
return exports;
}));

View File

@ -0,0 +1,64 @@
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['ApiClient', 'model/Animal'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('../ApiClient'), require('./Animal'));
} else {
// Browser globals (root is window)
if (!root.SwaggerPetstore) {
root.SwaggerPetstore = {};
}
root.SwaggerPetstore.AnimalFarm = factory(root.SwaggerPetstore.ApiClient, root.SwaggerPetstore.Animal);
}
}(this, function(ApiClient, Animal) {
'use strict';
/**
* The AnimalFarm model module.
* @module model/AnimalFarm
* @version 1.0.0
*/
/**
* Constructs a new <code>AnimalFarm</code>.
* @alias module:model/AnimalFarm
* @class
* @extends Array
*/
var exports = function() {
var _this = this;
_this = new Array();
Object.setPrototypeOf(_this, exports);
return _this;
};
/**
* Constructs a <code>AnimalFarm</code> from a plain JavaScript object, optionally creating a new instance.
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
* @param {Object} data The plain JavaScript object bearing properties of interest.
* @param {module:model/AnimalFarm} obj Optional instance to populate.
* @return {module:model/AnimalFarm} The populated <code>AnimalFarm</code> instance.
*/
exports.constructFromObject = function(data, obj) {
if (data) {
obj = obj || new exports();
ApiClient.constructFromObject(data, obj, Animal);
}
return obj;
}
return exports;
}));

View File

@ -0,0 +1,83 @@
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['ApiClient'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('../ApiClient'));
} else {
// Browser globals (root is window)
if (!root.SwaggerPetstore) {
root.SwaggerPetstore = {};
}
root.SwaggerPetstore.ApiResponse = factory(root.SwaggerPetstore.ApiClient);
}
}(this, function(ApiClient) {
'use strict';
/**
* The ApiResponse model module.
* @module model/ApiResponse
* @version 1.0.0
*/
/**
* Constructs a new <code>ApiResponse</code>.
* @alias module:model/ApiResponse
* @class
*/
var exports = function() {
var _this = this;
};
/**
* Constructs a <code>ApiResponse</code> from a plain JavaScript object, optionally creating a new instance.
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
* @param {Object} data The plain JavaScript object bearing properties of interest.
* @param {module:model/ApiResponse} obj Optional instance to populate.
* @return {module:model/ApiResponse} The populated <code>ApiResponse</code> instance.
*/
exports.constructFromObject = function(data, obj) {
if (data) {
obj = obj || new exports();
if (data.hasOwnProperty('code')) {
obj['code'] = ApiClient.convertToType(data['code'], 'Integer');
}
if (data.hasOwnProperty('type')) {
obj['type'] = ApiClient.convertToType(data['type'], 'String');
}
if (data.hasOwnProperty('message')) {
obj['message'] = ApiClient.convertToType(data['message'], 'String');
}
}
return obj;
}
/**
* @member {Integer} code
*/
exports.prototype['code'] = undefined;
/**
* @member {String} type
*/
exports.prototype['type'] = undefined;
/**
* @member {String} message
*/
exports.prototype['message'] = undefined;
return exports;
}));

View File

@ -1,7 +1,7 @@
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['../ApiClient', './Animal'], factory);
define(['ApiClient', 'model/Animal'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('../ApiClient'), require('./Animal'));
@ -15,6 +15,9 @@
}(this, function(ApiClient, Animal) {
'use strict';
/**
* The Cat model module.
* @module model/Cat
@ -29,7 +32,8 @@
* @param className
*/
var exports = function(className) {
Animal.call(this, className);
var _this = this;
Animal.call(_this, className);
};
@ -41,7 +45,7 @@
* @return {module:model/Cat} The populated <code>Cat</code> instance.
*/
exports.constructFromObject = function(data, obj) {
if (data) {
if (data) {
obj = obj || new exports();
Animal.constructFromObject(data, obj);
if (data.hasOwnProperty('declawed')) {
@ -54,7 +58,6 @@
exports.prototype = Object.create(Animal.prototype);
exports.prototype.constructor = exports;
/**
* @member {Boolean} declawed
*/
@ -65,3 +68,5 @@
return exports;
}));

View File

@ -15,6 +15,9 @@
}(this, function(ApiClient) {
'use strict';
/**
* The Category model module.
* @module model/Category
@ -54,12 +57,10 @@
return obj;
}
/**
* @member {Integer} id
*/
exports.prototype['id'] = undefined;
/**
* @member {String} name
*/
@ -70,3 +71,5 @@
return exports;
}));

View File

@ -1,7 +1,7 @@
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['../ApiClient', './Animal'], factory);
define(['ApiClient', 'model/Animal'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('../ApiClient'), require('./Animal'));
@ -15,6 +15,9 @@
}(this, function(ApiClient, Animal) {
'use strict';
/**
* The Dog model module.
* @module model/Dog
@ -29,7 +32,8 @@
* @param className
*/
var exports = function(className) {
Animal.call(this, className);
var _this = this;
Animal.call(_this, className);
};
@ -41,7 +45,7 @@
* @return {module:model/Dog} The populated <code>Dog</code> instance.
*/
exports.constructFromObject = function(data, obj) {
if (data) {
if (data) {
obj = obj || new exports();
Animal.constructFromObject(data, obj);
if (data.hasOwnProperty('breed')) {
@ -54,7 +58,6 @@
exports.prototype = Object.create(Animal.prototype);
exports.prototype.constructor = exports;
/**
* @member {String} breed
*/
@ -65,3 +68,5 @@
return exports;
}));

View File

@ -0,0 +1,44 @@
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['ApiClient'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('../ApiClient'));
} else {
// Browser globals (root is window)
if (!root.SwaggerPetstore) {
root.SwaggerPetstore = {};
}
root.SwaggerPetstore.EnumClass = factory(root.SwaggerPetstore.ApiClient);
}
}(this, function(ApiClient) {
'use strict';
/**
* Enum class EnumClass.
* @enum {}
* @readonly
*/
var exports = {
/**
* value: _abc
* @const
*/
"_abc": "_abc",
/**
* value: -efg
* @const
*/
"-efg": "-efg",
/**
* value: (xyz)
* @const
*/
"(xyz)": "(xyz)" };
return exports;
}));

View File

@ -0,0 +1,131 @@
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['ApiClient'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('../ApiClient'));
} else {
// Browser globals (root is window)
if (!root.SwaggerPetstore) {
root.SwaggerPetstore = {};
}
root.SwaggerPetstore.EnumTest = factory(root.SwaggerPetstore.ApiClient);
}
}(this, function(ApiClient) {
'use strict';
/**
* The EnumTest model module.
* @module model/EnumTest
* @version 1.0.0
*/
/**
* Constructs a new <code>EnumTest</code>.
* @alias module:model/EnumTest
* @class
*/
var exports = function() {
var _this = this;
};
/**
* Constructs a <code>EnumTest</code> from a plain JavaScript object, optionally creating a new instance.
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
* @param {Object} data The plain JavaScript object bearing properties of interest.
* @param {module:model/EnumTest} obj Optional instance to populate.
* @return {module:model/EnumTest} The populated <code>EnumTest</code> instance.
*/
exports.constructFromObject = function(data, obj) {
if (data) {
obj = obj || new exports();
if (data.hasOwnProperty('enum_string')) {
obj['enum_string'] = ApiClient.convertToType(data['enum_string'], 'String');
}
if (data.hasOwnProperty('enum_integer')) {
obj['enum_integer'] = ApiClient.convertToType(data['enum_integer'], 'Integer');
}
if (data.hasOwnProperty('enum_number')) {
obj['enum_number'] = ApiClient.convertToType(data['enum_number'], 'Number');
}
}
return obj;
}
/**
* @member {module:model/EnumTest.EnumStringEnum} enum_string
*/
exports.prototype['enum_string'] = undefined;
/**
* @member {module:model/EnumTest.EnumIntegerEnum} enum_integer
*/
exports.prototype['enum_integer'] = undefined;
/**
* @member {module:model/EnumTest.EnumNumberEnum} enum_number
*/
exports.prototype['enum_number'] = undefined;
/**
* Allowed values for the <code>enum_string</code> property.
* @enum {String}
* @readonly
*/
exports.EnumStringEnum = {
/**
* value: "UPPER"
* @const
*/
"UPPER": "UPPER",
/**
* value: "lower"
* @const
*/
"lower": "lower" };
/**
* Allowed values for the <code>enum_integer</code> property.
* @enum {Integer}
* @readonly
*/
exports.EnumIntegerEnum = {
/**
* value: 1
* @const
*/
"1": 1,
/**
* value: -1
* @const
*/
"-1": -1 };
/**
* Allowed values for the <code>enum_number</code> property.
* @enum {Number}
* @readonly
*/
exports.EnumNumberEnum = {
/**
* value: 1.1
* @const
*/
"1.1": 1.1,
/**
* value: -1.2
* @const
*/
"-1.2": -1.2 };
return exports;
}));

View File

@ -1,7 +1,7 @@
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['../ApiClient'], factory);
define(['ApiClient'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('../ApiClient'));
@ -15,6 +15,9 @@
}(this, function(ApiClient) {
'use strict';
/**
* The FormatTest model module.
* @module model/FormatTest
@ -26,20 +29,26 @@
* @alias module:model/FormatTest
* @class
* @param _number
* @param _byte
* @param _date
* @param password
*/
var exports = function(_number) {
var exports = function(_number, _byte, _date, password) {
var _this = this;
this['number'] = _number;
_this['number'] = _number;
_this['byte'] = _byte;
_this['date'] = _date;
_this['password'] = password;
};
/**
@ -50,7 +59,7 @@
* @return {module:model/FormatTest} The populated <code>FormatTest</code> instance.
*/
exports.constructFromObject = function(data, obj) {
if (data) {
if (data) {
obj = obj || new exports();
if (data.hasOwnProperty('integer')) {
@ -84,70 +93,75 @@
obj['date'] = ApiClient.convertToType(data['date'], 'Date');
}
if (data.hasOwnProperty('dateTime')) {
obj['dateTime'] = ApiClient.convertToType(data['dateTime'], 'String');
obj['dateTime'] = ApiClient.convertToType(data['dateTime'], 'Date');
}
if (data.hasOwnProperty('uuid')) {
obj['uuid'] = ApiClient.convertToType(data['uuid'], 'String');
}
if (data.hasOwnProperty('password')) {
obj['password'] = ApiClient.convertToType(data['password'], 'String');
}
}
return obj;
}
/**
* @member {Integer} integer
*/
exports.prototype['integer'] = undefined;
/**
* @member {Integer} int32
*/
exports.prototype['int32'] = undefined;
/**
* @member {Integer} int64
*/
exports.prototype['int64'] = undefined;
/**
* @member {Number} number
*/
exports.prototype['number'] = undefined;
/**
* @member {Number} float
*/
exports.prototype['float'] = undefined;
/**
* @member {Number} double
*/
exports.prototype['double'] = undefined;
/**
* @member {String} string
*/
exports.prototype['string'] = undefined;
/**
* @member {String} byte
*/
exports.prototype['byte'] = undefined;
/**
* @member {String} binary
*/
exports.prototype['binary'] = undefined;
/**
* @member {Date} date
*/
exports.prototype['date'] = undefined;
/**
* @member {String} dateTime
* @member {Date} dateTime
*/
exports.prototype['dateTime'] = undefined;
/**
* @member {String} uuid
*/
exports.prototype['uuid'] = undefined;
/**
* @member {String} password
*/
exports.prototype['password'] = undefined;
return exports;
}));

View File

@ -1,132 +0,0 @@
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['ApiClient', 'model/Tag'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('../ApiClient'), require('./Tag'));
} else {
// Browser globals (root is window)
if (!root.SwaggerPetstore) {
root.SwaggerPetstore = {};
}
root.SwaggerPetstore.InlineResponse200 = factory(root.SwaggerPetstore.ApiClient, root.SwaggerPetstore.Tag);
}
}(this, function(ApiClient, Tag) {
'use strict';
/**
* The InlineResponse200 model module.
* @module model/InlineResponse200
* @version 1.0.0
*/
/**
* Constructs a new <code>InlineResponse200</code>.
* @alias module:model/InlineResponse200
* @class
* @param id
*/
var exports = function(id) {
this['id'] = id;
};
/**
* Constructs a <code>InlineResponse200</code> from a plain JavaScript object, optionally creating a new instance.
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
* @param {Object} data The plain JavaScript object bearing properties of interest.
* @param {module:model/InlineResponse200} obj Optional instance to populate.
* @return {module:model/InlineResponse200} The populated <code>InlineResponse200</code> instance.
*/
exports.constructFromObject = function(data, obj) {
if (data) {
obj = obj || new exports();
if (data.hasOwnProperty('tags')) {
obj['tags'] = ApiClient.convertToType(data['tags'], [Tag]);
}
if (data.hasOwnProperty('id')) {
obj['id'] = ApiClient.convertToType(data['id'], 'Integer');
}
if (data.hasOwnProperty('category')) {
obj['category'] = ApiClient.convertToType(data['category'], Object);
}
if (data.hasOwnProperty('status')) {
obj['status'] = ApiClient.convertToType(data['status'], 'String');
}
if (data.hasOwnProperty('name')) {
obj['name'] = ApiClient.convertToType(data['name'], 'String');
}
if (data.hasOwnProperty('photoUrls')) {
obj['photoUrls'] = ApiClient.convertToType(data['photoUrls'], ['String']);
}
}
return obj;
}
/**
* @member {Array.<module:model/Tag>} tags
*/
exports.prototype['tags'] = undefined;
/**
* @member {Integer} id
*/
exports.prototype['id'] = undefined;
/**
* @member {Object} category
*/
exports.prototype['category'] = undefined;
/**
* pet status in the store
* @member {module:model/InlineResponse200.StatusEnum} status
*/
exports.prototype['status'] = undefined;
/**
* @member {String} name
*/
exports.prototype['name'] = undefined;
/**
* @member {Array.<String>} photoUrls
*/
exports.prototype['photoUrls'] = undefined;
/**
* Allowed values for the <code>status</code> property.
* @enum {String}
* @readonly
*/
exports.StatusEnum = {
/**
* value: available
* @const
*/
AVAILABLE: "available",
/**
* value: pending
* @const
*/
PENDING: "pending",
/**
* value: sold
* @const
*/
SOLD: "sold"
};
return exports;
}));

View File

@ -15,6 +15,9 @@
}(this, function(ApiClient) {
'use strict';
/**
* The Model200Response model module.
* @module model/Model200Response
@ -28,6 +31,7 @@
* @class
*/
var exports = function() {
var _this = this;
};
@ -40,7 +44,7 @@
* @return {module:model/Model200Response} The populated <code>Model200Response</code> instance.
*/
exports.constructFromObject = function(data, obj) {
if (data) {
if (data) {
obj = obj || new exports();
if (data.hasOwnProperty('name')) {
@ -50,7 +54,6 @@
return obj;
}
/**
* @member {Integer} name
*/
@ -61,3 +64,5 @@
return exports;
}));

View File

@ -15,6 +15,9 @@
}(this, function(ApiClient) {
'use strict';
/**
* The ModelReturn model module.
* @module model/ModelReturn
@ -28,6 +31,7 @@
* @class
*/
var exports = function() {
var _this = this;
};
@ -40,7 +44,7 @@
* @return {module:model/ModelReturn} The populated <code>ModelReturn</code> instance.
*/
exports.constructFromObject = function(data, obj) {
if (data) {
if (data) {
obj = obj || new exports();
if (data.hasOwnProperty('return')) {
@ -50,7 +54,6 @@
return obj;
}
/**
* @member {Integer} return
*/
@ -61,3 +64,5 @@
return exports;
}));

View File

@ -15,6 +15,9 @@
}(this, function(ApiClient) {
'use strict';
/**
* The Name model module.
* @module model/Name
@ -29,8 +32,10 @@
* @param name
*/
var exports = function(name) {
var _this = this;
_this['name'] = name;
this['name'] = name;
};
@ -42,7 +47,7 @@
* @return {module:model/Name} The populated <code>Name</code> instance.
*/
exports.constructFromObject = function(data, obj) {
if (data) {
if (data) {
obj = obj || new exports();
if (data.hasOwnProperty('name')) {
@ -51,23 +56,30 @@
if (data.hasOwnProperty('snake_case')) {
obj['snake_case'] = ApiClient.convertToType(data['snake_case'], 'Integer');
}
if (data.hasOwnProperty('property')) {
obj['property'] = ApiClient.convertToType(data['property'], 'String');
}
}
return obj;
}
/**
* @member {Integer} name
*/
exports.prototype['name'] = undefined;
/**
* @member {Integer} snake_case
*/
exports.prototype['snake_case'] = undefined;
/**
* @member {String} property
*/
exports.prototype['property'] = undefined;
return exports;
}));

View File

@ -15,6 +15,9 @@
}(this, function(ApiClient) {
'use strict';
/**
* The Order model module.
* @module model/Order
@ -70,37 +73,32 @@
return obj;
}
/**
* @member {Integer} id
*/
exports.prototype['id'] = undefined;
/**
* @member {Integer} petId
*/
exports.prototype['petId'] = undefined;
/**
* @member {Integer} quantity
*/
exports.prototype['quantity'] = undefined;
/**
* @member {Date} shipDate
*/
exports.prototype['shipDate'] = undefined;
/**
* Order Status
* @member {module:model/Order.StatusEnum} status
*/
exports.prototype['status'] = undefined;
/**
* @member {Boolean} complete
* @default false
*/
exports.prototype['complete'] = undefined;
exports.prototype['complete'] = false;
/**
@ -108,25 +106,25 @@
* @enum {String}
* @readonly
*/
exports.StatusEnum = {
exports.StatusEnum = {
/**
* value: placed
* value: "placed"
* @const
*/
PLACED: "placed",
"placed": "placed",
/**
* value: approved
* value: "approved"
* @const
*/
APPROVED: "approved",
"approved": "approved",
/**
* value: delivered
* value: "delivered"
* @const
*/
DELIVERED: "delivered"
};
"delivered": "delivered" };
return exports;
}));

View File

@ -15,6 +15,9 @@
}(this, function(ApiClient, Category, Tag) {
'use strict';
/**
* The Pet model module.
* @module model/Pet
@ -72,32 +75,26 @@
return obj;
}
/**
* @member {Integer} id
*/
exports.prototype['id'] = undefined;
/**
* @member {module:model/Category} category
*/
exports.prototype['category'] = undefined;
/**
* @member {String} name
*/
exports.prototype['name'] = undefined;
/**
* @member {Array.<String>} photoUrls
*/
exports.prototype['photoUrls'] = undefined;
/**
* @member {Array.<module:model/Tag>} tags
*/
exports.prototype['tags'] = undefined;
/**
* pet status in the store
* @member {module:model/Pet.StatusEnum} status
@ -110,25 +107,25 @@
* @enum {String}
* @readonly
*/
exports.StatusEnum = {
exports.StatusEnum = {
/**
* value: available
* value: "available"
* @const
*/
AVAILABLE: "available",
"available": "available",
/**
* value: pending
* value: "pending"
* @const
*/
PENDING: "pending",
"pending": "pending",
/**
* value: sold
* value: "sold"
* @const
*/
SOLD: "sold"
};
"sold": "sold" };
return exports;
}));

View File

@ -15,6 +15,9 @@
}(this, function(ApiClient) {
'use strict';
/**
* The SpecialModelName model module.
* @module model/SpecialModelName
@ -27,6 +30,7 @@
* @class
*/
var exports = function() {
var _this = this;
};
@ -39,7 +43,7 @@
* @return {module:model/SpecialModelName} The populated <code>SpecialModelName</code> instance.
*/
exports.constructFromObject = function(data, obj) {
if (data) {
if (data) {
obj = obj || new exports();
if (data.hasOwnProperty('$special[property.name]')) {
@ -49,7 +53,6 @@
return obj;
}
/**
* @member {Integer} $special[property.name]
*/
@ -60,3 +63,5 @@
return exports;
}));

View File

@ -15,6 +15,9 @@
}(this, function(ApiClient) {
'use strict';
/**
* The Tag model module.
* @module model/Tag
@ -54,12 +57,10 @@
return obj;
}
/**
* @member {Integer} id
*/
exports.prototype['id'] = undefined;
/**
* @member {String} name
*/
@ -70,3 +71,5 @@
return exports;
}));

View File

@ -15,6 +15,9 @@
}(this, function(ApiClient) {
'use strict';
/**
* The User model module.
* @module model/User
@ -78,42 +81,34 @@
return obj;
}
/**
* @member {Integer} id
*/
exports.prototype['id'] = undefined;
/**
* @member {String} username
*/
exports.prototype['username'] = undefined;
/**
* @member {String} firstName
*/
exports.prototype['firstName'] = undefined;
/**
* @member {String} lastName
*/
exports.prototype['lastName'] = undefined;
/**
* @member {String} email
*/
exports.prototype['email'] = undefined;
/**
* @member {String} password
*/
exports.prototype['password'] = undefined;
/**
* @member {String} phone
*/
exports.prototype['phone'] = undefined;
/**
* User Status
* @member {Integer} userStatus
@ -125,3 +120,5 @@
return exports;
}));

View File

@ -49,7 +49,7 @@ var createRandomPet = function() {
describe('PetApi', function() {
it('should create and get pet', function(done) {
var pet = createRandomPet();
api.addPet({body: pet})
api.addPet(pet)
.then(function() {
return api.getPetById(pet.id)
})
@ -63,7 +63,7 @@ describe('PetApi', function() {
.to.be(getProperty(getProperty(pet, "getCategory", "category"), "getName", "name"));
api.deletePet(pet.id);
done();
done();
});
});
});