Add OAS3 allowEmptyValue for query params (#10312)

* add the special case of empty query parameters to the fake API
This commit is contained in:
Peter Leibiger
2021-09-03 10:32:51 +02:00
committed by GitHub
parent 490c747c2b
commit a558554961
39 changed files with 288 additions and 89 deletions

View File

@@ -891,11 +891,12 @@ export default class FakeApi {
* @param {Array.<String>} http
* @param {Array.<String>} url
* @param {Array.<String>} context
* @param {String} allowEmpty
* @param {Object} opts Optional parameters
* @param {Object.<String, {String: String}>} opts.language
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
*/
testQueryParameterCollectionFormatWithHttpInfo(pipe, ioutil, http, url, context, opts) {
testQueryParameterCollectionFormatWithHttpInfo(pipe, ioutil, http, url, context, allowEmpty, opts) {
opts = opts || {};
let postBody = null;
// verify the required parameter 'pipe' is set
@@ -918,6 +919,10 @@ export default class FakeApi {
if (context === undefined || context === null) {
throw new Error("Missing the required parameter 'context' when calling testQueryParameterCollectionFormat");
}
// verify the required parameter 'allowEmpty' is set
if (allowEmpty === undefined || allowEmpty === null) {
throw new Error("Missing the required parameter 'allowEmpty' when calling testQueryParameterCollectionFormat");
}
let pathParams = {
};
@@ -927,7 +932,8 @@ export default class FakeApi {
'http': this.apiClient.buildCollectionParam(http, 'ssv'),
'url': this.apiClient.buildCollectionParam(url, 'csv'),
'context': this.apiClient.buildCollectionParam(context, 'multi'),
'language': opts['language']
'language': opts['language'],
'allowEmpty': allowEmpty
};
let headerParams = {
};
@@ -952,12 +958,13 @@ export default class FakeApi {
* @param {Array.<String>} http
* @param {Array.<String>} url
* @param {Array.<String>} context
* @param {String} allowEmpty
* @param {Object} opts Optional parameters
* @param {Object.<String, {String: String}>} opts.language
* @return {Promise} a {@link https://www.promisejs.org/|Promise}
*/
testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, opts) {
return this.testQueryParameterCollectionFormatWithHttpInfo(pipe, ioutil, http, url, context, opts)
testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, opts) {
return this.testQueryParameterCollectionFormatWithHttpInfo(pipe, ioutil, http, url, context, allowEmpty, opts)
.then(function(response_and_data) {
return response_and_data.data;
});