forked from loafle/openapi-generator-original
Add option modelPropertyNaming to javascript generator (#299)
* Add option modelPropertyNaming to javascript generator Fixes 6530 * Update Petstore sample
This commit is contained in:
committed by
William Cheng
parent
7126074f49
commit
24104dac35
@@ -1,4 +1,4 @@
|
||||
# SwaggerPetstore.StoreApi
|
||||
# OpenApiPetstore.StoreApi
|
||||
|
||||
All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||
|
||||
@@ -20,12 +20,10 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
import SwaggerPetstore from 'swagger_petstore';
|
||||
|
||||
let apiInstance = new SwaggerPetstore.StoreApi();
|
||||
import OpenApiPetstore from 'open_api_petstore';
|
||||
|
||||
let apiInstance = new OpenApiPetstore.StoreApi();
|
||||
let orderId = "orderId_example"; // String | ID of the order that needs to be deleted
|
||||
|
||||
apiInstance.deleteOrder(orderId).then(() => {
|
||||
console.log('API called successfully.');
|
||||
}, (error) => {
|
||||
@@ -51,11 +49,11 @@ No authorization required
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/xml, application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
<a name="getInventory"></a>
|
||||
# **getInventory**
|
||||
> {'String': 'Number'} getInventory()
|
||||
> {String: Number} getInventory()
|
||||
|
||||
Returns pet inventories by status
|
||||
|
||||
@@ -63,8 +61,8 @@ Returns a map of status codes to quantities
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
import SwaggerPetstore from 'swagger_petstore';
|
||||
let defaultClient = SwaggerPetstore.ApiClient.instance;
|
||||
import OpenApiPetstore from 'open_api_petstore';
|
||||
let defaultClient = OpenApiPetstore.ApiClient.instance;
|
||||
|
||||
// Configure API key authorization: api_key
|
||||
let api_key = defaultClient.authentications['api_key'];
|
||||
@@ -72,7 +70,7 @@ api_key.apiKey = 'YOUR API KEY';
|
||||
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
|
||||
//api_key.apiKeyPrefix = 'Token';
|
||||
|
||||
let apiInstance = new SwaggerPetstore.StoreApi();
|
||||
let apiInstance = new OpenApiPetstore.StoreApi();
|
||||
apiInstance.getInventory().then((data) => {
|
||||
console.log('API called successfully. Returned data: ' + data);
|
||||
}, (error) => {
|
||||
@@ -86,7 +84,7 @@ This endpoint does not need any parameter.
|
||||
|
||||
### Return type
|
||||
|
||||
**{'String': 'Number'}**
|
||||
**{String: Number}**
|
||||
|
||||
### Authorization
|
||||
|
||||
@@ -107,12 +105,10 @@ For valid response try integer IDs with value <= 5 or > 10. Other val
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
import SwaggerPetstore from 'swagger_petstore';
|
||||
|
||||
let apiInstance = new SwaggerPetstore.StoreApi();
|
||||
import OpenApiPetstore from 'open_api_petstore';
|
||||
|
||||
let apiInstance = new OpenApiPetstore.StoreApi();
|
||||
let orderId = 789; // Number | ID of pet that needs to be fetched
|
||||
|
||||
apiInstance.getOrderById(orderId).then((data) => {
|
||||
console.log('API called successfully. Returned data: ' + data);
|
||||
}, (error) => {
|
||||
@@ -142,21 +138,17 @@ No authorization required
|
||||
|
||||
<a name="placeOrder"></a>
|
||||
# **placeOrder**
|
||||
> Order placeOrder(body)
|
||||
> Order placeOrder(order)
|
||||
|
||||
Place an order for a pet
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
import SwaggerPetstore from 'swagger_petstore';
|
||||
import OpenApiPetstore from 'open_api_petstore';
|
||||
|
||||
let apiInstance = new SwaggerPetstore.StoreApi();
|
||||
|
||||
let body = new SwaggerPetstore.Order(); // Order | order placed for purchasing the pet
|
||||
|
||||
apiInstance.placeOrder(body).then((data) => {
|
||||
let apiInstance = new OpenApiPetstore.StoreApi();
|
||||
let order = new OpenApiPetstore.Order(); // Order | order placed for purchasing the pet
|
||||
apiInstance.placeOrder(order).then((data) => {
|
||||
console.log('API called successfully. Returned data: ' + data);
|
||||
}, (error) => {
|
||||
console.error(error);
|
||||
@@ -168,7 +160,7 @@ apiInstance.placeOrder(body).then((data) => {
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**Order**](Order.md)| order placed for purchasing the pet |
|
||||
**order** | [**Order**](Order.md)| order placed for purchasing the pet |
|
||||
|
||||
### Return type
|
||||
|
||||
|
||||
Reference in New Issue
Block a user