forked from loafle/openapi-generator-original
Remove toJson method from JS client
Also regenerates the petstore samples.
This commit is contained in:
@@ -34,6 +34,11 @@
|
||||
* The default HTTP headers to be included for all API calls.
|
||||
*/
|
||||
this.defaultHeaders = {};
|
||||
|
||||
/**
|
||||
* The default HTTP timeout for all API calls.
|
||||
*/
|
||||
this.timeout = 60000;
|
||||
};
|
||||
|
||||
ApiClient.prototype.paramToString = function paramToString(param) {
|
||||
@@ -234,6 +239,9 @@
|
||||
// set header parameters
|
||||
request.set(this.defaultHeaders).set(this.normalizeParams(headerParams));
|
||||
|
||||
//set request timeout
|
||||
request.timeout(this.timeout);
|
||||
|
||||
var contentType = this.jsonPreferredMime(contentTypes);
|
||||
if (contentType) {
|
||||
request.type(contentType);
|
||||
|
||||
@@ -87,8 +87,8 @@
|
||||
|
||||
/**
|
||||
* Finds Pets by status
|
||||
* Multiple status values can be provided with comma seperated strings
|
||||
* @param {[String]} opts['status'] Status values that need to be considered for filter
|
||||
* Multiple status values can be provided with comma separated strings
|
||||
* @param {[String]} opts['status'] Status values that need to be considered for query
|
||||
* data is of type: [Pet]
|
||||
*/
|
||||
self.findPetsByStatus = function(opts) {
|
||||
@@ -321,12 +321,12 @@
|
||||
* @param {Integer} petId ID of pet that needs to be fetched
|
||||
* data is of type: 'String'
|
||||
*/
|
||||
self.getPetByIdWithByteArray = function(petId) {
|
||||
self.petPetIdtestingByteArraytrueGet = function(petId) {
|
||||
var postBody = null;
|
||||
|
||||
// verify the required parameter 'petId' is set
|
||||
if (petId == null) {
|
||||
throw "Missing the required parameter 'petId' when calling getPetByIdWithByteArray";
|
||||
throw "Missing the required parameter 'petId' when calling petPetIdtestingByteArraytrueGet";
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -21,6 +21,40 @@
|
||||
var self = this;
|
||||
|
||||
|
||||
/**
|
||||
* Finds orders by status
|
||||
* A single status value can be provided as a string
|
||||
* @param {String} opts['status'] Status value that needs to be considered for query
|
||||
* data is of type: [Order]
|
||||
*/
|
||||
self.findOrdersByStatus = function(opts) {
|
||||
opts = opts || {};
|
||||
var postBody = null;
|
||||
|
||||
|
||||
var pathParams = {
|
||||
};
|
||||
var queryParams = {
|
||||
'status': opts['status']
|
||||
};
|
||||
var headerParams = {
|
||||
};
|
||||
var formParams = {
|
||||
};
|
||||
|
||||
var authNames = ['test_api_client_id', 'test_api_client_secret'];
|
||||
var contentTypes = [];
|
||||
var accepts = ['application/json', 'application/xml'];
|
||||
var returnType = [Order];
|
||||
|
||||
return this.apiClient.callApi(
|
||||
'/store/findByStatus', 'GET',
|
||||
pathParams, queryParams, headerParams, formParams, postBody,
|
||||
authNames, contentTypes, accepts, returnType
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns pet inventories by status
|
||||
* Returns a map of status codes to quantities
|
||||
|
||||
@@ -69,10 +69,6 @@
|
||||
|
||||
|
||||
|
||||
Category.prototype.toJson = function() {
|
||||
return JSON.stringify(this);
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (module) {
|
||||
|
||||
@@ -143,10 +143,6 @@
|
||||
|
||||
|
||||
|
||||
Order.prototype.toJson = function() {
|
||||
return JSON.stringify(this);
|
||||
}
|
||||
|
||||
var StatusEnum = {
|
||||
|
||||
/**
|
||||
|
||||
@@ -153,10 +153,6 @@
|
||||
|
||||
|
||||
|
||||
Pet.prototype.toJson = function() {
|
||||
return JSON.stringify(this);
|
||||
}
|
||||
|
||||
var StatusEnum = {
|
||||
|
||||
/**
|
||||
|
||||
@@ -69,10 +69,6 @@
|
||||
|
||||
|
||||
|
||||
Tag.prototype.toJson = function() {
|
||||
return JSON.stringify(this);
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (module) {
|
||||
|
||||
@@ -179,10 +179,6 @@
|
||||
|
||||
|
||||
|
||||
User.prototype.toJson = function() {
|
||||
return JSON.stringify(this);
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (module) {
|
||||
|
||||
Reference in New Issue
Block a user