update JS petstore samples

This commit is contained in:
wing328
2017-10-20 22:16:41 +08:00
parent 649811d542
commit 36f14ab757
16 changed files with 419 additions and 0 deletions

View File

@@ -98,6 +98,10 @@
this.agent = new superagent.agent();
}
/*
* Allow user to override superagent agent
*/
this.requestAgent = null;
};
/**
@@ -406,6 +410,12 @@
// set header parameters
request.set(this.defaultHeaders).set(this.normalizeParams(headerParams));
// set requestAgent if it is set by user
if (this.requestAgent) {
request.agent(this.requestAgent);
}
// set request timeout
request.timeout(this.timeout);

View File

@@ -478,6 +478,58 @@
}
/**
* test inline additionalProperties
*
* @param {Object} param request body
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
*/
this.testInlineAdditionalPropertiesWithHttpInfo = function(param) {
var postBody = param;
// verify the required parameter 'param' is set
if (param === undefined || param === null) {
throw new Error("Missing the required parameter 'param' when calling testInlineAdditionalProperties");
}
var pathParams = {
};
var queryParams = {
};
var collectionQueryParams = {
};
var headerParams = {
};
var formParams = {
};
var authNames = [];
var contentTypes = ['application/json'];
var accepts = [];
var returnType = null;
return this.apiClient.callApi(
'/fake/inline-additionalProperties', 'POST',
pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType
);
}
/**
* test inline additionalProperties
*
* @param {Object} param request body
* @return {Promise} a {@link https://www.promisejs.org/|Promise}
*/
this.testInlineAdditionalProperties = function(param) {
return this.testInlineAdditionalPropertiesWithHttpInfo(param)
.then(function(response_and_data) {
return response_and_data.data;
});
}
/**
* test json serialization of form data
*