From a5585549614fa030133227ab21e805c89915aafe Mon Sep 17 00:00:00 2001 From: Peter Leibiger Date: Fri, 3 Sep 2021 10:32:51 +0200 Subject: [PATCH] Add OAS3 allowEmptyValue for query params (#10312) * add the special case of empty query parameters to the fake API --- .../codegen/CodegenParameter.java | 7 +++- .../openapitools/codegen/DefaultCodegen.java | 1 + ...ith-fake-endpoints-models-for-testing.yaml | 6 +++ .../csharp/OpenAPIClient/docs/FakeApi.md | 6 ++- .../src/Org.OpenAPITools/Api/FakeApi.cs | 36 ++++++++++++----- .../elixir/lib/openapi_petstore/api/fake.ex | 6 ++- .../petstore/java/feign/api/openapi.yaml | 8 ++++ .../org/openapitools/client/api/FakeApi.java | 12 ++++-- .../petstore/java/webclient/api/openapi.yaml | 8 ++++ .../petstore/java/webclient/docs/FakeApi.md | 6 ++- .../org/openapitools/client/api/FakeApi.java | 17 +++++--- .../petstore/javascript-es6/docs/FakeApi.md | 6 ++- .../javascript-es6/src/api/FakeApi.js | 10 ++++- .../javascript-promise-es6/docs/FakeApi.md | 6 ++- .../javascript-promise-es6/src/api/FakeApi.js | 15 +++++-- samples/client/petstore/perl/docs/FakeApi.md | 6 ++- .../perl/lib/WWW/OpenAPIClient/FakeApi.pm | 16 ++++++++ .../php/OpenAPIClient-php/docs/Api/FakeApi.md | 6 ++- .../php/OpenAPIClient-php/lib/Api/FakeApi.php | 40 ++++++++++++++----- .../petstore/ruby-faraday/docs/FakeApi.md | 10 +++-- .../ruby-faraday/lib/petstore/api/fake_api.rb | 13 ++++-- samples/client/petstore/ruby/docs/FakeApi.md | 10 +++-- .../ruby/lib/petstore/api/fake_api.rb | 13 ++++-- .../builds/default-v3.0/apis/FakeApi.ts | 9 +++++ .../petstore_client_lib_fake/doc/FakeApi.md | 6 ++- .../lib/src/api/fake_api.dart | 3 ++ .../petstore_client_lib_fake/doc/FakeApi.md | 6 ++- .../lib/api/fake_api.dart | 4 +- .../petstore_client_lib_fake/doc/FakeApi.md | 6 ++- .../lib/api/fake_api.dart | 14 +++++-- .../doc/FakeApi.md | 6 ++- .../lib/api/fake_api.dart | 14 +++++-- .../petstore/python-legacy/docs/FakeApi.md | 6 ++- .../petstore_api/api/fake_api.py | 21 +++++++--- .../java/org/openapitools/api/FakeApi.java | 4 +- .../org/openapitools/api/FakeApiService.java | 2 +- .../api/impl/FakeApiServiceImpl.java | 2 +- .../app/Http/Controllers/FakeController.php | 5 +++ .../lib/app/Http/Controllers/FakeApi.php | 5 +++ 39 files changed, 288 insertions(+), 89 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenParameter.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenParameter.java index 8f512e4cec7c..6c0aaf869daf 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenParameter.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenParameter.java @@ -27,7 +27,7 @@ import java.util.*; public class CodegenParameter implements IJsonSchemaValidationProperties { public boolean isFormParam, isQueryParam, isPathParam, isHeaderParam, isCookieParam, isBodyParam, isContainer, - isCollectionFormatMulti, isPrimitiveType, isModel, isExplode, isDeepObject; + isCollectionFormatMulti, isPrimitiveType, isModel, isExplode, isDeepObject, isAllowEmptyValue; public String baseName, paramName, dataType, datatypeWithEnum, dataFormat, contentType, collectionFormat, description, unescapedDescription, baseType, defaultValue, enumName, style; @@ -208,6 +208,7 @@ public class CodegenParameter implements IJsonSchemaValidationProperties { output.isExplode = this.isExplode; output.style = this.style; output.isDeepObject = this.isDeepObject; + output.isAllowEmptyValue = this.isAllowEmptyValue; output.contentType = this.contentType; return output; @@ -215,7 +216,7 @@ public class CodegenParameter implements IJsonSchemaValidationProperties { @Override public int hashCode() { - return Objects.hash(isFormParam, isQueryParam, isPathParam, isHeaderParam, isCookieParam, isBodyParam, isContainer, isCollectionFormatMulti, isPrimitiveType, isModel, isExplode, baseName, paramName, dataType, datatypeWithEnum, dataFormat, collectionFormat, description, unescapedDescription, baseType, defaultValue, enumName, style, isDeepObject, example, jsonSchema, isString, isNumeric, isInteger, isLong, isNumber, isFloat, isDouble, isDecimal, isByteArray, isBinary, isBoolean, isDate, isDateTime, isUuid, isUri, isEmail, isFreeFormObject, isAnyType, isArray, isMap, isFile, isEnum, _enum, allowableValues, items, mostInnerItems, additionalProperties, vars, requiredVars, vendorExtensions, hasValidation, getMaxProperties(), getMinProperties(), isNullable, isDeprecated, required, getMaximum(), getExclusiveMaximum(), getMinimum(), getExclusiveMinimum(), getMaxLength(), getMinLength(), getPattern(), getMaxItems(), getMinItems(), getUniqueItems(), contentType, multipleOf, isNull, additionalPropertiesIsAnyType, hasVars, hasRequired, isShort, isUnboundedInteger, hasDiscriminatorWithNonEmptyMapping); + return Objects.hash(isFormParam, isQueryParam, isPathParam, isHeaderParam, isCookieParam, isBodyParam, isContainer, isCollectionFormatMulti, isPrimitiveType, isModel, isExplode, baseName, paramName, dataType, datatypeWithEnum, dataFormat, collectionFormat, description, unescapedDescription, baseType, defaultValue, enumName, style, isDeepObject, isAllowEmptyValue, example, jsonSchema, isString, isNumeric, isInteger, isLong, isNumber, isFloat, isDouble, isDecimal, isByteArray, isBinary, isBoolean, isDate, isDateTime, isUuid, isUri, isEmail, isFreeFormObject, isAnyType, isArray, isMap, isFile, isEnum, _enum, allowableValues, items, mostInnerItems, additionalProperties, vars, requiredVars, vendorExtensions, hasValidation, getMaxProperties(), getMinProperties(), isNullable, isDeprecated, required, getMaximum(), getExclusiveMaximum(), getMinimum(), getExclusiveMinimum(), getMaxLength(), getMinLength(), getPattern(), getMaxItems(), getMinItems(), getUniqueItems(), contentType, multipleOf, isNull, additionalPropertiesIsAnyType, hasVars, hasRequired, isShort, isUnboundedInteger, hasDiscriminatorWithNonEmptyMapping); } @Override @@ -283,6 +284,7 @@ public class CodegenParameter implements IJsonSchemaValidationProperties { Objects.equals(enumName, that.enumName) && Objects.equals(style, that.style) && Objects.equals(isDeepObject, that.isDeepObject) && + Objects.equals(isAllowEmptyValue, that.isAllowEmptyValue) && Objects.equals(example, that.example) && Objects.equals(jsonSchema, that.jsonSchema) && Objects.equals(_enum, that._enum) && @@ -333,6 +335,7 @@ public class CodegenParameter implements IJsonSchemaValidationProperties { sb.append(", enumName='").append(enumName).append('\''); sb.append(", style='").append(style).append('\''); sb.append(", deepObject='").append(isDeepObject).append('\''); + sb.append(", allowEmptyValue='").append(isAllowEmptyValue).append('\''); sb.append(", example='").append(example).append('\''); sb.append(", jsonSchema='").append(jsonSchema).append('\''); sb.append(", isString=").append(isString); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java index 3bfcebaac1c5..53154f1af804 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java @@ -4547,6 +4547,7 @@ public class DefaultCodegen implements CodegenConfig { if (parameter instanceof QueryParameter || "query".equalsIgnoreCase(parameter.getIn())) { codegenParameter.isQueryParam = true; + codegenParameter.isAllowEmptyValue = parameter.getAllowEmptyValue() != null && parameter.getAllowEmptyValue(); } else if (parameter instanceof PathParameter || "path".equalsIgnoreCase(parameter.getIn())) { codegenParameter.required = true; codegenParameter.isPathParam = true; diff --git a/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml b/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml index 941db12d9ab5..80e6ff8e9de4 100644 --- a/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml @@ -1097,6 +1097,12 @@ paths: additionalProperties: type: string format: string + - name: allowEmpty + in: query + required: true + allowEmptyValue: true + schema: + type: string responses: "200": description: Success diff --git a/samples/client/petstore/csharp/OpenAPIClient/docs/FakeApi.md b/samples/client/petstore/csharp/OpenAPIClient/docs/FakeApi.md index 941db457ba77..f138a6abd27a 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/docs/FakeApi.md +++ b/samples/client/petstore/csharp/OpenAPIClient/docs/FakeApi.md @@ -1279,7 +1279,7 @@ No authorization required ## TestQueryParameterCollectionFormat -> void TestQueryParameterCollectionFormat (List pipe, List ioutil, List http, List url, List context, Dictionary language = null) +> void TestQueryParameterCollectionFormat (List pipe, List ioutil, List http, List url, List context, string allowEmpty, Dictionary language = null) @@ -1307,11 +1307,12 @@ namespace Example var http = new List(); // List | var url = new List(); // List | var context = new List(); // List | + var allowEmpty = allowEmpty_example; // string | var language = new Dictionary(); // Dictionary | (optional) try { - apiInstance.TestQueryParameterCollectionFormat(pipe, ioutil, http, url, context, language); + apiInstance.TestQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, language); } catch (ApiException e) { @@ -1334,6 +1335,7 @@ Name | Type | Description | Notes **http** | [**List<string>**](string.md)| | **url** | [**List<string>**](string.md)| | **context** | [**List<string>**](string.md)| | + **allowEmpty** | **string**| | **language** | [**Dictionary<string, string>**](string.md)| | [optional] ### Return type diff --git a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs index 8053bdf6b56f..a5ee50030153 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs @@ -429,9 +429,10 @@ namespace Org.OpenAPITools.Api /// /// /// + /// /// (optional) /// - void TestQueryParameterCollectionFormat (List pipe, List ioutil, List http, List url, List context, Dictionary language = default(Dictionary)); + void TestQueryParameterCollectionFormat (List pipe, List ioutil, List http, List url, List context, string allowEmpty, Dictionary language = default(Dictionary)); /// /// @@ -445,9 +446,10 @@ namespace Org.OpenAPITools.Api /// /// /// + /// /// (optional) /// ApiResponse of Object(void) - ApiResponse TestQueryParameterCollectionFormatWithHttpInfo (List pipe, List ioutil, List http, List url, List context, Dictionary language = default(Dictionary)); + ApiResponse TestQueryParameterCollectionFormatWithHttpInfo (List pipe, List ioutil, List http, List url, List context, string allowEmpty, Dictionary language = default(Dictionary)); #endregion Synchronous Operations #region Asynchronous Operations /// @@ -886,10 +888,11 @@ namespace Org.OpenAPITools.Api /// /// /// + /// /// (optional) /// Cancellation Token to cancel request (optional) /// Task of void - System.Threading.Tasks.Task TestQueryParameterCollectionFormatAsync (List pipe, List ioutil, List http, List url, List context, Dictionary language = default(Dictionary), CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task TestQueryParameterCollectionFormatAsync (List pipe, List ioutil, List http, List url, List context, string allowEmpty, Dictionary language = default(Dictionary), CancellationToken cancellationToken = default(CancellationToken)); /// /// @@ -903,10 +906,11 @@ namespace Org.OpenAPITools.Api /// /// /// + /// /// (optional) /// Cancellation Token to cancel request (optional) /// Task of ApiResponse - System.Threading.Tasks.Task> TestQueryParameterCollectionFormatWithHttpInfoAsync (List pipe, List ioutil, List http, List url, List context, Dictionary language = default(Dictionary), CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> TestQueryParameterCollectionFormatWithHttpInfoAsync (List pipe, List ioutil, List http, List url, List context, string allowEmpty, Dictionary language = default(Dictionary), CancellationToken cancellationToken = default(CancellationToken)); #endregion Asynchronous Operations } @@ -3535,11 +3539,12 @@ namespace Org.OpenAPITools.Api /// /// /// + /// /// (optional) /// - public void TestQueryParameterCollectionFormat (List pipe, List ioutil, List http, List url, List context, Dictionary language = default(Dictionary)) + public void TestQueryParameterCollectionFormat (List pipe, List ioutil, List http, List url, List context, string allowEmpty, Dictionary language = default(Dictionary)) { - TestQueryParameterCollectionFormatWithHttpInfo(pipe, ioutil, http, url, context, language); + TestQueryParameterCollectionFormatWithHttpInfo(pipe, ioutil, http, url, context, allowEmpty, language); } /// @@ -3551,9 +3556,10 @@ namespace Org.OpenAPITools.Api /// /// /// + /// /// (optional) /// ApiResponse of Object(void) - public ApiResponse TestQueryParameterCollectionFormatWithHttpInfo (List pipe, List ioutil, List http, List url, List context, Dictionary language = default(Dictionary)) + public ApiResponse TestQueryParameterCollectionFormatWithHttpInfo (List pipe, List ioutil, List http, List url, List context, string allowEmpty, Dictionary language = default(Dictionary)) { // verify the required parameter 'pipe' is set if (pipe == null) @@ -3570,6 +3576,9 @@ namespace Org.OpenAPITools.Api // verify the required parameter 'context' is set if (context == null) throw new ApiException(400, "Missing required parameter 'context' when calling FakeApi->TestQueryParameterCollectionFormat"); + // verify the required parameter 'allowEmpty' is set + if (allowEmpty == null) + throw new ApiException(400, "Missing required parameter 'allowEmpty' when calling FakeApi->TestQueryParameterCollectionFormat"); var localVarPath = "/fake/test-query-parameters"; var localVarPathParams = new Dictionary(); @@ -3597,6 +3606,7 @@ namespace Org.OpenAPITools.Api if (url != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "url", url)); // query parameter if (context != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("multi", "context", context)); // query parameter if (language != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "language", language)); // query parameter + if (allowEmpty != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "allowEmpty", allowEmpty)); // query parameter // make the HTTP request @@ -3626,12 +3636,13 @@ namespace Org.OpenAPITools.Api /// /// /// + /// /// (optional) /// Cancellation Token to cancel request (optional) /// Task of void - public async System.Threading.Tasks.Task TestQueryParameterCollectionFormatAsync (List pipe, List ioutil, List http, List url, List context, Dictionary language = default(Dictionary), CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task TestQueryParameterCollectionFormatAsync (List pipe, List ioutil, List http, List url, List context, string allowEmpty, Dictionary language = default(Dictionary), CancellationToken cancellationToken = default(CancellationToken)) { - await TestQueryParameterCollectionFormatWithHttpInfoAsync(pipe, ioutil, http, url, context, language, cancellationToken); + await TestQueryParameterCollectionFormatWithHttpInfoAsync(pipe, ioutil, http, url, context, allowEmpty, language, cancellationToken); } @@ -3644,10 +3655,11 @@ namespace Org.OpenAPITools.Api /// /// /// + /// /// (optional) /// Cancellation Token to cancel request (optional) /// Task of ApiResponse - public async System.Threading.Tasks.Task> TestQueryParameterCollectionFormatWithHttpInfoAsync (List pipe, List ioutil, List http, List url, List context, Dictionary language = default(Dictionary), CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> TestQueryParameterCollectionFormatWithHttpInfoAsync (List pipe, List ioutil, List http, List url, List context, string allowEmpty, Dictionary language = default(Dictionary), CancellationToken cancellationToken = default(CancellationToken)) { // verify the required parameter 'pipe' is set if (pipe == null) @@ -3664,6 +3676,9 @@ namespace Org.OpenAPITools.Api // verify the required parameter 'context' is set if (context == null) throw new ApiException(400, "Missing required parameter 'context' when calling FakeApi->TestQueryParameterCollectionFormat"); + // verify the required parameter 'allowEmpty' is set + if (allowEmpty == null) + throw new ApiException(400, "Missing required parameter 'allowEmpty' when calling FakeApi->TestQueryParameterCollectionFormat"); var localVarPath = "/fake/test-query-parameters"; var localVarPathParams = new Dictionary(); @@ -3691,6 +3706,7 @@ namespace Org.OpenAPITools.Api if (url != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "url", url)); // query parameter if (context != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("multi", "context", context)); // query parameter if (language != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "language", language)); // query parameter + if (allowEmpty != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "allowEmpty", allowEmpty)); // query parameter // make the HTTP request diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/api/fake.ex b/samples/client/petstore/elixir/lib/openapi_petstore/api/fake.ex index 428b2261e8af..8962b3b94392 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/api/fake.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/api/fake.ex @@ -527,6 +527,7 @@ defmodule OpenapiPetstore.Api.Fake do - http ([String.t]): - url ([String.t]): - context ([String.t]): + - allow_empty (String.t): - opts (KeywordList): [optional] Optional parameters - :language (%{optional(String.t) => String.t}): ## Returns @@ -534,8 +535,8 @@ defmodule OpenapiPetstore.Api.Fake do {:ok, nil} on success {:error, Tesla.Env.t} on failure """ - @spec test_query_parameter_collection_format(Tesla.Env.client, list(String.t), list(String.t), list(String.t), list(String.t), list(String.t), keyword()) :: {:ok, nil} | {:error, Tesla.Env.t} - def test_query_parameter_collection_format(connection, pipe, ioutil, http, url, context, opts \\ []) do + @spec test_query_parameter_collection_format(Tesla.Env.client, list(String.t), list(String.t), list(String.t), list(String.t), list(String.t), String.t, keyword()) :: {:ok, nil} | {:error, Tesla.Env.t} + def test_query_parameter_collection_format(connection, pipe, ioutil, http, url, context, allow_empty, opts \\ []) do optional_params = %{ :"language" => :query } @@ -547,6 +548,7 @@ defmodule OpenapiPetstore.Api.Fake do |> add_param(:query, :"http", http) |> add_param(:query, :"url", url) |> add_param(:query, :"context", context) + |> add_param(:query, :"allowEmpty", allow_empty) |> add_optional_params(optional_params, opts) |> ensure_body() |> Enum.into([]) diff --git a/samples/client/petstore/java/feign/api/openapi.yaml b/samples/client/petstore/java/feign/api/openapi.yaml index d40c88329eb2..69355993fb18 100644 --- a/samples/client/petstore/java/feign/api/openapi.yaml +++ b/samples/client/petstore/java/feign/api/openapi.yaml @@ -1232,6 +1232,14 @@ paths: type: string type: object style: form + - allowEmptyValue: true + explode: true + in: query + name: allowEmpty + required: true + schema: + type: string + style: form responses: "200": description: Success diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/api/FakeApi.java index 2980e7a00503..85ef53e36952 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/api/FakeApi.java @@ -438,13 +438,14 @@ public interface FakeApi extends ApiClient.Api { * @param http (required) * @param url (required) * @param context (required) + * @param allowEmpty (required) * @param language (optional) */ - @RequestLine("PUT /fake/test-query-parameters?pipe={pipe}&ioutil={ioutil}&http={http}&url={url}&context={context}&language={language}") + @RequestLine("PUT /fake/test-query-parameters?pipe={pipe}&ioutil={ioutil}&http={http}&url={url}&context={context}&language={language}&allowEmpty={allowEmpty}") @Headers({ "Accept: application/json", }) - void testQueryParameterCollectionFormat(@Param("pipe") List pipe, @Param("ioutil") List ioutil, @Param("http") List http, @Param("url") List url, @Param("context") List context, @Param("language") Map language); + void testQueryParameterCollectionFormat(@Param("pipe") List pipe, @Param("ioutil") List ioutil, @Param("http") List http, @Param("url") List url, @Param("context") List context, @Param("allowEmpty") String allowEmpty, @Param("language") Map language); /** * @@ -463,9 +464,10 @@ public interface FakeApi extends ApiClient.Api { *
  • url - (required)
  • *
  • context - (required)
  • *
  • language - (optional)
  • + *
  • allowEmpty - (required)
  • * */ - @RequestLine("PUT /fake/test-query-parameters?pipe={pipe}&ioutil={ioutil}&http={http}&url={url}&context={context}&language={language}") + @RequestLine("PUT /fake/test-query-parameters?pipe={pipe}&ioutil={ioutil}&http={http}&url={url}&context={context}&language={language}&allowEmpty={allowEmpty}") @Headers({ "Accept: application/json", }) @@ -500,5 +502,9 @@ public interface FakeApi extends ApiClient.Api { put("language", EncodingUtils.encode(value)); return this; } + public TestQueryParameterCollectionFormatQueryParams allowEmpty(final String value) { + put("allowEmpty", EncodingUtils.encode(value)); + return this; + } } } diff --git a/samples/client/petstore/java/webclient/api/openapi.yaml b/samples/client/petstore/java/webclient/api/openapi.yaml index d40c88329eb2..69355993fb18 100644 --- a/samples/client/petstore/java/webclient/api/openapi.yaml +++ b/samples/client/petstore/java/webclient/api/openapi.yaml @@ -1232,6 +1232,14 @@ paths: type: string type: object style: form + - allowEmptyValue: true + explode: true + in: query + name: allowEmpty + required: true + schema: + type: string + style: form responses: "200": description: Success diff --git a/samples/client/petstore/java/webclient/docs/FakeApi.md b/samples/client/petstore/java/webclient/docs/FakeApi.md index b4c92eb6a9cc..c3ed83515d13 100644 --- a/samples/client/petstore/java/webclient/docs/FakeApi.md +++ b/samples/client/petstore/java/webclient/docs/FakeApi.md @@ -1132,7 +1132,7 @@ No authorization required ## testQueryParameterCollectionFormat -> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, language) +> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, language) @@ -1159,9 +1159,10 @@ public class Example { List http = Arrays.asList(); // List | List url = Arrays.asList(); // List | List context = Arrays.asList(); // List | + String allowEmpty = "allowEmpty_example"; // String | Map language = new HashMap(); // Map | try { - apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, language); + apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, language); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testQueryParameterCollectionFormat"); System.err.println("Status code: " + e.getCode()); @@ -1183,6 +1184,7 @@ Name | Type | Description | Notes **http** | [**List<String>**](String.md)| | **url** | [**List<String>**](String.md)| | **context** | [**List<String>**](String.md)| | + **allowEmpty** | **String**| | **language** | [**Map<String, String>**](String.md)| | [optional] ### Return type diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/FakeApi.java index 87e7eba7d68f..fdaa53623ef4 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/FakeApi.java @@ -1016,10 +1016,11 @@ public class FakeApi { * @param http The http parameter * @param url The url parameter * @param context The context parameter + * @param allowEmpty The allowEmpty parameter * @param language The language parameter * @throws WebClientResponseException if an error occurs while attempting to invoke the API */ - private ResponseSpec testQueryParameterCollectionFormatRequestCreation(List pipe, List ioutil, List http, List url, List context, Map language) throws WebClientResponseException { + private ResponseSpec testQueryParameterCollectionFormatRequestCreation(List pipe, List ioutil, List http, List url, List context, String allowEmpty, Map language) throws WebClientResponseException { Object postBody = null; // verify the required parameter 'pipe' is set if (pipe == null) { @@ -1041,6 +1042,10 @@ public class FakeApi { if (context == null) { throw new WebClientResponseException("Missing the required parameter 'context' when calling testQueryParameterCollectionFormat", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); } + // verify the required parameter 'allowEmpty' is set + if (allowEmpty == null) { + throw new WebClientResponseException("Missing the required parameter 'allowEmpty' when calling testQueryParameterCollectionFormat", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); + } // create path and map variables final Map pathParams = new HashMap(); @@ -1055,6 +1060,7 @@ public class FakeApi { queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "url", url)); queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("multi".toUpperCase(Locale.ROOT)), "context", context)); queryParams.putAll(apiClient.parameterToMultiValueMap(null, "language", language)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "allowEmpty", allowEmpty)); final String[] localVarAccepts = { }; final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); @@ -1076,16 +1082,17 @@ public class FakeApi { * @param http The http parameter * @param url The url parameter * @param context The context parameter + * @param allowEmpty The allowEmpty parameter * @param language The language parameter * @throws WebClientResponseException if an error occurs while attempting to invoke the API */ - public Mono testQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context, Map language) throws WebClientResponseException { + public Mono testQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context, String allowEmpty, Map language) throws WebClientResponseException { ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; - return testQueryParameterCollectionFormatRequestCreation(pipe, ioutil, http, url, context, language).bodyToMono(localVarReturnType); + return testQueryParameterCollectionFormatRequestCreation(pipe, ioutil, http, url, context, allowEmpty, language).bodyToMono(localVarReturnType); } - public Mono> testQueryParameterCollectionFormatWithHttpInfo(List pipe, List ioutil, List http, List url, List context, Map language) throws WebClientResponseException { + public Mono> testQueryParameterCollectionFormatWithHttpInfo(List pipe, List ioutil, List http, List url, List context, String allowEmpty, Map language) throws WebClientResponseException { ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; - return testQueryParameterCollectionFormatRequestCreation(pipe, ioutil, http, url, context, language).toEntity(localVarReturnType); + return testQueryParameterCollectionFormatRequestCreation(pipe, ioutil, http, url, context, allowEmpty, language).toEntity(localVarReturnType); } } diff --git a/samples/client/petstore/javascript-es6/docs/FakeApi.md b/samples/client/petstore/javascript-es6/docs/FakeApi.md index 487be0a01566..aa1af642c66b 100644 --- a/samples/client/petstore/javascript-es6/docs/FakeApi.md +++ b/samples/client/petstore/javascript-es6/docs/FakeApi.md @@ -816,7 +816,7 @@ No authorization required ## testQueryParameterCollectionFormat -> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, opts) +> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, opts) @@ -833,10 +833,11 @@ let ioutil = ["null"]; // [String] | let http = ["null"]; // [String] | let url = ["null"]; // [String] | let context = ["null"]; // [String] | +let allowEmpty = "allowEmpty_example"; // String | let opts = { 'language': {key: "null"} // {String: String} | }; -apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, opts, (error, data, response) => { +apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, opts, (error, data, response) => { if (error) { console.error(error); } else { @@ -855,6 +856,7 @@ Name | Type | Description | Notes **http** | [**[String]**](String.md)| | **url** | [**[String]**](String.md)| | **context** | [**[String]**](String.md)| | + **allowEmpty** | **String**| | **language** | [**{String: String}**](String.md)| | [optional] ### Return type diff --git a/samples/client/petstore/javascript-es6/src/api/FakeApi.js b/samples/client/petstore/javascript-es6/src/api/FakeApi.js index aad7170733fb..521fa3347d0d 100644 --- a/samples/client/petstore/javascript-es6/src/api/FakeApi.js +++ b/samples/client/petstore/javascript-es6/src/api/FakeApi.js @@ -786,11 +786,12 @@ export default class FakeApi { * @param {Array.} http * @param {Array.} url * @param {Array.} context + * @param {String} allowEmpty * @param {Object} opts Optional parameters * @param {Object.} opts.language * @param {module:api/FakeApi~testQueryParameterCollectionFormatCallback} callback The callback function, accepting three arguments: error, data, response */ - testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, opts, callback) { + testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, opts, callback) { opts = opts || {}; let postBody = null; // verify the required parameter 'pipe' is set @@ -813,6 +814,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 = { }; @@ -822,7 +827,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 = { }; diff --git a/samples/client/petstore/javascript-promise-es6/docs/FakeApi.md b/samples/client/petstore/javascript-promise-es6/docs/FakeApi.md index 32b076e660f7..ed68b81f16e7 100644 --- a/samples/client/petstore/javascript-promise-es6/docs/FakeApi.md +++ b/samples/client/petstore/javascript-promise-es6/docs/FakeApi.md @@ -800,7 +800,7 @@ No authorization required ## testQueryParameterCollectionFormat -> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, opts) +> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, opts) @@ -817,10 +817,11 @@ let ioutil = ["null"]; // [String] | let http = ["null"]; // [String] | let url = ["null"]; // [String] | let context = ["null"]; // [String] | +let allowEmpty = "allowEmpty_example"; // String | let opts = { 'language': {key: "null"} // {String: String} | }; -apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, opts).then(() => { +apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, opts).then(() => { console.log('API called successfully.'); }, (error) => { console.error(error); @@ -838,6 +839,7 @@ Name | Type | Description | Notes **http** | [**[String]**](String.md)| | **url** | [**[String]**](String.md)| | **context** | [**[String]**](String.md)| | + **allowEmpty** | **String**| | **language** | [**{String: String}**](String.md)| | [optional] ### Return type diff --git a/samples/client/petstore/javascript-promise-es6/src/api/FakeApi.js b/samples/client/petstore/javascript-promise-es6/src/api/FakeApi.js index 465ce674147b..fe69d0176d61 100644 --- a/samples/client/petstore/javascript-promise-es6/src/api/FakeApi.js +++ b/samples/client/petstore/javascript-promise-es6/src/api/FakeApi.js @@ -891,11 +891,12 @@ export default class FakeApi { * @param {Array.} http * @param {Array.} url * @param {Array.} context + * @param {String} allowEmpty * @param {Object} opts Optional parameters * @param {Object.} 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.} http * @param {Array.} url * @param {Array.} context + * @param {String} allowEmpty * @param {Object} opts Optional parameters * @param {Object.} 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; }); diff --git a/samples/client/petstore/perl/docs/FakeApi.md b/samples/client/petstore/perl/docs/FakeApi.md index b02655e1310f..599921ab22d2 100644 --- a/samples/client/petstore/perl/docs/FakeApi.md +++ b/samples/client/petstore/perl/docs/FakeApi.md @@ -813,7 +813,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **test_query_parameter_collection_format** -> test_query_parameter_collection_format(pipe => $pipe, ioutil => $ioutil, http => $http, url => $url, context => $context, language => $language) +> test_query_parameter_collection_format(pipe => $pipe, ioutil => $ioutil, http => $http, url => $url, context => $context, allow_empty => $allow_empty, language => $language) @@ -831,10 +831,11 @@ my $ioutil = [("null")]; # ARRAY[string] | my $http = [("null")]; # ARRAY[string] | my $url = [("null")]; # ARRAY[string] | my $context = [("null")]; # ARRAY[string] | +my $allow_empty = "allow_empty_example"; # string | my $language = ('key' => "null"}; # HASH[string,string] | eval { - $api_instance->test_query_parameter_collection_format(pipe => $pipe, ioutil => $ioutil, http => $http, url => $url, context => $context, language => $language); + $api_instance->test_query_parameter_collection_format(pipe => $pipe, ioutil => $ioutil, http => $http, url => $url, context => $context, allow_empty => $allow_empty, language => $language); }; if ($@) { warn "Exception when calling FakeApi->test_query_parameter_collection_format: $@\n"; @@ -850,6 +851,7 @@ Name | Type | Description | Notes **http** | [**ARRAY[string]**](string.md)| | **url** | [**ARRAY[string]**](string.md)| | **context** | [**ARRAY[string]**](string.md)| | + **allow_empty** | **string**| | **language** | [**HASH[string,string]**](string.md)| | [optional] ### Return type diff --git a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/FakeApi.pm b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/FakeApi.pm index 2aee9f3d800b..f13af8a695a9 100644 --- a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/FakeApi.pm +++ b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/FakeApi.pm @@ -1371,6 +1371,7 @@ sub test_json_form_data { # @param ARRAY[string] $http (required) # @param ARRAY[string] $url (required) # @param ARRAY[string] $context (required) +# @param string $allow_empty (required) # @param HASH[string,string] $language (optional) { my $params = { @@ -1399,6 +1400,11 @@ sub test_json_form_data { description => '', required => '1', }, + 'allow_empty' => { + data_type => 'string', + description => '', + required => '1', + }, 'language' => { data_type => 'HASH[string,string]', description => '', @@ -1441,6 +1447,11 @@ sub test_query_parameter_collection_format { croak("Missing the required parameter 'context' when calling test_query_parameter_collection_format"); } + # verify the required parameter 'allow_empty' is set + unless (exists $args{'allow_empty'}) { + croak("Missing the required parameter 'allow_empty' when calling test_query_parameter_collection_format"); + } + # parse inputs my $_resource_path = '/fake/test-query-parameters'; @@ -1486,6 +1497,11 @@ sub test_query_parameter_collection_format { $query_params->{'language'} = $self->{api_client}->to_query_value($args{'language'}); } + # query params + if ( exists $args{'allow_empty'}) { + $query_params->{'allowEmpty'} = $self->{api_client}->to_query_value($args{'allow_empty'}); + } + my $_body_data; # authentication setting, if any my $auth_settings = [qw()]; diff --git a/samples/client/petstore/php/OpenAPIClient-php/docs/Api/FakeApi.md b/samples/client/petstore/php/OpenAPIClient-php/docs/Api/FakeApi.md index f0eeb5f60a8d..840d51e06786 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/docs/Api/FakeApi.md +++ b/samples/client/petstore/php/OpenAPIClient-php/docs/Api/FakeApi.md @@ -972,7 +972,7 @@ No authorization required ## `testQueryParameterCollectionFormat()` ```php -testQueryParameterCollectionFormat($pipe, $ioutil, $http, $url, $context, $language) +testQueryParameterCollectionFormat($pipe, $ioutil, $http, $url, $context, $allow_empty, $language) ``` @@ -997,10 +997,11 @@ $ioutil = array('ioutil_example'); // string[] $http = array('http_example'); // string[] $url = array('url_example'); // string[] $context = array('context_example'); // string[] +$allow_empty = 'allow_empty_example'; // string $language = array('key' => 'language_example'); // array try { - $apiInstance->testQueryParameterCollectionFormat($pipe, $ioutil, $http, $url, $context, $language); + $apiInstance->testQueryParameterCollectionFormat($pipe, $ioutil, $http, $url, $context, $allow_empty, $language); } catch (Exception $e) { echo 'Exception when calling FakeApi->testQueryParameterCollectionFormat: ', $e->getMessage(), PHP_EOL; } @@ -1015,6 +1016,7 @@ Name | Type | Description | Notes **http** | [**string[]**](../Model/string.md)| | **url** | [**string[]**](../Model/string.md)| | **context** | [**string[]**](../Model/string.md)| | + **allow_empty** | **string**| | **language** | [**array**](../Model/string.md)| | [optional] ### Return type diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php index a221e69d85d1..a4996ace4185 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php @@ -4247,15 +4247,16 @@ class FakeApi * @param string[] $http http (required) * @param string[] $url url (required) * @param string[] $context context (required) + * @param string $allow_empty allow_empty (required) * @param array $language language (optional) * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void */ - public function testQueryParameterCollectionFormat($pipe, $ioutil, $http, $url, $context, $language = null) + public function testQueryParameterCollectionFormat($pipe, $ioutil, $http, $url, $context, $allow_empty, $language = null) { - $this->testQueryParameterCollectionFormatWithHttpInfo($pipe, $ioutil, $http, $url, $context, $language); + $this->testQueryParameterCollectionFormatWithHttpInfo($pipe, $ioutil, $http, $url, $context, $allow_empty, $language); } /** @@ -4266,15 +4267,16 @@ class FakeApi * @param string[] $http (required) * @param string[] $url (required) * @param string[] $context (required) + * @param string $allow_empty (required) * @param array $language (optional) * * @throws \OpenAPI\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function testQueryParameterCollectionFormatWithHttpInfo($pipe, $ioutil, $http, $url, $context, $language = null) + public function testQueryParameterCollectionFormatWithHttpInfo($pipe, $ioutil, $http, $url, $context, $allow_empty, $language = null) { - $request = $this->testQueryParameterCollectionFormatRequest($pipe, $ioutil, $http, $url, $context, $language); + $request = $this->testQueryParameterCollectionFormatRequest($pipe, $ioutil, $http, $url, $context, $allow_empty, $language); try { $options = $this->createHttpClientOption(); @@ -4321,14 +4323,15 @@ class FakeApi * @param string[] $http (required) * @param string[] $url (required) * @param string[] $context (required) + * @param string $allow_empty (required) * @param array $language (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function testQueryParameterCollectionFormatAsync($pipe, $ioutil, $http, $url, $context, $language = null) + public function testQueryParameterCollectionFormatAsync($pipe, $ioutil, $http, $url, $context, $allow_empty, $language = null) { - return $this->testQueryParameterCollectionFormatAsyncWithHttpInfo($pipe, $ioutil, $http, $url, $context, $language) + return $this->testQueryParameterCollectionFormatAsyncWithHttpInfo($pipe, $ioutil, $http, $url, $context, $allow_empty, $language) ->then( function ($response) { return $response[0]; @@ -4344,15 +4347,16 @@ class FakeApi * @param string[] $http (required) * @param string[] $url (required) * @param string[] $context (required) + * @param string $allow_empty (required) * @param array $language (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function testQueryParameterCollectionFormatAsyncWithHttpInfo($pipe, $ioutil, $http, $url, $context, $language = null) + public function testQueryParameterCollectionFormatAsyncWithHttpInfo($pipe, $ioutil, $http, $url, $context, $allow_empty, $language = null) { $returnType = ''; - $request = $this->testQueryParameterCollectionFormatRequest($pipe, $ioutil, $http, $url, $context, $language); + $request = $this->testQueryParameterCollectionFormatRequest($pipe, $ioutil, $http, $url, $context, $allow_empty, $language); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -4385,12 +4389,13 @@ class FakeApi * @param string[] $http (required) * @param string[] $url (required) * @param string[] $context (required) + * @param string $allow_empty (required) * @param array $language (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function testQueryParameterCollectionFormatRequest($pipe, $ioutil, $http, $url, $context, $language = null) + public function testQueryParameterCollectionFormatRequest($pipe, $ioutil, $http, $url, $context, $allow_empty, $language = null) { // verify the required parameter 'pipe' is set if ($pipe === null || (is_array($pipe) && count($pipe) === 0)) { @@ -4422,6 +4427,12 @@ class FakeApi 'Missing the required parameter $context when calling testQueryParameterCollectionFormat' ); } + // verify the required parameter 'allow_empty' is set + if ($allow_empty === null || (is_array($allow_empty) && count($allow_empty) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $allow_empty when calling testQueryParameterCollectionFormat' + ); + } $resourcePath = '/fake/test-query-parameters'; $formParams = []; @@ -4480,6 +4491,17 @@ class FakeApi $queryParams['language'] = $language; } } + // query params + if ($allow_empty !== null) { + if('form' === 'form' && is_array($allow_empty)) { + foreach($allow_empty as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['allowEmpty'] = $allow_empty; + } + } diff --git a/samples/client/petstore/ruby-faraday/docs/FakeApi.md b/samples/client/petstore/ruby-faraday/docs/FakeApi.md index b704e78f9d3c..ae7fab93e5c4 100644 --- a/samples/client/petstore/ruby-faraday/docs/FakeApi.md +++ b/samples/client/petstore/ruby-faraday/docs/FakeApi.md @@ -1115,7 +1115,7 @@ No authorization required ## test_query_parameter_collection_format -> test_query_parameter_collection_format(pipe, ioutil, http, url, context, opts) +> test_query_parameter_collection_format(pipe, ioutil, http, url, context, allow_empty, opts) @@ -1133,13 +1133,14 @@ ioutil = ['inner_example'] # Array | http = ['inner_example'] # Array | url = ['inner_example'] # Array | context = ['inner_example'] # Array | +allow_empty = 'allow_empty_example' # String | opts = { language: { key: 'inner_example'} # Hash | } begin - api_instance.test_query_parameter_collection_format(pipe, ioutil, http, url, context, opts) + api_instance.test_query_parameter_collection_format(pipe, ioutil, http, url, context, allow_empty, opts) rescue Petstore::ApiError => e puts "Error when calling FakeApi->test_query_parameter_collection_format: #{e}" end @@ -1149,12 +1150,12 @@ end This returns an Array which contains the response data (`nil` in this case), status code and headers. -> test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, opts) +> test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, allow_empty, opts) ```ruby begin - data, status_code, headers = api_instance.test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, opts) + data, status_code, headers = api_instance.test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, allow_empty, opts) p status_code # => 2xx p headers # => { ... } p data # => nil @@ -1172,6 +1173,7 @@ end | **http** | [**Array<String>**](String.md) | | | | **url** | [**Array<String>**](String.md) | | | | **context** | [**Array<String>**](String.md) | | | +| **allow_empty** | **String** | | | | **language** | [**Hash<String, String>**](String.md) | | [optional] | ### Return type diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb index a401da830422..62809e843cc2 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb @@ -1192,11 +1192,12 @@ module Petstore # @param http [Array] # @param url [Array] # @param context [Array] + # @param allow_empty [String] # @param [Hash] opts the optional parameters # @option opts [Hash] :language # @return [nil] - def test_query_parameter_collection_format(pipe, ioutil, http, url, context, opts = {}) - test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, opts) + def test_query_parameter_collection_format(pipe, ioutil, http, url, context, allow_empty, opts = {}) + test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, allow_empty, opts) nil end @@ -1206,10 +1207,11 @@ module Petstore # @param http [Array] # @param url [Array] # @param context [Array] + # @param allow_empty [String] # @param [Hash] opts the optional parameters # @option opts [Hash] :language # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, opts = {}) + def test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, allow_empty, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FakeApi.test_query_parameter_collection_format ...' end @@ -1233,6 +1235,10 @@ module Petstore if @api_client.config.client_side_validation && context.nil? fail ArgumentError, "Missing the required parameter 'context' when calling FakeApi.test_query_parameter_collection_format" end + # verify the required parameter 'allow_empty' is set + if @api_client.config.client_side_validation && allow_empty.nil? + fail ArgumentError, "Missing the required parameter 'allow_empty' when calling FakeApi.test_query_parameter_collection_format" + end # resource path local_var_path = '/fake/test-query-parameters' @@ -1243,6 +1249,7 @@ module Petstore query_params[:'http'] = @api_client.build_collection_param(http, :ssv) query_params[:'url'] = @api_client.build_collection_param(url, :csv) query_params[:'context'] = @api_client.build_collection_param(context, :multi) + query_params[:'allowEmpty'] = allow_empty query_params[:'language'] = opts[:'language'] if !opts[:'language'].nil? # header parameters diff --git a/samples/client/petstore/ruby/docs/FakeApi.md b/samples/client/petstore/ruby/docs/FakeApi.md index b704e78f9d3c..ae7fab93e5c4 100644 --- a/samples/client/petstore/ruby/docs/FakeApi.md +++ b/samples/client/petstore/ruby/docs/FakeApi.md @@ -1115,7 +1115,7 @@ No authorization required ## test_query_parameter_collection_format -> test_query_parameter_collection_format(pipe, ioutil, http, url, context, opts) +> test_query_parameter_collection_format(pipe, ioutil, http, url, context, allow_empty, opts) @@ -1133,13 +1133,14 @@ ioutil = ['inner_example'] # Array | http = ['inner_example'] # Array | url = ['inner_example'] # Array | context = ['inner_example'] # Array | +allow_empty = 'allow_empty_example' # String | opts = { language: { key: 'inner_example'} # Hash | } begin - api_instance.test_query_parameter_collection_format(pipe, ioutil, http, url, context, opts) + api_instance.test_query_parameter_collection_format(pipe, ioutil, http, url, context, allow_empty, opts) rescue Petstore::ApiError => e puts "Error when calling FakeApi->test_query_parameter_collection_format: #{e}" end @@ -1149,12 +1150,12 @@ end This returns an Array which contains the response data (`nil` in this case), status code and headers. -> test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, opts) +> test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, allow_empty, opts) ```ruby begin - data, status_code, headers = api_instance.test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, opts) + data, status_code, headers = api_instance.test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, allow_empty, opts) p status_code # => 2xx p headers # => { ... } p data # => nil @@ -1172,6 +1173,7 @@ end | **http** | [**Array<String>**](String.md) | | | | **url** | [**Array<String>**](String.md) | | | | **context** | [**Array<String>**](String.md) | | | +| **allow_empty** | **String** | | | | **language** | [**Hash<String, String>**](String.md) | | [optional] | ### Return type diff --git a/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb b/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb index a401da830422..62809e843cc2 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb @@ -1192,11 +1192,12 @@ module Petstore # @param http [Array] # @param url [Array] # @param context [Array] + # @param allow_empty [String] # @param [Hash] opts the optional parameters # @option opts [Hash] :language # @return [nil] - def test_query_parameter_collection_format(pipe, ioutil, http, url, context, opts = {}) - test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, opts) + def test_query_parameter_collection_format(pipe, ioutil, http, url, context, allow_empty, opts = {}) + test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, allow_empty, opts) nil end @@ -1206,10 +1207,11 @@ module Petstore # @param http [Array] # @param url [Array] # @param context [Array] + # @param allow_empty [String] # @param [Hash] opts the optional parameters # @option opts [Hash] :language # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, opts = {}) + def test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, allow_empty, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FakeApi.test_query_parameter_collection_format ...' end @@ -1233,6 +1235,10 @@ module Petstore if @api_client.config.client_side_validation && context.nil? fail ArgumentError, "Missing the required parameter 'context' when calling FakeApi.test_query_parameter_collection_format" end + # verify the required parameter 'allow_empty' is set + if @api_client.config.client_side_validation && allow_empty.nil? + fail ArgumentError, "Missing the required parameter 'allow_empty' when calling FakeApi.test_query_parameter_collection_format" + end # resource path local_var_path = '/fake/test-query-parameters' @@ -1243,6 +1249,7 @@ module Petstore query_params[:'http'] = @api_client.build_collection_param(http, :ssv) query_params[:'url'] = @api_client.build_collection_param(url, :csv) query_params[:'context'] = @api_client.build_collection_param(context, :multi) + query_params[:'allowEmpty'] = allow_empty query_params[:'language'] = opts[:'language'] if !opts[:'language'].nil? # header parameters diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/apis/FakeApi.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/apis/FakeApi.ts index bc28b93eec19..19d5f89fce9c 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/apis/FakeApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/apis/FakeApi.ts @@ -133,6 +133,7 @@ export interface TestQueryParameterCollectionFormatRequest { http: Array; url: Array; context: Array; + allowEmpty: string; language?: { [key: string]: string; }; } @@ -869,6 +870,10 @@ export class FakeApi extends runtime.BaseAPI { throw new runtime.RequiredError('context','Required parameter requestParameters.context was null or undefined when calling testQueryParameterCollectionFormat.'); } + if (requestParameters.allowEmpty === null || requestParameters.allowEmpty === undefined) { + throw new runtime.RequiredError('allowEmpty','Required parameter requestParameters.allowEmpty was null or undefined when calling testQueryParameterCollectionFormat.'); + } + const queryParameters: any = {}; if (requestParameters.pipe) { @@ -895,6 +900,10 @@ export class FakeApi extends runtime.BaseAPI { queryParameters['language'] = requestParameters.language; } + if (requestParameters.allowEmpty !== undefined) { + queryParameters['allowEmpty'] = requestParameters.allowEmpty; + } + const headerParameters: runtime.HTTPHeaders = {}; const response = await this.request({ diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/doc/FakeApi.md b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/doc/FakeApi.md index ed94b4b79b19..544b6e316c3d 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/doc/FakeApi.md +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/doc/FakeApi.md @@ -761,7 +761,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **testQueryParameterCollectionFormat** -> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, language) +> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, language) @@ -777,10 +777,11 @@ final BuiltList ioutil = ; // BuiltList | final BuiltList http = ; // BuiltList | final BuiltList url = ; // BuiltList | final BuiltList context = ; // BuiltList | +final String allowEmpty = allowEmpty_example; // String | final BuiltMap language = ; // BuiltMap | try { - api.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, language); + api.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, language); } catch on DioError (e) { print('Exception when calling FakeApi->testQueryParameterCollectionFormat: $e\n'); } @@ -795,6 +796,7 @@ Name | Type | Description | Notes **http** | [**BuiltList<String>**](String.md)| | **url** | [**BuiltList<String>**](String.md)| | **context** | [**BuiltList<String>**](String.md)| | + **allowEmpty** | **String**| | **language** | [**BuiltMap<String, String>**](String.md)| | [optional] ### Return type diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/lib/src/api/fake_api.dart b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/lib/src/api/fake_api.dart index 22a2d4706fea..d600aba3181f 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/lib/src/api/fake_api.dart +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/lib/src/api/fake_api.dart @@ -1353,6 +1353,7 @@ class FakeApi { /// * [http] /// * [url] /// * [context] + /// * [allowEmpty] /// * [language] /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation /// * [headers] - Can be used to add additional headers to the request @@ -1369,6 +1370,7 @@ class FakeApi { required BuiltList http, required BuiltList url, required BuiltList context, + required String allowEmpty, BuiltMap? language, CancelToken? cancelToken, Map? headers, @@ -1397,6 +1399,7 @@ class FakeApi { r'url': encodeCollectionQueryParameter(_serializers, url, const FullType(BuiltList, [FullType(String)]), format: ListFormat.csv,), r'context': encodeCollectionQueryParameter(_serializers, context, const FullType(BuiltList, [FullType(String)]), format: ListFormat.multi,), if (language != null) r'language': encodeQueryParameter(_serializers, language, const FullType(BuiltMap, [FullType(String), FullType(String)]), ), + r'allowEmpty': encodeQueryParameter(_serializers, allowEmpty, const FullType(String)), }; final _response = await _dio.request( diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/FakeApi.md b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/FakeApi.md index 9e9fee11ef43..ddd5068fa409 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/FakeApi.md +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/FakeApi.md @@ -761,7 +761,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **testQueryParameterCollectionFormat** -> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, language) +> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, language) @@ -777,10 +777,11 @@ var ioutil = []; // BuiltList | var http = []; // BuiltList | var url = []; // BuiltList | var context = []; // BuiltList | +var allowEmpty = allowEmpty_example; // String | var language = ; // BuiltMap | try { - api_instance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, language); + api_instance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, language); } catch (e) { print('Exception when calling FakeApi->testQueryParameterCollectionFormat: $e\n'); } @@ -795,6 +796,7 @@ Name | Type | Description | Notes **http** | [**BuiltList**](String.md)| | **url** | [**BuiltList**](String.md)| | **context** | [**BuiltList**](String.md)| | + **allowEmpty** | **String**| | **language** | [**BuiltMap**](String.md)| | [optional] ### Return type diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/api/fake_api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/api/fake_api.dart index 98444a81c25c..6df5299a4779 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/api/fake_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/api/fake_api.dart @@ -891,7 +891,8 @@ class FakeApi { BuiltList ioutil, BuiltList http, BuiltList url, - BuiltList context, { + BuiltList context, + String allowEmpty, { BuiltMap language, CancelToken cancelToken, Map headers, @@ -913,6 +914,7 @@ class FakeApi { r'url': url, r'context': context, if (language != null) r'language': language, + r'allowEmpty': allowEmpty, }, extra: { 'secure': >[], diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/doc/FakeApi.md b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/doc/FakeApi.md index 2b8a068b46d5..3f4460fa6234 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/doc/FakeApi.md +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/doc/FakeApi.md @@ -761,7 +761,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **testQueryParameterCollectionFormat** -> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, language) +> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, language) @@ -777,10 +777,11 @@ final ioutil = []; // List | final http = []; // List | final url = []; // List | final context = []; // List | +final allowEmpty = allowEmpty_example; // String | final language = ; // Map | try { - api_instance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, language); + api_instance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, language); } catch (e) { print('Exception when calling FakeApi->testQueryParameterCollectionFormat: $e\n'); } @@ -795,6 +796,7 @@ Name | Type | Description | Notes **http** | [**List**](String.md)| | [default to const []] **url** | [**List**](String.md)| | [default to const []] **context** | [**List**](String.md)| | [default to const []] + **allowEmpty** | **String**| | **language** | [**Map**](String.md)| | [optional] [default to const {}] ### Return type diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/api/fake_api.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/api/fake_api.dart index 7d6048e41f76..d33a5697d317 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/api/fake_api.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/api/fake_api.dart @@ -1177,8 +1177,10 @@ class FakeApi { /// /// * [List] context (required): /// + /// * [String] allowEmpty (required): + /// /// * [Map] language: - Future testQueryParameterCollectionFormatWithHttpInfo(List pipe, List ioutil, List http, List url, List context, { Map language }) async { + Future testQueryParameterCollectionFormatWithHttpInfo(List pipe, List ioutil, List http, List url, List context, String allowEmpty, { Map language }) async { // Verify required params are set. if (pipe == null) { throw ApiException(HttpStatus.badRequest, 'Missing required param: pipe'); @@ -1195,6 +1197,9 @@ class FakeApi { if (context == null) { throw ApiException(HttpStatus.badRequest, 'Missing required param: context'); } + if (allowEmpty == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: allowEmpty'); + } final path = r'/fake/test-query-parameters'; @@ -1212,6 +1217,7 @@ class FakeApi { if (language != null) { queryParams.addAll(_convertParametersForCollectionFormat('', 'language', language)); } + queryParams.addAll(_convertParametersForCollectionFormat('', 'allowEmpty', allowEmpty)); final contentTypes = []; final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; @@ -1244,9 +1250,11 @@ class FakeApi { /// /// * [List] context (required): /// + /// * [String] allowEmpty (required): + /// /// * [Map] language: - Future testQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context, { Map language }) async { - final response = await testQueryParameterCollectionFormatWithHttpInfo(pipe, ioutil, http, url, context, language: language ); + Future testQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context, String allowEmpty, { Map language }) async { + final response = await testQueryParameterCollectionFormatWithHttpInfo(pipe, ioutil, http, url, context, allowEmpty, language: language ); if (response.statusCode >= HttpStatus.badRequest) { throw ApiException(response.statusCode, await _decodeBodyBytes(response)); } diff --git a/samples/openapi3/client/petstore/dart2/petstore_json_serializable_client_lib_fake/doc/FakeApi.md b/samples/openapi3/client/petstore/dart2/petstore_json_serializable_client_lib_fake/doc/FakeApi.md index 2b8a068b46d5..3f4460fa6234 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_json_serializable_client_lib_fake/doc/FakeApi.md +++ b/samples/openapi3/client/petstore/dart2/petstore_json_serializable_client_lib_fake/doc/FakeApi.md @@ -761,7 +761,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **testQueryParameterCollectionFormat** -> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, language) +> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, language) @@ -777,10 +777,11 @@ final ioutil = []; // List | final http = []; // List | final url = []; // List | final context = []; // List | +final allowEmpty = allowEmpty_example; // String | final language = ; // Map | try { - api_instance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, language); + api_instance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, language); } catch (e) { print('Exception when calling FakeApi->testQueryParameterCollectionFormat: $e\n'); } @@ -795,6 +796,7 @@ Name | Type | Description | Notes **http** | [**List**](String.md)| | [default to const []] **url** | [**List**](String.md)| | [default to const []] **context** | [**List**](String.md)| | [default to const []] + **allowEmpty** | **String**| | **language** | [**Map**](String.md)| | [optional] [default to const {}] ### Return type diff --git a/samples/openapi3/client/petstore/dart2/petstore_json_serializable_client_lib_fake/lib/api/fake_api.dart b/samples/openapi3/client/petstore/dart2/petstore_json_serializable_client_lib_fake/lib/api/fake_api.dart index 0fdbd57ab884..3a1d5162364d 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_json_serializable_client_lib_fake/lib/api/fake_api.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_json_serializable_client_lib_fake/lib/api/fake_api.dart @@ -1184,8 +1184,10 @@ class FakeApi { /// /// * [List] context (required): /// + /// * [String] allowEmpty (required): + /// /// * [Map] language: - Future testQueryParameterCollectionFormatWithHttpInfo(List pipe, List ioutil, List http, List url, List context, { Map language }) async { + Future testQueryParameterCollectionFormatWithHttpInfo(List pipe, List ioutil, List http, List url, List context, String allowEmpty, { Map language }) async { // Verify required params are set. if (pipe == null) { throw ApiException(HttpStatus.badRequest, 'Missing required param: pipe'); @@ -1202,6 +1204,9 @@ class FakeApi { if (context == null) { throw ApiException(HttpStatus.badRequest, 'Missing required param: context'); } + if (allowEmpty == null) { + throw ApiException(HttpStatus.badRequest, 'Missing required param: allowEmpty'); + } final path = r'/fake/test-query-parameters'; @@ -1219,6 +1224,7 @@ class FakeApi { if (language != null) { queryParams.addAll(_convertParametersForCollectionFormat('', 'language', language)); } + queryParams.addAll(_convertParametersForCollectionFormat('', 'allowEmpty', allowEmpty)); final contentTypes = []; final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; @@ -1251,9 +1257,11 @@ class FakeApi { /// /// * [List] context (required): /// + /// * [String] allowEmpty (required): + /// /// * [Map] language: - Future testQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context, { Map language }) async { - final response = await testQueryParameterCollectionFormatWithHttpInfo(pipe, ioutil, http, url, context, language: language ); + Future testQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context, String allowEmpty, { Map language }) async { + final response = await testQueryParameterCollectionFormatWithHttpInfo(pipe, ioutil, http, url, context, allowEmpty, language: language ); if (response.statusCode >= HttpStatus.badRequest) { throw ApiException(response.statusCode, await _decodeBodyBytes(response)); } diff --git a/samples/openapi3/client/petstore/python-legacy/docs/FakeApi.md b/samples/openapi3/client/petstore/python-legacy/docs/FakeApi.md index 991a48e56c69..0bf51adc9e55 100755 --- a/samples/openapi3/client/petstore/python-legacy/docs/FakeApi.md +++ b/samples/openapi3/client/petstore/python-legacy/docs/FakeApi.md @@ -1130,7 +1130,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **test_query_parameter_collection_format** -> test_query_parameter_collection_format(pipe, ioutil, http, url, context, language=language) +> test_query_parameter_collection_format(pipe, ioutil, http, url, context, allow_empty, language=language) @@ -1160,10 +1160,11 @@ ioutil = ['ioutil_example'] # list[str] | http = ['http_example'] # list[str] | url = ['url_example'] # list[str] | context = ['context_example'] # list[str] | +allow_empty = 'allow_empty_example' # str | language = {'key': 'language_example'} # dict(str, str) | (optional) try: - api_instance.test_query_parameter_collection_format(pipe, ioutil, http, url, context, language=language) + api_instance.test_query_parameter_collection_format(pipe, ioutil, http, url, context, allow_empty, language=language) except ApiException as e: print("Exception when calling FakeApi->test_query_parameter_collection_format: %s\n" % e) ``` @@ -1177,6 +1178,7 @@ Name | Type | Description | Notes **http** | [**list[str]**](str.md)| | **url** | [**list[str]**](str.md)| | **context** | [**list[str]**](str.md)| | + **allow_empty** | **str**| | **language** | [**dict(str, str)**](str.md)| | [optional] ### Return type diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/fake_api.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/fake_api.py index 90606ec5aead..7de994ea5654 100755 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/fake_api.py +++ b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/fake_api.py @@ -2415,14 +2415,14 @@ class FakeApi(object): collection_formats=collection_formats, _request_auth=local_var_params.get('_request_auth')) - def test_query_parameter_collection_format(self, pipe, ioutil, http, url, context, **kwargs): # noqa: E501 + def test_query_parameter_collection_format(self, pipe, ioutil, http, url, context, allow_empty, **kwargs): # noqa: E501 """test_query_parameter_collection_format # noqa: E501 To test the collection format in query parameters # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.test_query_parameter_collection_format(pipe, ioutil, http, url, context, async_req=True) + >>> thread = api.test_query_parameter_collection_format(pipe, ioutil, http, url, context, allow_empty, async_req=True) >>> result = thread.get() :param pipe: (required) @@ -2435,6 +2435,8 @@ class FakeApi(object): :type url: list[str] :param context: (required) :type context: list[str] + :param allow_empty: (required) + :type allow_empty: str :param language: :type language: dict(str, str) :param async_req: Whether to execute the request asynchronously. @@ -2453,16 +2455,16 @@ class FakeApi(object): :rtype: None """ kwargs['_return_http_data_only'] = True - return self.test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, **kwargs) # noqa: E501 + return self.test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, allow_empty, **kwargs) # noqa: E501 - def test_query_parameter_collection_format_with_http_info(self, pipe, ioutil, http, url, context, **kwargs): # noqa: E501 + def test_query_parameter_collection_format_with_http_info(self, pipe, ioutil, http, url, context, allow_empty, **kwargs): # noqa: E501 """test_query_parameter_collection_format # noqa: E501 To test the collection format in query parameters # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, async_req=True) + >>> thread = api.test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, allow_empty, async_req=True) >>> result = thread.get() :param pipe: (required) @@ -2475,6 +2477,8 @@ class FakeApi(object): :type url: list[str] :param context: (required) :type context: list[str] + :param allow_empty: (required) + :type allow_empty: str :param language: :type language: dict(str, str) :param async_req: Whether to execute the request asynchronously. @@ -2508,6 +2512,7 @@ class FakeApi(object): 'http', 'url', 'context', + 'allow_empty', 'language' ] all_params.extend( @@ -2548,6 +2553,10 @@ class FakeApi(object): if self.api_client.client_side_validation and ('context' not in local_var_params or # noqa: E501 local_var_params['context'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `context` when calling `test_query_parameter_collection_format`") # noqa: E501 + # verify the required parameter 'allow_empty' is set + if self.api_client.client_side_validation and ('allow_empty' not in local_var_params or # noqa: E501 + local_var_params['allow_empty'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `allow_empty` when calling `test_query_parameter_collection_format`") # noqa: E501 collection_formats = {} @@ -2571,6 +2580,8 @@ class FakeApi(object): collection_formats['context'] = 'multi' # noqa: E501 if 'language' in local_var_params and local_var_params['language'] is not None: # noqa: E501 query_params.append(('language', local_var_params['language'])) # noqa: E501 + if 'allow_empty' in local_var_params and local_var_params['allow_empty'] is not None: # noqa: E501 + query_params.append(('allowEmpty', local_var_params['allow_empty'])) # noqa: E501 header_params = {} diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeApi.java index 1e871d737c66..977a1d06f700 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeApi.java @@ -275,9 +275,9 @@ public class FakeApi { @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "Success", response = Void.class) }) - public Response testQueryParameterCollectionFormat(@ApiParam(value = "", required = true) @QueryParam("pipe") @NotNull @Valid List pipe,@ApiParam(value = "", required = true) @QueryParam("ioutil") @NotNull @Valid List ioutil,@ApiParam(value = "", required = true) @QueryParam("http") @NotNull @Valid List http,@ApiParam(value = "", required = true) @QueryParam("url") @NotNull @Valid List url,@ApiParam(value = "", required = true) @QueryParam("context") @NotNull @Valid List context,@ApiParam(value = "") @QueryParam("language") @Valid Map language,@Context SecurityContext securityContext) + public Response testQueryParameterCollectionFormat(@ApiParam(value = "", required = true) @QueryParam("pipe") @NotNull @Valid List pipe,@ApiParam(value = "", required = true) @QueryParam("ioutil") @NotNull @Valid List ioutil,@ApiParam(value = "", required = true) @QueryParam("http") @NotNull @Valid List http,@ApiParam(value = "", required = true) @QueryParam("url") @NotNull @Valid List url,@ApiParam(value = "", required = true) @QueryParam("context") @NotNull @Valid List context,@ApiParam(value = "", required = true) @QueryParam("allowEmpty") @NotNull String allowEmpty,@ApiParam(value = "") @QueryParam("language") @Valid Map language,@Context SecurityContext securityContext) throws NotFoundException { - return delegate.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, language, securityContext); + return delegate.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, language, securityContext); } @POST @Path("/{petId}/uploadImageWithRequiredFile") diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeApiService.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeApiService.java index 8eb7c460c972..1b48df160ffd 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeApiService.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeApiService.java @@ -44,6 +44,6 @@ public abstract class FakeApiService { public abstract Response testGroupParameters( @NotNull Integer requiredStringGroup, @NotNull Boolean requiredBooleanGroup, @NotNull Long requiredInt64Group,Integer stringGroup,Boolean booleanGroup,Long int64Group,SecurityContext securityContext) throws NotFoundException; public abstract Response testInlineAdditionalProperties(Map requestBody,SecurityContext securityContext) throws NotFoundException; public abstract Response testJsonFormData(String param,String param2,SecurityContext securityContext) throws NotFoundException; - public abstract Response testQueryParameterCollectionFormat( @NotNull List pipe, @NotNull List ioutil, @NotNull List http, @NotNull List url, @NotNull List context,Map language,SecurityContext securityContext) throws NotFoundException; + public abstract Response testQueryParameterCollectionFormat( @NotNull List pipe, @NotNull List ioutil, @NotNull List http, @NotNull List url, @NotNull List context, @NotNull String allowEmpty,Map language,SecurityContext securityContext) throws NotFoundException; public abstract Response uploadFileWithRequiredFile(Long petId,FormDataBodyPart requiredFileBodypart,String additionalMetadata,SecurityContext securityContext) throws NotFoundException; } diff --git a/samples/server/petstore/jaxrs-jersey/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java b/samples/server/petstore/jaxrs-jersey/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java index 72a21a6db062..68be0aeef19e 100644 --- a/samples/server/petstore/jaxrs-jersey/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-jersey/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java @@ -109,7 +109,7 @@ public class FakeApiServiceImpl extends FakeApiService { return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } @Override - public Response testQueryParameterCollectionFormat( @NotNull List pipe, @NotNull List ioutil, @NotNull List http, @NotNull List url, @NotNull List context, Map language, SecurityContext securityContext) throws NotFoundException { + public Response testQueryParameterCollectionFormat( @NotNull List pipe, @NotNull List ioutil, @NotNull List http, @NotNull List url, @NotNull List context, @NotNull String allowEmpty, Map language, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } diff --git a/samples/server/petstore/php-laravel/lib/app/Http/Controllers/FakeController.php b/samples/server/petstore/php-laravel/lib/app/Http/Controllers/FakeController.php index d742f4cf6db3..c6c58dfdb981 100644 --- a/samples/server/petstore/php-laravel/lib/app/Http/Controllers/FakeController.php +++ b/samples/server/petstore/php-laravel/lib/app/Http/Controllers/FakeController.php @@ -554,6 +554,11 @@ class FakeController extends Controller } $context = $input['context']; + if (!isset($input['allowEmpty'])) { + throw new \InvalidArgumentException('Missing the required parameter $allowEmpty when calling testQueryParameterCollectionFormat'); + } + $allowEmpty = $input['allowEmpty']; + $language = $input['language']; diff --git a/samples/server/petstore/php-lumen/lib/app/Http/Controllers/FakeApi.php b/samples/server/petstore/php-lumen/lib/app/Http/Controllers/FakeApi.php index b431d00ab5ee..8d417ce34db2 100644 --- a/samples/server/petstore/php-lumen/lib/app/Http/Controllers/FakeApi.php +++ b/samples/server/petstore/php-lumen/lib/app/Http/Controllers/FakeApi.php @@ -550,6 +550,11 @@ class FakeApi extends Controller } $context = $input['context']; + if (!isset($input['allow_empty'])) { + throw new \InvalidArgumentException('Missing the required parameter $allow_empty when calling testQueryParameterCollectionFormat'); + } + $allow_empty = $input['allow_empty']; + $language = $input['language'];