mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-08 04:06:12 +00:00
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:
@@ -782,6 +782,97 @@
|
||||
return response_and_data.data;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
this.testQueryParameterCollectionFormatWithHttpInfo = function(pipe, ioutil, http, url, context) {
|
||||
var 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");
|
||||
}
|
||||
|
||||
var pathParams = {
|
||||
};
|
||||
var queryParams = {
|
||||
};
|
||||
var collectionQueryParams = {
|
||||
'pipe': {
|
||||
value: pipe,
|
||||
collectionFormat: 'csv'
|
||||
},
|
||||
'ioutil': {
|
||||
value: ioutil,
|
||||
collectionFormat: 'csv'
|
||||
},
|
||||
'http': {
|
||||
value: http,
|
||||
collectionFormat: 'space'
|
||||
},
|
||||
'url': {
|
||||
value: url,
|
||||
collectionFormat: 'csv'
|
||||
},
|
||||
'context': {
|
||||
value: context,
|
||||
collectionFormat: 'multi'
|
||||
},
|
||||
};
|
||||
var headerParams = {
|
||||
};
|
||||
var formParams = {
|
||||
};
|
||||
|
||||
var authNames = [];
|
||||
var contentTypes = [];
|
||||
var accepts = [];
|
||||
var returnType = null;
|
||||
return this.apiClient.callApi(
|
||||
'/fake/test-query-paramters', 'PUT',
|
||||
pathParams, queryParams, collectionQueryParams, 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}
|
||||
*/
|
||||
this.testQueryParameterCollectionFormat = function(pipe, ioutil, http, url, context) {
|
||||
return this.testQueryParameterCollectionFormatWithHttpInfo(pipe, ioutil, http, url, context)
|
||||
.then(function(response_and_data) {
|
||||
return response_and_data.data;
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
return exports;
|
||||
|
||||
Reference in New Issue
Block a user