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,12 +1,12 @@
/**
* Swagger Petstore
* OpenAPI Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*
*/
@@ -45,16 +45,15 @@ export default class PetApi {
/**
* Add a new pet to the store
*
* @param {module:model/Pet} body Pet object that needs to be added to the store
* @param {module:model/Pet} pet Pet object that needs to be added to the store
* @param {module:api/PetApi~addPetCallback} callback The callback function, accepting three arguments: error, data, response
*/
addPet(body, callback) {
let postBody = body;
addPet(pet, callback) {
let postBody = pet;
// verify the required parameter 'body' is set
if (body === undefined || body === null) {
throw new Error("Missing the required parameter 'body' when calling addPet");
// verify the required parameter 'pet' is set
if (pet === undefined || pet === null) {
throw new Error("Missing the required parameter 'pet' when calling addPet");
}
@@ -69,7 +68,7 @@ export default class PetApi {
let authNames = ['petstore_auth'];
let contentTypes = ['application/json', 'application/xml'];
let accepts = ['application/xml', 'application/json'];
let accepts = [];
let returnType = null;
return this.apiClient.callApi(
@@ -89,7 +88,6 @@ export default class PetApi {
/**
* Deletes a pet
*
* @param {Number} petId Pet id to delete
* @param {Object} opts Optional parameters
* @param {String} opts.apiKey
@@ -118,7 +116,7 @@ export default class PetApi {
let authNames = ['petstore_auth'];
let contentTypes = [];
let accepts = ['application/xml', 'application/json'];
let accepts = [];
let returnType = null;
return this.apiClient.callApi(
@@ -276,16 +274,15 @@ export default class PetApi {
/**
* Update an existing pet
*
* @param {module:model/Pet} body Pet object that needs to be added to the store
* @param {module:model/Pet} pet Pet object that needs to be added to the store
* @param {module:api/PetApi~updatePetCallback} callback The callback function, accepting three arguments: error, data, response
*/
updatePet(body, callback) {
let postBody = body;
updatePet(pet, callback) {
let postBody = pet;
// verify the required parameter 'body' is set
if (body === undefined || body === null) {
throw new Error("Missing the required parameter 'body' when calling updatePet");
// verify the required parameter 'pet' is set
if (pet === undefined || pet === null) {
throw new Error("Missing the required parameter 'pet' when calling updatePet");
}
@@ -300,7 +297,7 @@ export default class PetApi {
let authNames = ['petstore_auth'];
let contentTypes = ['application/json', 'application/xml'];
let accepts = ['application/xml', 'application/json'];
let accepts = [];
let returnType = null;
return this.apiClient.callApi(
@@ -320,7 +317,6 @@ export default class PetApi {
/**
* Updates a pet in the store with form data
*
* @param {Number} petId ID of pet that needs to be updated
* @param {Object} opts Optional parameters
* @param {String} opts.name Updated name of the pet
@@ -351,7 +347,7 @@ export default class PetApi {
let authNames = ['petstore_auth'];
let contentTypes = ['application/x-www-form-urlencoded'];
let accepts = ['application/xml', 'application/json'];
let accepts = [];
let returnType = null;
return this.apiClient.callApi(
@@ -371,7 +367,6 @@ export default class PetApi {
/**
* uploads an image
*
* @param {Number} petId ID of pet to update
* @param {Object} opts Optional parameters
* @param {String} opts.additionalMetadata Additional data to pass to server