Add option modelPropertyNaming to javascript generator (#299)

* Add option modelPropertyNaming to javascript generator

Fixes 6530

* Update Petstore sample
This commit is contained in:
Stian Liknes
2018-06-14 13:19:23 +02:00
committed by William Cheng
parent 7126074f49
commit 24104dac35
334 changed files with 4646 additions and 2594 deletions

View File

@@ -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
var SwaggerPetstore = require('swagger_petstore');
var apiInstance = new SwaggerPetstore.StoreApi();
var OpenApiPetstore = require('open_api_petstore');
var apiInstance = new OpenApiPetstore.StoreApi();
var orderId = "orderId_example"; // String | ID of the order that needs to be deleted
apiInstance.deleteOrder(orderId).then(function() {
console.log('API called successfully.');
}, function(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**
> {&#39;String&#39;: &#39;Number&#39;} getInventory()
> {String: Number} getInventory()
Returns pet inventories by status
@@ -63,16 +61,15 @@ Returns a map of status codes to quantities
### Example
```javascript
var SwaggerPetstore = require('swagger_petstore');
var defaultClient = SwaggerPetstore.ApiClient.instance;
var OpenApiPetstore = require('open_api_petstore');
var defaultClient = OpenApiPetstore.ApiClient.instance;
// Configure API key authorization: api_key
var api_key = defaultClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';
var apiInstance = new SwaggerPetstore.StoreApi();
var apiInstance = new OpenApiPetstore.StoreApi();
apiInstance.getInventory().then(function(data) {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
@@ -86,7 +83,7 @@ This endpoint does not need any parameter.
### Return type
**{&#39;String&#39;: &#39;Number&#39;}**
**{String: Number}**
### Authorization
@@ -107,12 +104,10 @@ For valid response try integer IDs with value &lt;&#x3D; 5 or &gt; 10. Other val
### Example
```javascript
var SwaggerPetstore = require('swagger_petstore');
var apiInstance = new SwaggerPetstore.StoreApi();
var OpenApiPetstore = require('open_api_petstore');
var apiInstance = new OpenApiPetstore.StoreApi();
var orderId = 789; // Number | ID of pet that needs to be fetched
apiInstance.getOrderById(orderId).then(function(data) {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
@@ -142,21 +137,17 @@ No authorization required
<a name="placeOrder"></a>
# **placeOrder**
> Order placeOrder(body)
> Order placeOrder(order)
Place an order for a pet
### Example
```javascript
var SwaggerPetstore = require('swagger_petstore');
var OpenApiPetstore = require('open_api_petstore');
var apiInstance = new SwaggerPetstore.StoreApi();
var body = new SwaggerPetstore.Order(); // Order | order placed for purchasing the pet
apiInstance.placeOrder(body).then(function(data) {
var apiInstance = new OpenApiPetstore.StoreApi();
var order = new OpenApiPetstore.Order(); // Order | order placed for purchasing the pet
apiInstance.placeOrder(order).then(function(data) {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
@@ -168,7 +159,7 @@ apiInstance.placeOrder(body).then(function(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