forked from loafle/openapi-generator-original
Add test cases to cover different collection formats (#3640)
* add test cases to cover different collection format * add space params to retrofit 1.x * add space params to retrofit 2.x * rename url to localVarUrl * fix exception in haskell servant
This commit is contained in:
@@ -746,4 +746,78 @@ export default class FakeApi {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* To test the collection format in query parameters
|
||||
* @param {Array.<String>} pipe
|
||||
* @param {Array.<String>} ioutil
|
||||
* @param {Array.<String>} http
|
||||
* @param {Array.<String>} url
|
||||
* @param {Array.<String>} context
|
||||
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
|
||||
*/
|
||||
testQueryParameterCollectionFormatWithHttpInfo(pipe, ioutil, http, url, context) {
|
||||
let postBody = null;
|
||||
// verify the required parameter 'pipe' is set
|
||||
if (pipe === undefined || pipe === null) {
|
||||
throw new Error("Missing the required parameter 'pipe' when calling testQueryParameterCollectionFormat");
|
||||
}
|
||||
// verify the required parameter 'ioutil' is set
|
||||
if (ioutil === undefined || ioutil === null) {
|
||||
throw new Error("Missing the required parameter 'ioutil' when calling testQueryParameterCollectionFormat");
|
||||
}
|
||||
// verify the required parameter 'http' is set
|
||||
if (http === undefined || http === null) {
|
||||
throw new Error("Missing the required parameter 'http' when calling testQueryParameterCollectionFormat");
|
||||
}
|
||||
// verify the required parameter 'url' is set
|
||||
if (url === undefined || url === null) {
|
||||
throw new Error("Missing the required parameter 'url' when calling testQueryParameterCollectionFormat");
|
||||
}
|
||||
// verify the required parameter 'context' is set
|
||||
if (context === undefined || context === null) {
|
||||
throw new Error("Missing the required parameter 'context' when calling testQueryParameterCollectionFormat");
|
||||
}
|
||||
|
||||
let pathParams = {
|
||||
};
|
||||
let queryParams = {
|
||||
'pipe': this.apiClient.buildCollectionParam(pipe, 'csv'),
|
||||
'ioutil': this.apiClient.buildCollectionParam(ioutil, 'csv'),
|
||||
'http': this.apiClient.buildCollectionParam(http, 'space'),
|
||||
'url': this.apiClient.buildCollectionParam(url, 'csv'),
|
||||
'context': this.apiClient.buildCollectionParam(context, 'multi')
|
||||
};
|
||||
let headerParams = {
|
||||
};
|
||||
let formParams = {
|
||||
};
|
||||
|
||||
let authNames = [];
|
||||
let contentTypes = [];
|
||||
let accepts = [];
|
||||
let returnType = null;
|
||||
return this.apiClient.callApi(
|
||||
'/fake/test-query-paramters', 'PUT',
|
||||
pathParams, queryParams, headerParams, formParams, postBody,
|
||||
authNames, contentTypes, accepts, returnType, null
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* To test the collection format in query parameters
|
||||
* @param {Array.<String>} pipe
|
||||
* @param {Array.<String>} ioutil
|
||||
* @param {Array.<String>} http
|
||||
* @param {Array.<String>} url
|
||||
* @param {Array.<String>} context
|
||||
* @return {Promise} a {@link https://www.promisejs.org/|Promise}
|
||||
*/
|
||||
testQueryParameterCollectionFormat(pipe, ioutil, http, url, context) {
|
||||
return this.testQueryParameterCollectionFormatWithHttpInfo(pipe, ioutil, http, url, context)
|
||||
.then(function(response_and_data) {
|
||||
return response_and_data.data;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user