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

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