From c3535cf9ca11c0e239862508f670bbd11bf085b0 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Thu, 15 Aug 2019 11:09:12 +0800 Subject: [PATCH] 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 --- .../languages/HaskellHttpClientCodegen.java | 3 +- .../languages/HaskellServantCodegen.java | 3 +- .../libraries/google-api-client/api.mustache | 12 +- .../retrofit/CollectionFormats.mustache | 4 + .../retrofit2/CollectionFormats.mustache | 4 + ...ith-fake-endpoints-models-for-testing.yaml | 47 +++ ...ith-fake-endpoints-models-for-testing.yaml | 51 +++ .../csharp-netcore/OpenAPIClient/README.md | 1 + .../OpenAPIClient/docs/FakeApi.md | 76 +++++ .../src/Org.OpenAPITools/Api/FakeApi.cs | 314 ++++++++++++++++++ .../OpenAPIClientCore/README.md | 1 + .../OpenAPIClientCore/docs/FakeApi.md | 76 +++++ .../src/Org.OpenAPITools/Api/FakeApi.cs | 314 ++++++++++++++++++ .../petstore/csharp/OpenAPIClient/README.md | 1 + .../csharp/OpenAPIClient/docs/FakeApi.md | 82 +++++ .../src/Org.OpenAPITools/Api/FakeApi.cs | 235 +++++++++++++ .../elixir/lib/openapi_petstore/api/fake.ex | 34 ++ .../petstore/go/go-petstore-withXml/README.md | 1 + .../go/go-petstore-withXml/api/openapi.yaml | 53 +++ .../go/go-petstore-withXml/api_fake.go | 84 +++++ .../go/go-petstore-withXml/docs/FakeApi.md | 38 +++ .../client/petstore/go/go-petstore/README.md | 1 + .../petstore/go/go-petstore/api/openapi.yaml | 53 +++ .../petstore/go/go-petstore/api_fake.go | 84 +++++ .../petstore/go/go-petstore/docs/FakeApi.md | 38 +++ .../lib/OpenAPIPetstore/API/Fake.hs | 25 ++ .../lib/OpenAPIPetstore/Model.hs | 15 + .../petstore/haskell-http-client/openapi.yaml | 53 +++ .../org/openapitools/client/api/FakeApi.java | 66 ++++ .../org/openapitools/client/api/FakeApi.java | 66 ++++ .../java/google-api-client/docs/FakeApi.md | 73 ++++ .../client/api/AnotherFakeApi.java | 12 +- .../org/openapitools/client/api/FakeApi.java | 301 +++++++++++++---- .../client/api/FakeClassnameTags123Api.java | 12 +- .../org/openapitools/client/api/PetApi.java | 80 ++--- .../org/openapitools/client/api/StoreApi.java | 36 +- .../org/openapitools/client/api/UserApi.java | 80 ++--- .../petstore/java/jersey1/docs/FakeApi.md | 73 ++++ .../org/openapitools/client/api/FakeApi.java | 70 ++++ .../java/jersey2-java6/docs/FakeApi.md | 73 ++++ .../org/openapitools/client/api/FakeApi.java | 95 ++++++ .../java/jersey2-java8/docs/FakeApi.md | 73 ++++ .../org/openapitools/client/api/FakeApi.java | 95 ++++++ .../petstore/java/jersey2/docs/FakeApi.md | 73 ++++ .../org/openapitools/client/api/FakeApi.java | 95 ++++++ .../petstore/java/native/docs/FakeApi.md | 73 ++++ .../org/openapitools/client/api/FakeApi.java | 76 +++++ .../docs/FakeApi.md | 70 ++++ .../org/openapitools/client/api/FakeApi.java | 161 +++++++++ .../petstore/java/okhttp-gson/docs/FakeApi.md | 70 ++++ .../org/openapitools/client/api/FakeApi.java | 161 +++++++++ .../java/rest-assured/docs/FakeApi.md | 51 +++ .../org/openapitools/client/api/FakeApi.java | 119 +++++++ .../petstore/java/resteasy/docs/FakeApi.md | 73 ++++ .../org/openapitools/client/api/FakeApi.java | 69 ++++ .../java/resttemplate-withXml/docs/FakeApi.md | 73 ++++ .../org/openapitools/client/api/FakeApi.java | 61 ++++ .../java/resttemplate/docs/FakeApi.md | 73 ++++ .../org/openapitools/client/api/FakeApi.java | 61 ++++ .../client/CollectionFormats.java | 4 + .../org/openapitools/client/api/FakeApi.java | 32 ++ .../java/retrofit2-play24/docs/FakeApi.md | 73 ++++ .../client/CollectionFormats.java | 4 + .../org/openapitools/client/api/FakeApi.java | 15 + .../java/retrofit2-play25/docs/FakeApi.md | 73 ++++ .../client/CollectionFormats.java | 4 + .../org/openapitools/client/api/FakeApi.java | 15 + .../java/retrofit2-play26/docs/FakeApi.md | 73 ++++ .../client/CollectionFormats.java | 4 + .../org/openapitools/client/api/FakeApi.java | 15 + .../petstore/java/retrofit2/docs/FakeApi.md | 73 ++++ .../client/CollectionFormats.java | 4 + .../org/openapitools/client/api/FakeApi.java | 15 + .../petstore/java/retrofit2rx/docs/FakeApi.md | 73 ++++ .../client/CollectionFormats.java | 4 + .../org/openapitools/client/api/FakeApi.java | 15 + .../java/retrofit2rx2/docs/FakeApi.md | 73 ++++ .../client/CollectionFormats.java | 4 + .../org/openapitools/client/api/FakeApi.java | 15 + .../petstore/java/vertx/docs/FakeApi.md | 73 ++++ .../org/openapitools/client/api/FakeApi.java | 2 + .../openapitools/client/api/FakeApiImpl.java | 67 ++++ .../client/api/rxjava/FakeApi.java | 29 ++ .../petstore/java/webclient/docs/FakeApi.md | 73 ++++ .../org/openapitools/client/api/FakeApi.java | 61 ++++ .../client/petstore/javascript-es6/README.md | 1 + .../petstore/javascript-es6/docs/FakeApi.md | 54 +++ .../javascript-es6/src/api/FakeApi.js | 65 ++++ .../petstore/javascript-promise-es6/README.md | 1 + .../javascript-promise-es6/docs/FakeApi.md | 53 +++ .../javascript-promise-es6/src/api/FakeApi.js | 74 +++++ .../petstore/javascript-promise/README.md | 1 + .../javascript-promise/docs/FakeApi.md | 54 +++ .../javascript-promise/src/api/FakeApi.js | 91 +++++ samples/client/petstore/javascript/README.md | 1 + .../petstore/javascript/docs/FakeApi.md | 56 ++++ .../petstore/javascript/src/api/FakeApi.js | 82 +++++ samples/client/petstore/perl/README.md | 1 + samples/client/petstore/perl/docs/FakeApi.md | 54 +++ .../perl/lib/WWW/OpenAPIClient/FakeApi.pm | 125 +++++++ .../petstore/php/OpenAPIClient-php/README.md | 1 + .../php/OpenAPIClient-php/docs/Api/FakeApi.md | 64 ++++ .../php/OpenAPIClient-php/lib/Api/FakeApi.php | 291 ++++++++++++++++ .../test/Api/FakeApiTest.php | 10 + .../client/petstore/python-asyncio/README.md | 1 + .../petstore/python-asyncio/docs/FakeApi.md | 61 ++++ .../petstore_api/api/fake_api.py | 141 ++++++++ .../client/petstore/python-tornado/README.md | 1 + .../petstore/python-tornado/docs/FakeApi.md | 61 ++++ .../petstore_api/api/fake_api.py | 141 ++++++++ samples/client/petstore/python/README.md | 1 + .../client/petstore/python/docs/FakeApi.md | 61 ++++ .../python/petstore_api/api/fake_api.py | 141 ++++++++ samples/client/petstore/ruby/README.md | 1 + samples/client/petstore/ruby/docs/FakeApi.md | 54 +++ .../ruby/lib/petstore/api/fake_api.rb | 87 +++++ .../petstore/ruby/spec/api/fake_api_spec.rb | 15 + .../petstore/php/OpenAPIClient-php/README.md | 1 + .../php/OpenAPIClient-php/docs/Api/FakeApi.md | 64 ++++ .../php/OpenAPIClient-php/lib/Api/FakeApi.php | 291 ++++++++++++++++ .../test/Api/FakeApiTest.php | 10 + .../openapi3/client/petstore/python/README.md | 1 + .../client/petstore/python/docs/FakeApi.md | 61 ++++ .../python/petstore_api/api/fake_api.py | 141 ++++++++ .../client/petstore/ruby-faraday/README.md | 1 + .../petstore/ruby-faraday/docs/FakeApi.md | 54 +++ .../ruby-faraday/lib/petstore/api/fake_api.rb | 87 +++++ .../ruby-faraday/spec/api/fake_api_spec.rb | 15 + .../openapi3/client/petstore/ruby/README.md | 1 + .../client/petstore/ruby/docs/FakeApi.md | 54 +++ .../ruby/lib/petstore/api/fake_api.rb | 87 +++++ .../petstore/ruby/spec/api/fake_api_spec.rb | 15 + .../java/org/openapitools/api/FakeApi.java | 16 + .../org/openapitools/api/FakeApiService.java | 6 + .../api/impl/FakeApiServiceImpl.java | 10 + .../java/org/openapitools/api/FakeApi.java | 9 +- .../api/impl/FakeApiServiceImpl.java | 6 + .../org/openapitools/api/FakeApiTest.java | 18 + .../java/org/openapitools/api/FakeApi.java | 16 + .../org/openapitools/api/FakeApiService.java | 1 + .../api/impl/FakeApiServiceImpl.java | 5 + .../java/org/openapitools/api/FakeApi.java | 16 + .../org/openapitools/api/FakeApiService.java | 1 + .../api/impl/FakeApiServiceImpl.java | 5 + .../java/org/openapitools/api/FakeApi.java | 7 + .../src/main/openapi/openapi.yaml | 56 ++++ .../java/org/openapitools/api/FakeApi.java | 10 + .../jaxrs-spec/src/main/openapi/openapi.yaml | 56 ++++ .../java/org/openapitools/api/FakeApi.java | 19 +- .../org/openapitools/api/FakeApiService.java | 2 + .../api/impl/FakeApiServiceImpl.java | 6 + .../java/org/openapitools/api/FakeApi.java | 17 + .../org/openapitools/api/FakeApiService.java | 2 + .../api/impl/FakeApiServiceImpl.java | 6 + .../java/org/openapitools/api/FakeApi.java | 16 + .../org/openapitools/api/FakeApiService.java | 1 + .../api/impl/FakeApiServiceImpl.java | 5 + .../java/org/openapitools/api/FakeApi.java | 16 + .../org/openapitools/api/FakeApiService.java | 1 + .../api/impl/FakeApiServiceImpl.java | 5 + .../lib/app/Http/Controllers/FakeApi.php | 44 +++ .../petstore/php-lumen/lib/routes/web.php | 6 + samples/server/petstore/php-slim/README.md | 1 + .../php-slim/lib/Api/AbstractFakeApi.php | 25 ++ .../petstore/php-slim/lib/SlimRouter.php | 11 + .../application/config/path_handler.yml | 2 + .../App/Handler/FakeTestQueryParamters.php | 29 ++ .../java/org/openapitools/api/FakeApi.java | 11 + .../java/org/openapitools/api/FakeApi.java | 11 + .../java/org/openapitools/api/FakeApi.java | 8 + .../openapitools/api/FakeApiController.java | 5 + .../java/org/openapitools/api/FakeApi.java | 8 + .../openapitools/api/FakeApiController.java | 5 + .../java/org/openapitools/api/FakeApi.java | 10 + .../org/openapitools/api/FakeApiDelegate.java | 12 + .../java/org/openapitools/api/FakeApi.java | 8 + .../openapitools/api/FakeApiController.java | 4 + .../org/openapitools/api/FakeApiDelegate.java | 9 + .../java/org/openapitools/api/FakeApi.java | 13 + .../java/org/openapitools/api/FakeApi.java | 10 + .../org/openapitools/api/FakeApiDelegate.java | 15 + .../src/main/resources/openapi.yaml | 56 ++++ .../java/org/openapitools/api/FakeApi.java | 11 + .../openapitools/virtualan/api/FakeApi.java | 12 + .../java/org/openapitools/api/FakeApi.java | 11 + 185 files changed, 8369 insertions(+), 190 deletions(-) create mode 100644 samples/server/petstore/php-ze-ph/src/App/Handler/FakeTestQueryParamters.php diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellHttpClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellHttpClientCodegen.java index 6a69660348c..889cad95432 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellHttpClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellHttpClientCodegen.java @@ -1065,13 +1065,14 @@ public class HaskellHttpClientCodegen extends DefaultCodegen implements CodegenC case "tsv": return "TabSeparated"; case "ssv": + case "space": return "SpaceSeparated"; case "pipes": return "PipeSeparated"; case "multi": return "MultiParamArray"; default: - throw new UnsupportedOperationException(); + throw new UnsupportedOperationException(collectionFormat + " (collection format) not supported"); } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellServantCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellServantCodegen.java index a46452c65c1..665cd9b85d4 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellServantCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellServantCodegen.java @@ -549,6 +549,7 @@ public class HaskellServantCodegen extends DefaultCodegen implements CodegenConf return "(QueryList 'CommaSeparated (" + type + "))"; case "tsv": return "(QueryList 'TabSeparated (" + type + "))"; + case "space": case "ssv": return "(QueryList 'SpaceSeparated (" + type + "))"; case "pipes": @@ -556,7 +557,7 @@ public class HaskellServantCodegen extends DefaultCodegen implements CodegenConf case "multi": return "(QueryList 'MultiParamArray (" + type + "))"; default: - throw new UnsupportedOperationException(); + throw new UnsupportedOperationException(collectionFormat + " (collection format) not supported"); } } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/api.mustache index 6a9c10c02ea..4083269ab18 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/api.mustache @@ -104,8 +104,8 @@ public class {{classname}} { } }{{/queryParams}}{{/hasQueryParams}} - String url = uriBuilder{{#hasPathParams}}.buildFromMap(uriVariables).toString();{{/hasPathParams}}{{^hasPathParams}}.build().toString();{{/hasPathParams}} - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder{{#hasPathParams}}.buildFromMap(uriVariables).toString();{{/hasPathParams}}{{^hasPathParams}}.build().toString();{{/hasPathParams}} + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = {{#isBodyAllowed}}apiClient.new JacksonJsonHttpContent({{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}){{/isBodyAllowed}}{{^isBodyAllowed}}null{{/isBodyAllowed}}; return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.{{httpMethod}}, genericUrl, content).execute(); @@ -135,8 +135,8 @@ public class {{classname}} { } }{{/queryParams}}{{/hasQueryParams}} - String url = uriBuilder{{#hasPathParams}}.buildFromMap(uriVariables).toString();{{/hasPathParams}}{{^hasPathParams}}.build().toString();{{/hasPathParams}} - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder{{#hasPathParams}}.buildFromMap(uriVariables).toString();{{/hasPathParams}}{{^hasPathParams}}.build().toString();{{/hasPathParams}} + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = {{#bodyParam}}{{paramName}} == null ? apiClient.new JacksonJsonHttpContent(null) : @@ -176,8 +176,8 @@ public class {{classname}} { } } - String url = uriBuilder{{#hasPathParams}}.buildFromMap(uriVariables).toString();{{/hasPathParams}}{{^hasPathParams}}.build().toString();{{/hasPathParams}} - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder{{#hasPathParams}}.buildFromMap(uriVariables).toString();{{/hasPathParams}}{{^hasPathParams}}.build().toString();{{/hasPathParams}} + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = {{#isBodyAllowed}}apiClient.new JacksonJsonHttpContent({{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}){{/isBodyAllowed}}{{^isBodyAllowed}}null{{/isBodyAllowed}}; return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.{{httpMethod}}, genericUrl, content).execute(); diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/CollectionFormats.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/CollectionFormats.mustache index a549ea59d1c..33331adb026 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/CollectionFormats.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/CollectionFormats.mustache @@ -35,6 +35,10 @@ public class CollectionFormats { } + public static class SPACEParams extends SSVParams { + + } + public static class SSVParams extends CSVParams { public SSVParams() { diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/CollectionFormats.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/CollectionFormats.mustache index 8c91c335dfc..dbfa4ae767b 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/CollectionFormats.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/CollectionFormats.mustache @@ -35,6 +35,10 @@ public class CollectionFormats { } + public static class SPACEParams extends SSVParams { + + } + public static class SSVParams extends CSVParams { public SSVParams() { diff --git a/modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml b/modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml index ed907f27854..38d9683b62d 100644 --- a/modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +++ b/modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml @@ -1041,6 +1041,53 @@ paths: responses: '200': description: Success + /fake/test-query-paramters: + put: + tags: + - fake + description: 'To test the collection format in query parameters' + operationId: testQueryParameterCollectionFormat + parameters: + - name: pipe + in: query + required: true + type: array + items: + type: string + collectionFormat: pipe + - name: ioutil + in: query + required: true + type: array + items: + type: string + collectionFormat: tsv + - name: http + in: query + required: true + type: array + items: + type: string + collectionFormat: ssv + - name: url + in: query + required: true + type: array + items: + type: string + collectionFormat: csv + - name: context + in: query + required: true + type: array + items: + type: string + collectionFormat: multi + consumes: + - application/json + responses: + '200': + description: Success '/fake/{petId}/uploadImageWithRequiredFile': post: tags: 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 42c3d46a8b8..f6f35356afc 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 @@ -989,6 +989,57 @@ paths: schema: $ref: '#/components/schemas/FileSchemaTestClass' required: true + /fake/test-query-paramters: + put: + tags: + - fake + description: To test the collection format in query parameters + operationId: testQueryParameterCollectionFormat + parameters: + - name: pipe + in: query + required: true + schema: + type: array + items: + type: string + - name: ioutil + in: query + required: true + style: form + explode: false + schema: + type: array + items: + type: string + - name: http + in: query + required: true + style: spaceDelimited + schema: + type: array + items: + type: string + - name: url + in: query + required: true + style: form + explode: false + schema: + type: array + items: + type: string + - name: context + in: query + required: true + explode: true + schema: + type: array + items: + type: string + responses: + "200": + description: Success '/fake/{petId}/uploadImageWithRequiredFile': post: tags: diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/README.md b/samples/client/petstore/csharp-netcore/OpenAPIClient/README.md index c2049be3127..46e3202f715 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/README.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/README.md @@ -104,6 +104,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**TestGroupParameters**](docs/FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *FakeApi* | [**TestInlineAdditionalProperties**](docs/FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties *FakeApi* | [**TestJsonFormData**](docs/FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data +*FakeApi* | [**TestQueryParameterCollectionFormat**](docs/FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-paramters | *FakeClassnameTags123Api* | [**TestClassname**](docs/FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case *PetApi* | [**AddPet**](docs/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store *PetApi* | [**DeletePet**](docs/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/FakeApi.md b/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/FakeApi.md index 0fd0f4dad71..2eaab420f32 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/FakeApi.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/FakeApi.md @@ -17,6 +17,7 @@ Method | HTTP request | Description [**TestGroupParameters**](FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**TestInlineAdditionalProperties**](FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties [**TestJsonFormData**](FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data +[**TestQueryParameterCollectionFormat**](FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-paramters | @@ -956,3 +957,78 @@ 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** +> void TestQueryParameterCollectionFormat (List pipe, List ioutil, List http, List url, List context) + + + +To test the collection format in query parameters + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestQueryParameterCollectionFormatExample + { + public static void Main() + { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); + var pipe = new List(); // List | + var ioutil = new List(); // List | + var http = new List(); // List | + var url = new List(); // List | + var context = new List(); // List | + + try + { + apiInstance.TestQueryParameterCollectionFormat(pipe, ioutil, http, url, context); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestQueryParameterCollectionFormat: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**List<string>**](string.md)| | + **ioutil** | [**List<string>**](string.md)| | + **http** | [**List<string>**](string.md)| | + **url** | [**List<string>**](string.md)| | + **context** | [**List<string>**](string.md)| | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + +[[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) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs index 8b68bb522b3..d483ee936df 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs @@ -354,6 +354,35 @@ namespace Org.OpenAPITools.Api /// field2 /// ApiResponse of Object(void) ApiResponse TestJsonFormDataWithHttpInfo (string param, string param2); + /// + /// + /// + /// + /// To test the collection format in query parameters + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + /// + /// + void TestQueryParameterCollectionFormat (List pipe, List ioutil, List http, List url, List context); + + /// + /// + /// + /// + /// To test the collection format in query parameters + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + /// + /// ApiResponse of Object(void) + ApiResponse TestQueryParameterCollectionFormatWithHttpInfo (List pipe, List ioutil, List http, List url, List context); #endregion Synchronous Operations } @@ -690,6 +719,35 @@ namespace Org.OpenAPITools.Api /// field2 /// Task of ApiResponse System.Threading.Tasks.Task> TestJsonFormDataAsyncWithHttpInfo (string param, string param2); + /// + /// + /// + /// + /// To test the collection format in query parameters + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + /// + /// Task of void + System.Threading.Tasks.Task TestQueryParameterCollectionFormatAsync (List pipe, List ioutil, List http, List url, List context); + + /// + /// + /// + /// + /// To test the collection format in query parameters + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + /// + /// Task of ApiResponse + System.Threading.Tasks.Task> TestQueryParameterCollectionFormatAsyncWithHttpInfo (List pipe, List ioutil, List http, List url, List context); #endregion Asynchronous Operations } @@ -2754,5 +2812,261 @@ namespace Org.OpenAPITools.Api return response; } + /// + /// To test the collection format in query parameters + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + /// + /// + public void TestQueryParameterCollectionFormat (List pipe, List ioutil, List http, List url, List context) + { + TestQueryParameterCollectionFormatWithHttpInfo(pipe, ioutil, http, url, context); + } + + /// + /// To test the collection format in query parameters + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + /// + /// ApiResponse of Object(void) + public Org.OpenAPITools.Client.ApiResponse TestQueryParameterCollectionFormatWithHttpInfo (List pipe, List ioutil, List http, List url, List context) + { + // verify the required parameter 'pipe' is set + if (pipe == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'pipe' when calling FakeApi->TestQueryParameterCollectionFormat"); + + // verify the required parameter 'ioutil' is set + if (ioutil == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'ioutil' when calling FakeApi->TestQueryParameterCollectionFormat"); + + // verify the required parameter 'http' is set + if (http == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'http' when calling FakeApi->TestQueryParameterCollectionFormat"); + + // verify the required parameter 'url' is set + if (url == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'url' when calling FakeApi->TestQueryParameterCollectionFormat"); + + // verify the required parameter 'context' is set + if (context == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'context' when calling FakeApi->TestQueryParameterCollectionFormat"); + + Org.OpenAPITools.Client.RequestOptions requestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + String[] @contentTypes = new String[] { + }; + + // to determine the Accept header + String[] @accepts = new String[] { + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(@contentTypes); + if (localVarContentType != null) requestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(@accepts); + if (localVarAccept != null) requestOptions.HeaderParameters.Add("Accept", localVarAccept); + + if (pipe != null) + { + foreach (var kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "pipe", pipe)) + { + foreach (var value in kvp.Value) + { + requestOptions.QueryParameters.Add(kvp.Key, value); + } + } + } + if (ioutil != null) + { + foreach (var kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "ioutil", ioutil)) + { + foreach (var value in kvp.Value) + { + requestOptions.QueryParameters.Add(kvp.Key, value); + } + } + } + if (http != null) + { + foreach (var kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("space", "http", http)) + { + foreach (var value in kvp.Value) + { + requestOptions.QueryParameters.Add(kvp.Key, value); + } + } + } + if (url != null) + { + foreach (var kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "url", url)) + { + foreach (var value in kvp.Value) + { + requestOptions.QueryParameters.Add(kvp.Key, value); + } + } + } + if (context != null) + { + foreach (var kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("multi", "context", context)) + { + foreach (var value in kvp.Value) + { + requestOptions.QueryParameters.Add(kvp.Key, value); + } + } + } + + + // make the HTTP request + + var response = this.Client.Put("/fake/test-query-paramters", requestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception exception = this.ExceptionFactory("TestQueryParameterCollectionFormat", response); + if (exception != null) throw exception; + } + + return response; + } + + /// + /// To test the collection format in query parameters + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + /// + /// Task of void + public async System.Threading.Tasks.Task TestQueryParameterCollectionFormatAsync (List pipe, List ioutil, List http, List url, List context) + { + await TestQueryParameterCollectionFormatAsyncWithHttpInfo(pipe, ioutil, http, url, context); + + } + + /// + /// To test the collection format in query parameters + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + /// + /// Task of ApiResponse + public async System.Threading.Tasks.Task> TestQueryParameterCollectionFormatAsyncWithHttpInfo (List pipe, List ioutil, List http, List url, List context) + { + // verify the required parameter 'pipe' is set + if (pipe == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'pipe' when calling FakeApi->TestQueryParameterCollectionFormat"); + + // verify the required parameter 'ioutil' is set + if (ioutil == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'ioutil' when calling FakeApi->TestQueryParameterCollectionFormat"); + + // verify the required parameter 'http' is set + if (http == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'http' when calling FakeApi->TestQueryParameterCollectionFormat"); + + // verify the required parameter 'url' is set + if (url == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'url' when calling FakeApi->TestQueryParameterCollectionFormat"); + + // verify the required parameter 'context' is set + if (context == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'context' when calling FakeApi->TestQueryParameterCollectionFormat"); + + + Org.OpenAPITools.Client.RequestOptions requestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + String[] @contentTypes = new String[] { + }; + + // to determine the Accept header + String[] @accepts = new String[] { + }; + + foreach (var contentType in @contentTypes) + requestOptions.HeaderParameters.Add("Content-Type", contentType); + + foreach (var accept in @accepts) + requestOptions.HeaderParameters.Add("Accept", accept); + + if (pipe != null) + { + foreach (var kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "pipe", pipe)) + { + foreach (var value in kvp.Value) + { + requestOptions.QueryParameters.Add(kvp.Key, value); + } + } + } + if (ioutil != null) + { + foreach (var kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "ioutil", ioutil)) + { + foreach (var value in kvp.Value) + { + requestOptions.QueryParameters.Add(kvp.Key, value); + } + } + } + if (http != null) + { + foreach (var kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("space", "http", http)) + { + foreach (var value in kvp.Value) + { + requestOptions.QueryParameters.Add(kvp.Key, value); + } + } + } + if (url != null) + { + foreach (var kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "url", url)) + { + foreach (var value in kvp.Value) + { + requestOptions.QueryParameters.Add(kvp.Key, value); + } + } + } + if (context != null) + { + foreach (var kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("multi", "context", context)) + { + foreach (var value in kvp.Value) + { + requestOptions.QueryParameters.Add(kvp.Key, value); + } + } + } + + + // make the HTTP request + + var response = await this.AsynchronousClient.PutAsync("/fake/test-query-paramters", requestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception exception = this.ExceptionFactory("TestQueryParameterCollectionFormat", response); + if (exception != null) throw exception; + } + + return response; + } + } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/README.md b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/README.md index 8ed98381bee..78b126b5641 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/README.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/README.md @@ -116,6 +116,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**TestGroupParameters**](docs/FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *FakeApi* | [**TestInlineAdditionalProperties**](docs/FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties *FakeApi* | [**TestJsonFormData**](docs/FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data +*FakeApi* | [**TestQueryParameterCollectionFormat**](docs/FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-paramters | *FakeClassnameTags123Api* | [**TestClassname**](docs/FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case *PetApi* | [**AddPet**](docs/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store *PetApi* | [**DeletePet**](docs/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/FakeApi.md b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/FakeApi.md index 0fd0f4dad71..2eaab420f32 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/FakeApi.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/FakeApi.md @@ -17,6 +17,7 @@ Method | HTTP request | Description [**TestGroupParameters**](FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**TestInlineAdditionalProperties**](FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties [**TestJsonFormData**](FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data +[**TestQueryParameterCollectionFormat**](FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-paramters | @@ -956,3 +957,78 @@ 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** +> void TestQueryParameterCollectionFormat (List pipe, List ioutil, List http, List url, List context) + + + +To test the collection format in query parameters + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestQueryParameterCollectionFormatExample + { + public static void Main() + { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); + var pipe = new List(); // List | + var ioutil = new List(); // List | + var http = new List(); // List | + var url = new List(); // List | + var context = new List(); // List | + + try + { + apiInstance.TestQueryParameterCollectionFormat(pipe, ioutil, http, url, context); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestQueryParameterCollectionFormat: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**List<string>**](string.md)| | + **ioutil** | [**List<string>**](string.md)| | + **http** | [**List<string>**](string.md)| | + **url** | [**List<string>**](string.md)| | + **context** | [**List<string>**](string.md)| | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + +[[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) + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/FakeApi.cs index 8b68bb522b3..d483ee936df 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/FakeApi.cs @@ -354,6 +354,35 @@ namespace Org.OpenAPITools.Api /// field2 /// ApiResponse of Object(void) ApiResponse TestJsonFormDataWithHttpInfo (string param, string param2); + /// + /// + /// + /// + /// To test the collection format in query parameters + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + /// + /// + void TestQueryParameterCollectionFormat (List pipe, List ioutil, List http, List url, List context); + + /// + /// + /// + /// + /// To test the collection format in query parameters + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + /// + /// ApiResponse of Object(void) + ApiResponse TestQueryParameterCollectionFormatWithHttpInfo (List pipe, List ioutil, List http, List url, List context); #endregion Synchronous Operations } @@ -690,6 +719,35 @@ namespace Org.OpenAPITools.Api /// field2 /// Task of ApiResponse System.Threading.Tasks.Task> TestJsonFormDataAsyncWithHttpInfo (string param, string param2); + /// + /// + /// + /// + /// To test the collection format in query parameters + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + /// + /// Task of void + System.Threading.Tasks.Task TestQueryParameterCollectionFormatAsync (List pipe, List ioutil, List http, List url, List context); + + /// + /// + /// + /// + /// To test the collection format in query parameters + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + /// + /// Task of ApiResponse + System.Threading.Tasks.Task> TestQueryParameterCollectionFormatAsyncWithHttpInfo (List pipe, List ioutil, List http, List url, List context); #endregion Asynchronous Operations } @@ -2754,5 +2812,261 @@ namespace Org.OpenAPITools.Api return response; } + /// + /// To test the collection format in query parameters + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + /// + /// + public void TestQueryParameterCollectionFormat (List pipe, List ioutil, List http, List url, List context) + { + TestQueryParameterCollectionFormatWithHttpInfo(pipe, ioutil, http, url, context); + } + + /// + /// To test the collection format in query parameters + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + /// + /// ApiResponse of Object(void) + public Org.OpenAPITools.Client.ApiResponse TestQueryParameterCollectionFormatWithHttpInfo (List pipe, List ioutil, List http, List url, List context) + { + // verify the required parameter 'pipe' is set + if (pipe == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'pipe' when calling FakeApi->TestQueryParameterCollectionFormat"); + + // verify the required parameter 'ioutil' is set + if (ioutil == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'ioutil' when calling FakeApi->TestQueryParameterCollectionFormat"); + + // verify the required parameter 'http' is set + if (http == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'http' when calling FakeApi->TestQueryParameterCollectionFormat"); + + // verify the required parameter 'url' is set + if (url == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'url' when calling FakeApi->TestQueryParameterCollectionFormat"); + + // verify the required parameter 'context' is set + if (context == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'context' when calling FakeApi->TestQueryParameterCollectionFormat"); + + Org.OpenAPITools.Client.RequestOptions requestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + String[] @contentTypes = new String[] { + }; + + // to determine the Accept header + String[] @accepts = new String[] { + }; + + var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(@contentTypes); + if (localVarContentType != null) requestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(@accepts); + if (localVarAccept != null) requestOptions.HeaderParameters.Add("Accept", localVarAccept); + + if (pipe != null) + { + foreach (var kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "pipe", pipe)) + { + foreach (var value in kvp.Value) + { + requestOptions.QueryParameters.Add(kvp.Key, value); + } + } + } + if (ioutil != null) + { + foreach (var kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "ioutil", ioutil)) + { + foreach (var value in kvp.Value) + { + requestOptions.QueryParameters.Add(kvp.Key, value); + } + } + } + if (http != null) + { + foreach (var kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("space", "http", http)) + { + foreach (var value in kvp.Value) + { + requestOptions.QueryParameters.Add(kvp.Key, value); + } + } + } + if (url != null) + { + foreach (var kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "url", url)) + { + foreach (var value in kvp.Value) + { + requestOptions.QueryParameters.Add(kvp.Key, value); + } + } + } + if (context != null) + { + foreach (var kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("multi", "context", context)) + { + foreach (var value in kvp.Value) + { + requestOptions.QueryParameters.Add(kvp.Key, value); + } + } + } + + + // make the HTTP request + + var response = this.Client.Put("/fake/test-query-paramters", requestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception exception = this.ExceptionFactory("TestQueryParameterCollectionFormat", response); + if (exception != null) throw exception; + } + + return response; + } + + /// + /// To test the collection format in query parameters + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + /// + /// Task of void + public async System.Threading.Tasks.Task TestQueryParameterCollectionFormatAsync (List pipe, List ioutil, List http, List url, List context) + { + await TestQueryParameterCollectionFormatAsyncWithHttpInfo(pipe, ioutil, http, url, context); + + } + + /// + /// To test the collection format in query parameters + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + /// + /// Task of ApiResponse + public async System.Threading.Tasks.Task> TestQueryParameterCollectionFormatAsyncWithHttpInfo (List pipe, List ioutil, List http, List url, List context) + { + // verify the required parameter 'pipe' is set + if (pipe == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'pipe' when calling FakeApi->TestQueryParameterCollectionFormat"); + + // verify the required parameter 'ioutil' is set + if (ioutil == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'ioutil' when calling FakeApi->TestQueryParameterCollectionFormat"); + + // verify the required parameter 'http' is set + if (http == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'http' when calling FakeApi->TestQueryParameterCollectionFormat"); + + // verify the required parameter 'url' is set + if (url == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'url' when calling FakeApi->TestQueryParameterCollectionFormat"); + + // verify the required parameter 'context' is set + if (context == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'context' when calling FakeApi->TestQueryParameterCollectionFormat"); + + + Org.OpenAPITools.Client.RequestOptions requestOptions = new Org.OpenAPITools.Client.RequestOptions(); + + String[] @contentTypes = new String[] { + }; + + // to determine the Accept header + String[] @accepts = new String[] { + }; + + foreach (var contentType in @contentTypes) + requestOptions.HeaderParameters.Add("Content-Type", contentType); + + foreach (var accept in @accepts) + requestOptions.HeaderParameters.Add("Accept", accept); + + if (pipe != null) + { + foreach (var kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "pipe", pipe)) + { + foreach (var value in kvp.Value) + { + requestOptions.QueryParameters.Add(kvp.Key, value); + } + } + } + if (ioutil != null) + { + foreach (var kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "ioutil", ioutil)) + { + foreach (var value in kvp.Value) + { + requestOptions.QueryParameters.Add(kvp.Key, value); + } + } + } + if (http != null) + { + foreach (var kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("space", "http", http)) + { + foreach (var value in kvp.Value) + { + requestOptions.QueryParameters.Add(kvp.Key, value); + } + } + } + if (url != null) + { + foreach (var kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "url", url)) + { + foreach (var value in kvp.Value) + { + requestOptions.QueryParameters.Add(kvp.Key, value); + } + } + } + if (context != null) + { + foreach (var kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("multi", "context", context)) + { + foreach (var value in kvp.Value) + { + requestOptions.QueryParameters.Add(kvp.Key, value); + } + } + } + + + // make the HTTP request + + var response = await this.AsynchronousClient.PutAsync("/fake/test-query-paramters", requestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception exception = this.ExceptionFactory("TestQueryParameterCollectionFormat", response); + if (exception != null) throw exception; + } + + return response; + } + } } diff --git a/samples/client/petstore/csharp/OpenAPIClient/README.md b/samples/client/petstore/csharp/OpenAPIClient/README.md index dcdb39631c5..7bd9201f88b 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/README.md +++ b/samples/client/petstore/csharp/OpenAPIClient/README.md @@ -119,6 +119,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**TestGroupParameters**](docs/FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *FakeApi* | [**TestInlineAdditionalProperties**](docs/FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties *FakeApi* | [**TestJsonFormData**](docs/FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data +*FakeApi* | [**TestQueryParameterCollectionFormat**](docs/FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-paramters | *FakeClassnameTags123Api* | [**TestClassname**](docs/FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case *PetApi* | [**AddPet**](docs/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store *PetApi* | [**DeletePet**](docs/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet diff --git a/samples/client/petstore/csharp/OpenAPIClient/docs/FakeApi.md b/samples/client/petstore/csharp/OpenAPIClient/docs/FakeApi.md index 2738b9e1853..a295fe0554f 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/docs/FakeApi.md +++ b/samples/client/petstore/csharp/OpenAPIClient/docs/FakeApi.md @@ -17,6 +17,7 @@ Method | HTTP request | Description [**TestGroupParameters**](FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**TestInlineAdditionalProperties**](FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties [**TestJsonFormData**](FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data +[**TestQueryParameterCollectionFormat**](FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-paramters | @@ -1034,3 +1035,84 @@ No authorization required [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +## TestQueryParameterCollectionFormat + +> void TestQueryParameterCollectionFormat (List pipe, List ioutil, List http, List url, List context) + + + +To test the collection format in query parameters + +### Example + +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestQueryParameterCollectionFormatExample + { + public static void Main() + { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); + var pipe = new List(); // List | + var ioutil = new List(); // List | + var http = new List(); // List | + var url = new List(); // List | + var context = new List(); // List | + + try + { + apiInstance.TestQueryParameterCollectionFormat(pipe, ioutil, http, url, context); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestQueryParameterCollectionFormat: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**List<string>**](string.md)| | + **ioutil** | [**List<string>**](string.md)| | + **http** | [**List<string>**](string.md)| | + **url** | [**List<string>**](string.md)| | + **context** | [**List<string>**](string.md)| | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + +[[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) + 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 b352cdd30cf..bc14d5e90f5 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 @@ -351,6 +351,35 @@ namespace Org.OpenAPITools.Api /// field2 /// ApiResponse of Object(void) ApiResponse TestJsonFormDataWithHttpInfo (string param, string param2); + /// + /// + /// + /// + /// To test the collection format in query parameters + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + /// + /// + void TestQueryParameterCollectionFormat (List pipe, List ioutil, List http, List url, List context); + + /// + /// + /// + /// + /// To test the collection format in query parameters + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + /// + /// ApiResponse of Object(void) + ApiResponse TestQueryParameterCollectionFormatWithHttpInfo (List pipe, List ioutil, List http, List url, List context); #endregion Synchronous Operations #region Asynchronous Operations /// @@ -680,6 +709,35 @@ namespace Org.OpenAPITools.Api /// field2 /// Task of ApiResponse System.Threading.Tasks.Task> TestJsonFormDataAsyncWithHttpInfo (string param, string param2); + /// + /// + /// + /// + /// To test the collection format in query parameters + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + /// + /// Task of void + System.Threading.Tasks.Task TestQueryParameterCollectionFormatAsync (List pipe, List ioutil, List http, List url, List context); + + /// + /// + /// + /// + /// To test the collection format in query parameters + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + /// + /// Task of ApiResponse + System.Threading.Tasks.Task> TestQueryParameterCollectionFormatAsyncWithHttpInfo (List pipe, List ioutil, List http, List url, List context); #endregion Asynchronous Operations } @@ -2826,5 +2884,182 @@ namespace Org.OpenAPITools.Api null); } + /// + /// To test the collection format in query parameters + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + /// + /// + public void TestQueryParameterCollectionFormat (List pipe, List ioutil, List http, List url, List context) + { + TestQueryParameterCollectionFormatWithHttpInfo(pipe, ioutil, http, url, context); + } + + /// + /// To test the collection format in query parameters + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + /// + /// ApiResponse of Object(void) + public ApiResponse TestQueryParameterCollectionFormatWithHttpInfo (List pipe, List ioutil, List http, List url, List context) + { + // verify the required parameter 'pipe' is set + if (pipe == null) + throw new ApiException(400, "Missing required parameter 'pipe' when calling FakeApi->TestQueryParameterCollectionFormat"); + // verify the required parameter 'ioutil' is set + if (ioutil == null) + throw new ApiException(400, "Missing required parameter 'ioutil' when calling FakeApi->TestQueryParameterCollectionFormat"); + // verify the required parameter 'http' is set + if (http == null) + throw new ApiException(400, "Missing required parameter 'http' when calling FakeApi->TestQueryParameterCollectionFormat"); + // verify the required parameter 'url' is set + if (url == null) + throw new ApiException(400, "Missing required parameter 'url' when calling FakeApi->TestQueryParameterCollectionFormat"); + // verify the required parameter 'context' is set + if (context == null) + throw new ApiException(400, "Missing required parameter 'context' when calling FakeApi->TestQueryParameterCollectionFormat"); + + var localVarPath = "/fake/test-query-paramters"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (pipe != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "pipe", pipe)); // query parameter + if (ioutil != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "ioutil", ioutil)); // query parameter + if (http != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("space", "http", http)); // query parameter + 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 + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, + Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("TestQueryParameterCollectionFormat", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + null); + } + + /// + /// To test the collection format in query parameters + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + /// + /// Task of void + public async System.Threading.Tasks.Task TestQueryParameterCollectionFormatAsync (List pipe, List ioutil, List http, List url, List context) + { + await TestQueryParameterCollectionFormatAsyncWithHttpInfo(pipe, ioutil, http, url, context); + + } + + /// + /// To test the collection format in query parameters + /// + /// Thrown when fails to make API call + /// + /// + /// + /// + /// + /// Task of ApiResponse + public async System.Threading.Tasks.Task> TestQueryParameterCollectionFormatAsyncWithHttpInfo (List pipe, List ioutil, List http, List url, List context) + { + // verify the required parameter 'pipe' is set + if (pipe == null) + throw new ApiException(400, "Missing required parameter 'pipe' when calling FakeApi->TestQueryParameterCollectionFormat"); + // verify the required parameter 'ioutil' is set + if (ioutil == null) + throw new ApiException(400, "Missing required parameter 'ioutil' when calling FakeApi->TestQueryParameterCollectionFormat"); + // verify the required parameter 'http' is set + if (http == null) + throw new ApiException(400, "Missing required parameter 'http' when calling FakeApi->TestQueryParameterCollectionFormat"); + // verify the required parameter 'url' is set + if (url == null) + throw new ApiException(400, "Missing required parameter 'url' when calling FakeApi->TestQueryParameterCollectionFormat"); + // verify the required parameter 'context' is set + if (context == null) + throw new ApiException(400, "Missing required parameter 'context' when calling FakeApi->TestQueryParameterCollectionFormat"); + + var localVarPath = "/fake/test-query-paramters"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (pipe != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "pipe", pipe)); // query parameter + if (ioutil != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("csv", "ioutil", ioutil)); // query parameter + if (http != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("space", "http", http)); // query parameter + 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 + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, + Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("TestQueryParameterCollectionFormat", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), + null); + } + } } 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 4ce435258ce..da8f94e239c 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/api/fake.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/api/fake.ex @@ -429,4 +429,38 @@ defmodule OpenapiPetstore.Api.Fake do { 200, false} ]) end + + @doc """ + To test the collection format in query parameters + + ## Parameters + + - connection (OpenapiPetstore.Connection): Connection to server + - pipe ([String.t]): + - ioutil ([String.t]): + - http ([String.t]): + - url ([String.t]): + - context ([String.t]): + - opts (KeywordList): [optional] Optional parameters + ## Returns + + {:ok, %{}} on success + {:error, info} 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 + %{} + |> method(:put) + |> url("/fake/test-query-paramters") + |> add_param(:query, :"pipe", pipe) + |> add_param(:query, :"ioutil", ioutil) + |> add_param(:query, :"http", http) + |> add_param(:query, :"url", url) + |> add_param(:query, :"context", context) + |> Enum.into([]) + |> (&Connection.request(connection, &1)).() + |> evaluate_response([ + { 200, false} + ]) + end end diff --git a/samples/client/petstore/go/go-petstore-withXml/README.md b/samples/client/petstore/go/go-petstore-withXml/README.md index a0aa0040ef3..052b43c30a6 100644 --- a/samples/client/petstore/go/go-petstore-withXml/README.md +++ b/samples/client/petstore/go/go-petstore-withXml/README.md @@ -46,6 +46,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**TestGroupParameters**](docs/FakeApi.md#testgroupparameters) | **Delete** /fake | Fake endpoint to test group parameters (optional) *FakeApi* | [**TestInlineAdditionalProperties**](docs/FakeApi.md#testinlineadditionalproperties) | **Post** /fake/inline-additionalProperties | test inline additionalProperties *FakeApi* | [**TestJsonFormData**](docs/FakeApi.md#testjsonformdata) | **Get** /fake/jsonFormData | test json serialization of form data +*FakeApi* | [**TestQueryParameterCollectionFormat**](docs/FakeApi.md#testqueryparametercollectionformat) | **Put** /fake/test-query-paramters | *FakeClassnameTags123Api* | [**TestClassname**](docs/FakeClassnameTags123Api.md#testclassname) | **Patch** /fake_classname_test | To test class name in snake case *PetApi* | [**AddPet**](docs/PetApi.md#addpet) | **Post** /pet | Add a new pet to the store *PetApi* | [**DeletePet**](docs/PetApi.md#deletepet) | **Delete** /pet/{petId} | Deletes a pet diff --git a/samples/client/petstore/go/go-petstore-withXml/api/openapi.yaml b/samples/client/petstore/go/go-petstore-withXml/api/openapi.yaml index 5a020a1d0ab..914eb27b5a4 100644 --- a/samples/client/petstore/go/go-petstore-withXml/api/openapi.yaml +++ b/samples/client/petstore/go/go-petstore-withXml/api/openapi.yaml @@ -1100,6 +1100,59 @@ paths: tags: - fake x-codegen-request-body-name: body + /fake/test-query-paramters: + put: + description: To test the collection format in query parameters + operationId: testQueryParameterCollectionFormat + parameters: + - explode: false + in: query + name: pipe + required: true + schema: + items: + type: string + type: array + style: form + - in: query + name: ioutil + required: true + schema: + items: + type: string + type: array + - in: query + name: http + required: true + schema: + items: + type: string + type: array + style: spaceDelimited + - explode: false + in: query + name: url + required: true + schema: + items: + type: string + type: array + style: form + - explode: true + in: query + name: context + required: true + schema: + items: + type: string + type: array + style: form + responses: + 200: + content: {} + description: Success + tags: + - fake /fake/{petId}/uploadImageWithRequiredFile: post: operationId: uploadFileWithRequiredFile diff --git a/samples/client/petstore/go/go-petstore-withXml/api_fake.go b/samples/client/petstore/go/go-petstore-withXml/api_fake.go index 20f3b53809b..8936ce37c0c 100644 --- a/samples/client/petstore/go/go-petstore-withXml/api_fake.go +++ b/samples/client/petstore/go/go-petstore-withXml/api_fake.go @@ -17,6 +17,7 @@ import ( _neturl "net/url" "github.com/antihax/optional" "os" + "reflect" ) // Linger please @@ -1207,3 +1208,86 @@ func (a *FakeApiService) TestJsonFormData(ctx _context.Context, param string, pa return localVarHttpResponse, nil } + +/* +FakeApiService +To test the collection format in query parameters + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param pipe + * @param ioutil + * @param http + * @param url + * @param context +*/ +func (a *FakeApiService) TestQueryParameterCollectionFormat(ctx _context.Context, pipe []string, ioutil []string, http []string, url []string, context []string) (*_nethttp.Response, error) { + var ( + localVarHttpMethod = _nethttp.MethodPut + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/fake/test-query-paramters" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + localVarQueryParams.Add("pipe", parameterToString(pipe, "csv")) + localVarQueryParams.Add("ioutil", parameterToString(ioutil, "csv")) + localVarQueryParams.Add("http", parameterToString(http, "space")) + localVarQueryParams.Add("url", parameterToString(url, "csv")) + t:=context + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + localVarQueryParams.Add("context", parameterToString(s.Index(i), "multi")) + } + } else { + localVarQueryParams.Add("context", parameterToString(t, "multi")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} diff --git a/samples/client/petstore/go/go-petstore-withXml/docs/FakeApi.md b/samples/client/petstore/go/go-petstore-withXml/docs/FakeApi.md index b7927f181e4..9aaf2e63a96 100644 --- a/samples/client/petstore/go/go-petstore-withXml/docs/FakeApi.md +++ b/samples/client/petstore/go/go-petstore-withXml/docs/FakeApi.md @@ -17,6 +17,7 @@ Method | HTTP request | Description [**TestGroupParameters**](FakeApi.md#TestGroupParameters) | **Delete** /fake | Fake endpoint to test group parameters (optional) [**TestInlineAdditionalProperties**](FakeApi.md#TestInlineAdditionalProperties) | **Post** /fake/inline-additionalProperties | test inline additionalProperties [**TestJsonFormData**](FakeApi.md#TestJsonFormData) | **Get** /fake/jsonFormData | test json serialization of form data +[**TestQueryParameterCollectionFormat**](FakeApi.md#TestQueryParameterCollectionFormat) | **Put** /fake/test-query-paramters | @@ -539,3 +540,40 @@ No authorization required [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +## TestQueryParameterCollectionFormat + +> TestQueryParameterCollectionFormat(ctx, pipe, ioutil, http, url, context) + + +To test the collection format in query parameters + +### Required Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**pipe** | [**[]string**](string.md)| | +**ioutil** | [**[]string**](string.md)| | +**http** | [**[]string**](string.md)| | +**url** | [**[]string**](string.md)| | +**context** | [**[]string**](string.md)| | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[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) + diff --git a/samples/client/petstore/go/go-petstore/README.md b/samples/client/petstore/go/go-petstore/README.md index a0aa0040ef3..052b43c30a6 100644 --- a/samples/client/petstore/go/go-petstore/README.md +++ b/samples/client/petstore/go/go-petstore/README.md @@ -46,6 +46,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**TestGroupParameters**](docs/FakeApi.md#testgroupparameters) | **Delete** /fake | Fake endpoint to test group parameters (optional) *FakeApi* | [**TestInlineAdditionalProperties**](docs/FakeApi.md#testinlineadditionalproperties) | **Post** /fake/inline-additionalProperties | test inline additionalProperties *FakeApi* | [**TestJsonFormData**](docs/FakeApi.md#testjsonformdata) | **Get** /fake/jsonFormData | test json serialization of form data +*FakeApi* | [**TestQueryParameterCollectionFormat**](docs/FakeApi.md#testqueryparametercollectionformat) | **Put** /fake/test-query-paramters | *FakeClassnameTags123Api* | [**TestClassname**](docs/FakeClassnameTags123Api.md#testclassname) | **Patch** /fake_classname_test | To test class name in snake case *PetApi* | [**AddPet**](docs/PetApi.md#addpet) | **Post** /pet | Add a new pet to the store *PetApi* | [**DeletePet**](docs/PetApi.md#deletepet) | **Delete** /pet/{petId} | Deletes a pet diff --git a/samples/client/petstore/go/go-petstore/api/openapi.yaml b/samples/client/petstore/go/go-petstore/api/openapi.yaml index 5a020a1d0ab..914eb27b5a4 100644 --- a/samples/client/petstore/go/go-petstore/api/openapi.yaml +++ b/samples/client/petstore/go/go-petstore/api/openapi.yaml @@ -1100,6 +1100,59 @@ paths: tags: - fake x-codegen-request-body-name: body + /fake/test-query-paramters: + put: + description: To test the collection format in query parameters + operationId: testQueryParameterCollectionFormat + parameters: + - explode: false + in: query + name: pipe + required: true + schema: + items: + type: string + type: array + style: form + - in: query + name: ioutil + required: true + schema: + items: + type: string + type: array + - in: query + name: http + required: true + schema: + items: + type: string + type: array + style: spaceDelimited + - explode: false + in: query + name: url + required: true + schema: + items: + type: string + type: array + style: form + - explode: true + in: query + name: context + required: true + schema: + items: + type: string + type: array + style: form + responses: + 200: + content: {} + description: Success + tags: + - fake /fake/{petId}/uploadImageWithRequiredFile: post: operationId: uploadFileWithRequiredFile diff --git a/samples/client/petstore/go/go-petstore/api_fake.go b/samples/client/petstore/go/go-petstore/api_fake.go index 78f3fb35c75..ebf9bd58953 100644 --- a/samples/client/petstore/go/go-petstore/api_fake.go +++ b/samples/client/petstore/go/go-petstore/api_fake.go @@ -16,6 +16,7 @@ import ( _neturl "net/url" "github.com/antihax/optional" "os" + "reflect" ) // Linger please @@ -1206,3 +1207,86 @@ func (a *FakeApiService) TestJsonFormData(ctx _context.Context, param string, pa return localVarHttpResponse, nil } + +/* +FakeApiService +To test the collection format in query parameters + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param pipe + * @param ioutil + * @param http + * @param url + * @param context +*/ +func (a *FakeApiService) TestQueryParameterCollectionFormat(ctx _context.Context, pipe []string, ioutil []string, http []string, url []string, context []string) (*_nethttp.Response, error) { + var ( + localVarHttpMethod = _nethttp.MethodPut + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/fake/test-query-paramters" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + localVarQueryParams.Add("pipe", parameterToString(pipe, "csv")) + localVarQueryParams.Add("ioutil", parameterToString(ioutil, "csv")) + localVarQueryParams.Add("http", parameterToString(http, "space")) + localVarQueryParams.Add("url", parameterToString(url, "csv")) + t:=context + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + localVarQueryParams.Add("context", parameterToString(s.Index(i), "multi")) + } + } else { + localVarQueryParams.Add("context", parameterToString(t, "multi")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} diff --git a/samples/client/petstore/go/go-petstore/docs/FakeApi.md b/samples/client/petstore/go/go-petstore/docs/FakeApi.md index b7927f181e4..9aaf2e63a96 100644 --- a/samples/client/petstore/go/go-petstore/docs/FakeApi.md +++ b/samples/client/petstore/go/go-petstore/docs/FakeApi.md @@ -17,6 +17,7 @@ Method | HTTP request | Description [**TestGroupParameters**](FakeApi.md#TestGroupParameters) | **Delete** /fake | Fake endpoint to test group parameters (optional) [**TestInlineAdditionalProperties**](FakeApi.md#TestInlineAdditionalProperties) | **Post** /fake/inline-additionalProperties | test inline additionalProperties [**TestJsonFormData**](FakeApi.md#TestJsonFormData) | **Get** /fake/jsonFormData | test json serialization of form data +[**TestQueryParameterCollectionFormat**](FakeApi.md#TestQueryParameterCollectionFormat) | **Put** /fake/test-query-paramters | @@ -539,3 +540,40 @@ No authorization required [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +## TestQueryParameterCollectionFormat + +> TestQueryParameterCollectionFormat(ctx, pipe, ioutil, http, url, context) + + +To test the collection format in query parameters + +### Required Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**pipe** | [**[]string**](string.md)| | +**ioutil** | [**[]string**](string.md)| | +**http** | [**[]string**](string.md)| | +**url** | [**[]string**](string.md)| | +**context** | [**[]string**](string.md)| | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[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) + diff --git a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/API/Fake.hs b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/API/Fake.hs index 9e8a52b2522..04497a97bdc 100644 --- a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/API/Fake.hs +++ b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/API/Fake.hs @@ -504,3 +504,28 @@ instance Consumes TestJsonFormData MimeFormUrlEncoded instance Produces TestJsonFormData MimeNoContent + +-- *** testQueryParameterCollectionFormat + +-- | @PUT \/fake\/test-query-paramters@ +-- +-- To test the collection format in query parameters +-- +testQueryParameterCollectionFormat + :: Pipe -- ^ "pipe" + -> Ioutil -- ^ "ioutil" + -> Http -- ^ "http" + -> Url -- ^ "url" + -> Context -- ^ "context" + -> OpenAPIPetstoreRequest TestQueryParameterCollectionFormat MimeNoContent NoContent MimeNoContent +testQueryParameterCollectionFormat (Pipe pipe) (Ioutil ioutil) (Http http) (Url url) (Context context) = + _mkRequest "PUT" ["/fake/test-query-paramters"] + `setQuery` toQueryColl CommaSeparated ("pipe", Just pipe) + `setQuery` toQueryColl CommaSeparated ("ioutil", Just ioutil) + `setQuery` toQueryColl SpaceSeparated ("http", Just http) + `setQuery` toQueryColl CommaSeparated ("url", Just url) + `setQuery` toQueryColl MultiParamArray ("context", Just context) + +data TestQueryParameterCollectionFormat +instance Produces TestQueryParameterCollectionFormat MimeNoContent + diff --git a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Model.hs b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Model.hs index 8c0e231b0ed..9ad86076662 100644 --- a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Model.hs +++ b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Model.hs @@ -93,6 +93,9 @@ newtype Byte = Byte { unByte :: ByteArray } deriving (P.Eq, P.Show) -- ** Callback newtype Callback = Callback { unCallback :: Text } deriving (P.Eq, P.Show) +-- ** Context +newtype Context = Context { unContext :: [Text] } deriving (P.Eq, P.Show) + -- ** EnumFormString newtype EnumFormString = EnumFormString { unEnumFormString :: E'EnumFormString } deriving (P.Eq, P.Show) @@ -120,6 +123,9 @@ newtype EnumQueryStringArray = EnumQueryStringArray { unEnumQueryStringArray :: -- ** File2 newtype File2 = File2 { unFile2 :: FilePath } deriving (P.Eq, P.Show) +-- ** Http +newtype Http = Http { unHttp :: [Text] } deriving (P.Eq, P.Show) + -- ** Int32 newtype Int32 = Int32 { unInt32 :: Int } deriving (P.Eq, P.Show) @@ -129,6 +135,9 @@ newtype Int64 = Int64 { unInt64 :: Integer } deriving (P.Eq, P.Show) -- ** Int64Group newtype Int64Group = Int64Group { unInt64Group :: Integer } deriving (P.Eq, P.Show) +-- ** Ioutil +newtype Ioutil = Ioutil { unIoutil :: [Text] } deriving (P.Eq, P.Show) + -- ** Name2 newtype Name2 = Name2 { unName2 :: Text } deriving (P.Eq, P.Show) @@ -180,6 +189,9 @@ newtype PatternWithoutDelimiter = PatternWithoutDelimiter { unPatternWithoutDeli -- ** PetId newtype PetId = PetId { unPetId :: Integer } deriving (P.Eq, P.Show) +-- ** Pipe +newtype Pipe = Pipe { unPipe :: [Text] } deriving (P.Eq, P.Show) + -- ** Query newtype Query = Query { unQuery :: Text } deriving (P.Eq, P.Show) @@ -207,6 +219,9 @@ newtype StringGroup = StringGroup { unStringGroup :: Int } deriving (P.Eq, P.Sho -- ** Tags newtype Tags = Tags { unTags :: [Text] } deriving (P.Eq, P.Show) +-- ** Url +newtype Url = Url { unUrl :: [Text] } deriving (P.Eq, P.Show) + -- ** Username newtype Username = Username { unUsername :: Text } deriving (P.Eq, P.Show) diff --git a/samples/client/petstore/haskell-http-client/openapi.yaml b/samples/client/petstore/haskell-http-client/openapi.yaml index 5a020a1d0ab..914eb27b5a4 100644 --- a/samples/client/petstore/haskell-http-client/openapi.yaml +++ b/samples/client/petstore/haskell-http-client/openapi.yaml @@ -1100,6 +1100,59 @@ paths: tags: - fake x-codegen-request-body-name: body + /fake/test-query-paramters: + put: + description: To test the collection format in query parameters + operationId: testQueryParameterCollectionFormat + parameters: + - explode: false + in: query + name: pipe + required: true + schema: + items: + type: string + type: array + style: form + - in: query + name: ioutil + required: true + schema: + items: + type: string + type: array + - in: query + name: http + required: true + schema: + items: + type: string + type: array + style: spaceDelimited + - explode: false + in: query + name: url + required: true + schema: + items: + type: string + type: array + style: form + - explode: true + in: query + name: context + required: true + schema: + items: + type: string + type: array + style: form + responses: + 200: + content: {} + description: Success + tags: + - fake /fake/{petId}/uploadImageWithRequiredFile: post: operationId: uploadFileWithRequiredFile 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 d77963bac45..601e2527eed 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 @@ -353,4 +353,70 @@ public interface FakeApi extends ApiClient.Api { "Accept: application/json", }) void testJsonFormData(@Param("param") String param, @Param("param2") String param2); + + /** + * + * To test the collection format in query parameters + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + */ + @RequestLine("PUT /fake/test-query-paramters?pipe={pipe}&ioutil={ioutil}&http={http}&url={url}&context={context}") + @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); + + /** + * + * To test the collection format in query parameters + * Note, this is equivalent to the other testQueryParameterCollectionFormat method, + * but with the query parameters collected into a single Map parameter. This + * is convenient for services with optional query parameters, especially when + * used with the {@link TestQueryParameterCollectionFormatQueryParams} class that allows for + * building up this map in a fluent style. + * @param queryParams Map of query parameters as name-value pairs + *

The following elements may be specified in the query map:

+ *
    + *
  • pipe - (required)
  • + *
  • ioutil - (required)
  • + *
  • http - (required)
  • + *
  • url - (required)
  • + *
  • context - (required)
  • + *
+ */ + @RequestLine("PUT /fake/test-query-paramters?pipe={pipe}&ioutil={ioutil}&http={http}&url={url}&context={context}") + @Headers({ + "Accept: application/json", + }) + void testQueryParameterCollectionFormat(@QueryMap(encoded=true) Map queryParams); + + /** + * A convenience class for generating query parameters for the + * testQueryParameterCollectionFormat method in a fluent style. + */ + public static class TestQueryParameterCollectionFormatQueryParams extends HashMap { + public TestQueryParameterCollectionFormatQueryParams pipe(final List value) { + put("pipe", EncodingUtils.encodeCollection(value, "csv")); + return this; + } + public TestQueryParameterCollectionFormatQueryParams ioutil(final List value) { + put("ioutil", EncodingUtils.encodeCollection(value, "csv")); + return this; + } + public TestQueryParameterCollectionFormatQueryParams http(final List value) { + put("http", EncodingUtils.encodeCollection(value, "space")); + return this; + } + public TestQueryParameterCollectionFormatQueryParams url(final List value) { + put("url", EncodingUtils.encodeCollection(value, "csv")); + return this; + } + public TestQueryParameterCollectionFormatQueryParams context(final List value) { + put("context", EncodingUtils.encodeCollection(value, "multi")); + return this; + } + } } diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/api/FakeApi.java index d77963bac45..601e2527eed 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/api/FakeApi.java @@ -353,4 +353,70 @@ public interface FakeApi extends ApiClient.Api { "Accept: application/json", }) void testJsonFormData(@Param("param") String param, @Param("param2") String param2); + + /** + * + * To test the collection format in query parameters + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + */ + @RequestLine("PUT /fake/test-query-paramters?pipe={pipe}&ioutil={ioutil}&http={http}&url={url}&context={context}") + @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); + + /** + * + * To test the collection format in query parameters + * Note, this is equivalent to the other testQueryParameterCollectionFormat method, + * but with the query parameters collected into a single Map parameter. This + * is convenient for services with optional query parameters, especially when + * used with the {@link TestQueryParameterCollectionFormatQueryParams} class that allows for + * building up this map in a fluent style. + * @param queryParams Map of query parameters as name-value pairs + *

The following elements may be specified in the query map:

+ *
    + *
  • pipe - (required)
  • + *
  • ioutil - (required)
  • + *
  • http - (required)
  • + *
  • url - (required)
  • + *
  • context - (required)
  • + *
+ */ + @RequestLine("PUT /fake/test-query-paramters?pipe={pipe}&ioutil={ioutil}&http={http}&url={url}&context={context}") + @Headers({ + "Accept: application/json", + }) + void testQueryParameterCollectionFormat(@QueryMap(encoded=true) Map queryParams); + + /** + * A convenience class for generating query parameters for the + * testQueryParameterCollectionFormat method in a fluent style. + */ + public static class TestQueryParameterCollectionFormatQueryParams extends HashMap { + public TestQueryParameterCollectionFormatQueryParams pipe(final List value) { + put("pipe", EncodingUtils.encodeCollection(value, "csv")); + return this; + } + public TestQueryParameterCollectionFormatQueryParams ioutil(final List value) { + put("ioutil", EncodingUtils.encodeCollection(value, "csv")); + return this; + } + public TestQueryParameterCollectionFormatQueryParams http(final List value) { + put("http", EncodingUtils.encodeCollection(value, "space")); + return this; + } + public TestQueryParameterCollectionFormatQueryParams url(final List value) { + put("url", EncodingUtils.encodeCollection(value, "csv")); + return this; + } + public TestQueryParameterCollectionFormatQueryParams context(final List value) { + put("context", EncodingUtils.encodeCollection(value, "multi")); + return this; + } + } } diff --git a/samples/client/petstore/java/google-api-client/docs/FakeApi.md b/samples/client/petstore/java/google-api-client/docs/FakeApi.md index 9a2e4770201..bc84c13561e 100644 --- a/samples/client/petstore/java/google-api-client/docs/FakeApi.md +++ b/samples/client/petstore/java/google-api-client/docs/FakeApi.md @@ -17,6 +17,7 @@ Method | HTTP request | Description [**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data +[**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-paramters | @@ -912,3 +913,75 @@ No authorization required |-------------|-------------|------------------| | **200** | successful operation | - | + +## testQueryParameterCollectionFormat + +> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context) + + + +To test the collection format in query parameters + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + List pipe = Arrays.asList(); // List | + List ioutil = Arrays.asList(); // List | + List http = Arrays.asList(); // List | + List url = Arrays.asList(); // List | + List context = Arrays.asList(); // List | + try { + apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testQueryParameterCollectionFormat"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**List<String>**](String.md)| | + **ioutil** | [**List<String>**](String.md)| | + **http** | [**List<String>**](String.md)| | + **url** | [**List<String>**](String.md)| | + **context** | [**List<String>**](String.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/AnotherFakeApi.java index b17ee1bb954..e24d44fdb2c 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -76,8 +76,8 @@ public class AnotherFakeApi { } UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/another-fake/dummy"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = apiClient.new JacksonJsonHttpContent(body); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.PATCH, genericUrl, content).execute(); @@ -90,8 +90,8 @@ public class AnotherFakeApi { } UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/another-fake/dummy"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = body == null ? apiClient.new JacksonJsonHttpContent(null) : @@ -124,8 +124,8 @@ public class AnotherFakeApi { } } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = apiClient.new JacksonJsonHttpContent(body); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.PATCH, genericUrl, content).execute(); diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/FakeApi.java index 8f19ffa8b93..0d3e6189c2b 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/FakeApi.java @@ -78,8 +78,8 @@ public class FakeApi { } UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake/create_xml_item"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = apiClient.new JacksonJsonHttpContent(xmlItem); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); @@ -92,8 +92,8 @@ public class FakeApi { } UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake/create_xml_item"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = xmlItem == null ? apiClient.new JacksonJsonHttpContent(null) : @@ -126,8 +126,8 @@ public class FakeApi { } } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = apiClient.new JacksonJsonHttpContent(xmlItem); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); @@ -164,8 +164,8 @@ public class FakeApi { UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake/outer/boolean"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = apiClient.new JacksonJsonHttpContent(body); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); @@ -175,8 +175,8 @@ public class FakeApi { UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake/outer/boolean"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = body == null ? apiClient.new JacksonJsonHttpContent(null) : @@ -206,8 +206,8 @@ public class FakeApi { } } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = apiClient.new JacksonJsonHttpContent(body); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); @@ -244,8 +244,8 @@ public class FakeApi { UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake/outer/composite"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = apiClient.new JacksonJsonHttpContent(body); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); @@ -255,8 +255,8 @@ public class FakeApi { UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake/outer/composite"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = body == null ? apiClient.new JacksonJsonHttpContent(null) : @@ -286,8 +286,8 @@ public class FakeApi { } } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = apiClient.new JacksonJsonHttpContent(body); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); @@ -324,8 +324,8 @@ public class FakeApi { UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake/outer/number"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = apiClient.new JacksonJsonHttpContent(body); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); @@ -335,8 +335,8 @@ public class FakeApi { UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake/outer/number"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = body == null ? apiClient.new JacksonJsonHttpContent(null) : @@ -366,8 +366,8 @@ public class FakeApi { } } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = apiClient.new JacksonJsonHttpContent(body); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); @@ -404,8 +404,8 @@ public class FakeApi { UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake/outer/string"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = apiClient.new JacksonJsonHttpContent(body); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); @@ -415,8 +415,8 @@ public class FakeApi { UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake/outer/string"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = body == null ? apiClient.new JacksonJsonHttpContent(null) : @@ -446,8 +446,8 @@ public class FakeApi { } } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = apiClient.new JacksonJsonHttpContent(body); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); @@ -482,8 +482,8 @@ public class FakeApi { } UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake/body-with-file-schema"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = apiClient.new JacksonJsonHttpContent(body); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.PUT, genericUrl, content).execute(); @@ -496,8 +496,8 @@ public class FakeApi { } UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake/body-with-file-schema"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = body == null ? apiClient.new JacksonJsonHttpContent(null) : @@ -530,8 +530,8 @@ public class FakeApi { } } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = apiClient.new JacksonJsonHttpContent(body); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.PUT, genericUrl, content).execute(); @@ -580,8 +580,8 @@ public class FakeApi { } } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = apiClient.new JacksonJsonHttpContent(body); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.PUT, genericUrl, content).execute(); @@ -608,8 +608,8 @@ public class FakeApi { } } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = body == null ? apiClient.new JacksonJsonHttpContent(null) : @@ -647,8 +647,8 @@ public class FakeApi { } } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = apiClient.new JacksonJsonHttpContent(body); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.PUT, genericUrl, content).execute(); @@ -691,8 +691,8 @@ public class FakeApi { } UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = apiClient.new JacksonJsonHttpContent(body); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.PATCH, genericUrl, content).execute(); @@ -705,8 +705,8 @@ public class FakeApi { } UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = body == null ? apiClient.new JacksonJsonHttpContent(null) : @@ -739,8 +739,8 @@ public class FakeApi { } } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = apiClient.new JacksonJsonHttpContent(body); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.PATCH, genericUrl, content).execute(); @@ -804,8 +804,8 @@ public class FakeApi { } UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = apiClient.new JacksonJsonHttpContent(null); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); @@ -845,8 +845,8 @@ public class FakeApi { } } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = apiClient.new JacksonJsonHttpContent(null); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); @@ -929,8 +929,8 @@ public class FakeApi { } } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = null; return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content).execute(); @@ -958,8 +958,8 @@ public class FakeApi { } } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = null; return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content).execute(); @@ -1050,8 +1050,8 @@ public class FakeApi { } } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = null; return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.DELETE, genericUrl, content).execute(); @@ -1092,8 +1092,8 @@ public class FakeApi { } } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = null; return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.DELETE, genericUrl, content).execute(); @@ -1128,8 +1128,8 @@ public class FakeApi { } UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake/inline-additionalProperties"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = apiClient.new JacksonJsonHttpContent(param); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); @@ -1142,8 +1142,8 @@ public class FakeApi { } UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake/inline-additionalProperties"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = param == null ? apiClient.new JacksonJsonHttpContent(null) : @@ -1176,8 +1176,8 @@ public class FakeApi { } } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = apiClient.new JacksonJsonHttpContent(param); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); @@ -1217,8 +1217,8 @@ public class FakeApi { } UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake/jsonFormData"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = null; return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content).execute(); @@ -1252,12 +1252,173 @@ public class FakeApi { } } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = null; return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content).execute(); } + /** + * To test the collection format in query parameters + *

200 - Success + * @param pipe The pipe parameter + * @param ioutil The ioutil parameter + * @param http The http parameter + * @param url The url parameter + * @param context The context parameter + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public void testQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context) throws IOException { + testQueryParameterCollectionFormatForHttpResponse(pipe, ioutil, http, url, context); + } + + /** + * To test the collection format in query parameters + *

200 - Success + * @param pipe The pipe parameter + * @param ioutil The ioutil parameter + * @param http The http parameter + * @param url The url parameter + * @param context The context parameter + * @param params Map of query params. A collection will be interpreted as passing in multiple instances of the same query param. + * @throws IOException if an error occurs while attempting to invoke the API + **/ + public void testQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context, Map params) throws IOException { + testQueryParameterCollectionFormatForHttpResponse(pipe, ioutil, http, url, context, params); + } + + public HttpResponse testQueryParameterCollectionFormatForHttpResponse(List pipe, List ioutil, List http, List url, List context) throws IOException { + // verify the required parameter 'pipe' is set + if (pipe == null) { + throw new IllegalArgumentException("Missing the required parameter 'pipe' when calling testQueryParameterCollectionFormat"); + }// verify the required parameter 'ioutil' is set + if (ioutil == null) { + throw new IllegalArgumentException("Missing the required parameter 'ioutil' when calling testQueryParameterCollectionFormat"); + }// verify the required parameter 'http' is set + if (http == null) { + throw new IllegalArgumentException("Missing the required parameter 'http' when calling testQueryParameterCollectionFormat"); + }// verify the required parameter 'url' is set + if (url == null) { + throw new IllegalArgumentException("Missing the required parameter 'url' when calling testQueryParameterCollectionFormat"); + }// verify the required parameter 'context' is set + if (context == null) { + throw new IllegalArgumentException("Missing the required parameter 'context' when calling testQueryParameterCollectionFormat"); + } + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake/test-query-paramters"); + if (pipe != null) { + String key = "pipe"; + Object value = pipe; + if (value instanceof Collection) { + uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray()); + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (ioutil != null) { + String key = "ioutil"; + Object value = ioutil; + if (value instanceof Collection) { + uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray()); + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (http != null) { + String key = "http"; + Object value = http; + if (value instanceof Collection) { + uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray()); + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (url != null) { + String key = "url"; + Object value = url; + if (value instanceof Collection) { + uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray()); + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } if (context != null) { + String key = "context"; + Object value = context; + if (value instanceof Collection) { + uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray()); + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); + + HttpContent content = apiClient.new JacksonJsonHttpContent(null); + return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.PUT, genericUrl, content).execute(); + } + + public HttpResponse testQueryParameterCollectionFormatForHttpResponse(List pipe, List ioutil, List http, List url, List context, Map params) throws IOException { + // verify the required parameter 'pipe' is set + if (pipe == null) { + throw new IllegalArgumentException("Missing the required parameter 'pipe' when calling testQueryParameterCollectionFormat"); + }// verify the required parameter 'ioutil' is set + if (ioutil == null) { + throw new IllegalArgumentException("Missing the required parameter 'ioutil' when calling testQueryParameterCollectionFormat"); + }// verify the required parameter 'http' is set + if (http == null) { + throw new IllegalArgumentException("Missing the required parameter 'http' when calling testQueryParameterCollectionFormat"); + }// verify the required parameter 'url' is set + if (url == null) { + throw new IllegalArgumentException("Missing the required parameter 'url' when calling testQueryParameterCollectionFormat"); + }// verify the required parameter 'context' is set + if (context == null) { + throw new IllegalArgumentException("Missing the required parameter 'context' when calling testQueryParameterCollectionFormat"); + } + UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake/test-query-paramters"); + + // Copy the params argument if present, to allow passing in immutable maps + Map allParams = params == null ? new HashMap() : new HashMap(params); + // Add the required query param 'pipe' to the map of query params + allParams.put("pipe", pipe); + // Add the required query param 'ioutil' to the map of query params + allParams.put("ioutil", ioutil); + // Add the required query param 'http' to the map of query params + allParams.put("http", http); + // Add the required query param 'url' to the map of query params + allParams.put("url", url); + // Add the required query param 'context' to the map of query params + allParams.put("context", context); + + for (Map.Entry entry: allParams.entrySet()) { + String key = entry.getKey(); + Object value = entry.getValue(); + + if (key != null && value != null) { + if (value instanceof Collection) { + uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray()); + } else if (value instanceof Object[]) { + uriBuilder = uriBuilder.queryParam(key, (Object[]) value); + } else { + uriBuilder = uriBuilder.queryParam(key, value); + } + } + } + + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); + + HttpContent content = apiClient.new JacksonJsonHttpContent(null); + return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.PUT, genericUrl, content).execute(); + } + + } diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java index 71e359d2487..846dc8e71a9 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java @@ -76,8 +76,8 @@ public class FakeClassnameTags123Api { } UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake_classname_test"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = apiClient.new JacksonJsonHttpContent(body); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.PATCH, genericUrl, content).execute(); @@ -90,8 +90,8 @@ public class FakeClassnameTags123Api { } UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake_classname_test"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = body == null ? apiClient.new JacksonJsonHttpContent(null) : @@ -124,8 +124,8 @@ public class FakeClassnameTags123Api { } } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = apiClient.new JacksonJsonHttpContent(body); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.PATCH, genericUrl, content).execute(); diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/PetApi.java index 1dacd5912b5..92e9d3971cb 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/PetApi.java @@ -72,8 +72,8 @@ public class PetApi { } UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/pet"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = apiClient.new JacksonJsonHttpContent(body); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); @@ -86,8 +86,8 @@ public class PetApi { } UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/pet"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = body == null ? apiClient.new JacksonJsonHttpContent(null) : @@ -120,8 +120,8 @@ public class PetApi { } } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = apiClient.new JacksonJsonHttpContent(body); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); @@ -162,8 +162,8 @@ public class PetApi { uriVariables.put("petId", petId); UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/pet/{petId}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = null; return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.DELETE, genericUrl, content).execute(); @@ -197,8 +197,8 @@ public class PetApi { } } - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = null; return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.DELETE, genericUrl, content).execute(); @@ -254,8 +254,8 @@ public class PetApi { } } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = null; return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content).execute(); @@ -288,8 +288,8 @@ public class PetApi { } } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = null; return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content).execute(); @@ -345,8 +345,8 @@ public class PetApi { } } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = null; return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content).execute(); @@ -379,8 +379,8 @@ public class PetApi { } } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = null; return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content).execute(); @@ -430,8 +430,8 @@ public class PetApi { uriVariables.put("petId", petId); UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/pet/{petId}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = null; return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content).execute(); @@ -465,8 +465,8 @@ public class PetApi { } } - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = null; return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content).execute(); @@ -507,8 +507,8 @@ public class PetApi { } UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/pet"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = apiClient.new JacksonJsonHttpContent(body); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.PUT, genericUrl, content).execute(); @@ -521,8 +521,8 @@ public class PetApi { } UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/pet"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = body == null ? apiClient.new JacksonJsonHttpContent(null) : @@ -555,8 +555,8 @@ public class PetApi { } } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = apiClient.new JacksonJsonHttpContent(body); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.PUT, genericUrl, content).execute(); @@ -596,8 +596,8 @@ public class PetApi { uriVariables.put("petId", petId); UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/pet/{petId}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = apiClient.new JacksonJsonHttpContent(null); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); @@ -631,8 +631,8 @@ public class PetApi { } } - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = apiClient.new JacksonJsonHttpContent(null); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); @@ -678,8 +678,8 @@ public class PetApi { uriVariables.put("petId", petId); UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/pet/{petId}/uploadImage"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = apiClient.new JacksonJsonHttpContent(null); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); @@ -713,8 +713,8 @@ public class PetApi { } } - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = apiClient.new JacksonJsonHttpContent(null); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); @@ -764,8 +764,8 @@ public class PetApi { uriVariables.put("petId", petId); UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/fake/{petId}/uploadImageWithRequiredFile"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = apiClient.new JacksonJsonHttpContent(null); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); @@ -802,8 +802,8 @@ public class PetApi { } } - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = apiClient.new JacksonJsonHttpContent(null); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/StoreApi.java index 403039f991a..5e1af4a412b 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/StoreApi.java @@ -75,8 +75,8 @@ public class StoreApi { uriVariables.put("order_id", orderId); UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/store/order/{order_id}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = null; return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.DELETE, genericUrl, content).execute(); @@ -110,8 +110,8 @@ public class StoreApi { } } - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = null; return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.DELETE, genericUrl, content).execute(); @@ -149,8 +149,8 @@ public class StoreApi { UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/store/inventory"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = null; return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content).execute(); @@ -178,8 +178,8 @@ public class StoreApi { } } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = null; return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content).execute(); @@ -229,8 +229,8 @@ public class StoreApi { uriVariables.put("order_id", orderId); UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/store/order/{order_id}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = null; return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content).execute(); @@ -264,8 +264,8 @@ public class StoreApi { } } - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = null; return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content).execute(); @@ -308,8 +308,8 @@ public class StoreApi { } UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/store/order"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = apiClient.new JacksonJsonHttpContent(body); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); @@ -322,8 +322,8 @@ public class StoreApi { } UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/store/order"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = body == null ? apiClient.new JacksonJsonHttpContent(null) : @@ -356,8 +356,8 @@ public class StoreApi { } } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = apiClient.new JacksonJsonHttpContent(body); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/UserApi.java index 21b7c004ed2..9b49eafa95d 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/UserApi.java @@ -70,8 +70,8 @@ public class UserApi { } UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/user"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = apiClient.new JacksonJsonHttpContent(body); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); @@ -84,8 +84,8 @@ public class UserApi { } UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/user"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = body == null ? apiClient.new JacksonJsonHttpContent(null) : @@ -118,8 +118,8 @@ public class UserApi { } } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = apiClient.new JacksonJsonHttpContent(body); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); @@ -154,8 +154,8 @@ public class UserApi { } UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/user/createWithArray"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = apiClient.new JacksonJsonHttpContent(body); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); @@ -168,8 +168,8 @@ public class UserApi { } UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/user/createWithArray"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = body == null ? apiClient.new JacksonJsonHttpContent(null) : @@ -202,8 +202,8 @@ public class UserApi { } } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = apiClient.new JacksonJsonHttpContent(body); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); @@ -238,8 +238,8 @@ public class UserApi { } UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/user/createWithList"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = apiClient.new JacksonJsonHttpContent(body); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); @@ -252,8 +252,8 @@ public class UserApi { } UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/user/createWithList"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = body == null ? apiClient.new JacksonJsonHttpContent(null) : @@ -286,8 +286,8 @@ public class UserApi { } } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = apiClient.new JacksonJsonHttpContent(body); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); @@ -329,8 +329,8 @@ public class UserApi { uriVariables.put("username", username); UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/user/{username}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = null; return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.DELETE, genericUrl, content).execute(); @@ -364,8 +364,8 @@ public class UserApi { } } - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = null; return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.DELETE, genericUrl, content).execute(); @@ -413,8 +413,8 @@ public class UserApi { uriVariables.put("username", username); UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/user/{username}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = null; return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content).execute(); @@ -448,8 +448,8 @@ public class UserApi { } } - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = null; return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content).execute(); @@ -518,8 +518,8 @@ public class UserApi { } } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = null; return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content).execute(); @@ -557,8 +557,8 @@ public class UserApi { } } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = null; return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content).execute(); @@ -588,8 +588,8 @@ public class UserApi { UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/user/logout"); - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = null; return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content).execute(); @@ -617,8 +617,8 @@ public class UserApi { } } - String url = uriBuilder.build().toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.build().toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = null; return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content).execute(); @@ -665,8 +665,8 @@ public class UserApi { uriVariables.put("username", username); UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/user/{username}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = apiClient.new JacksonJsonHttpContent(body); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.PUT, genericUrl, content).execute(); @@ -685,8 +685,8 @@ public class UserApi { uriVariables.put("username", username); UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/user/{username}"); - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = body == null ? apiClient.new JacksonJsonHttpContent(null) : @@ -725,8 +725,8 @@ public class UserApi { } } - String url = uriBuilder.buildFromMap(uriVariables).toString(); - GenericUrl genericUrl = new GenericUrl(url); + String localVarUrl = uriBuilder.buildFromMap(uriVariables).toString(); + GenericUrl genericUrl = new GenericUrl(localVarUrl); HttpContent content = apiClient.new JacksonJsonHttpContent(body); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.PUT, genericUrl, content).execute(); diff --git a/samples/client/petstore/java/jersey1/docs/FakeApi.md b/samples/client/petstore/java/jersey1/docs/FakeApi.md index 9a2e4770201..bc84c13561e 100644 --- a/samples/client/petstore/java/jersey1/docs/FakeApi.md +++ b/samples/client/petstore/java/jersey1/docs/FakeApi.md @@ -17,6 +17,7 @@ Method | HTTP request | Description [**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data +[**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-paramters | @@ -912,3 +913,75 @@ No authorization required |-------------|-------------|------------------| | **200** | successful operation | - | + +## testQueryParameterCollectionFormat + +> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context) + + + +To test the collection format in query parameters + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + List pipe = Arrays.asList(); // List | + List ioutil = Arrays.asList(); // List | + List http = Arrays.asList(); // List | + List url = Arrays.asList(); // List | + List context = Arrays.asList(); // List | + try { + apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testQueryParameterCollectionFormat"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**List<String>**](String.md)| | + **ioutil** | [**List<String>**](String.md)| | + **http** | [**List<String>**](String.md)| | + **url** | [**List<String>**](String.md)| | + **context** | [**List<String>**](String.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/api/FakeApi.java index dfef1d7bd4d..c984d269bd7 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/api/FakeApi.java @@ -684,4 +684,74 @@ if (param2 != null) apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); } + /** + * + * To test the collection format in query parameters + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @throws ApiException if fails to make API call + */ + public void testQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'pipe' is set + if (pipe == null) { + throw new ApiException(400, "Missing the required parameter 'pipe' when calling testQueryParameterCollectionFormat"); + } + + // verify the required parameter 'ioutil' is set + if (ioutil == null) { + throw new ApiException(400, "Missing the required parameter 'ioutil' when calling testQueryParameterCollectionFormat"); + } + + // verify the required parameter 'http' is set + if (http == null) { + throw new ApiException(400, "Missing the required parameter 'http' when calling testQueryParameterCollectionFormat"); + } + + // verify the required parameter 'url' is set + if (url == null) { + throw new ApiException(400, "Missing the required parameter 'url' when calling testQueryParameterCollectionFormat"); + } + + // verify the required parameter 'context' is set + if (context == null) { + throw new ApiException(400, "Missing the required parameter 'context' when calling testQueryParameterCollectionFormat"); + } + + // create path and map variables + String localVarPath = "/fake/test-query-paramters"; + + // query params + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("csv", "pipe", pipe)); + localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("csv", "ioutil", ioutil)); + localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("space", "http", http)); + localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("csv", "url", url)); + localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("multi", "context", context)); + + + + final String[] localVarAccepts = { + + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + + apiClient.invokeAPI(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); + } } diff --git a/samples/client/petstore/java/jersey2-java6/docs/FakeApi.md b/samples/client/petstore/java/jersey2-java6/docs/FakeApi.md index 9a2e4770201..bc84c13561e 100644 --- a/samples/client/petstore/java/jersey2-java6/docs/FakeApi.md +++ b/samples/client/petstore/java/jersey2-java6/docs/FakeApi.md @@ -17,6 +17,7 @@ Method | HTTP request | Description [**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data +[**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-paramters | @@ -912,3 +913,75 @@ No authorization required |-------------|-------------|------------------| | **200** | successful operation | - | + +## testQueryParameterCollectionFormat + +> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context) + + + +To test the collection format in query parameters + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + List pipe = Arrays.asList(); // List | + List ioutil = Arrays.asList(); // List | + List http = Arrays.asList(); // List | + List url = Arrays.asList(); // List | + List context = Arrays.asList(); // List | + try { + apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testQueryParameterCollectionFormat"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**List<String>**](String.md)| | + **ioutil** | [**List<String>**](String.md)| | + **http** | [**List<String>**](String.md)| | + **url** | [**List<String>**](String.md)| | + **context** | [**List<String>**](String.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/api/FakeApi.java index 70b4c329d61..a18ca5f3f56 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/api/FakeApi.java @@ -970,4 +970,99 @@ if (param2 != null) return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); } + /** + * + * To test the collection format in query parameters + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @throws ApiException if fails to make API call + * @http.response.details + + + +
Status Code Description Response Headers
200 Success -
+ */ + public void testQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context) throws ApiException { + + testQueryParameterCollectionFormatWithHttpInfo(pipe, ioutil, http, url, context); + } + + /** + * + * To test the collection format in query parameters + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + + + +
Status Code Description Response Headers
200 Success -
+ */ + public ApiResponse testQueryParameterCollectionFormatWithHttpInfo(List pipe, List ioutil, List http, List url, List context) throws ApiException { + Object localVarPostBody = new Object(); + + // verify the required parameter 'pipe' is set + if (pipe == null) { + throw new ApiException(400, "Missing the required parameter 'pipe' when calling testQueryParameterCollectionFormat"); + } + + // verify the required parameter 'ioutil' is set + if (ioutil == null) { + throw new ApiException(400, "Missing the required parameter 'ioutil' when calling testQueryParameterCollectionFormat"); + } + + // verify the required parameter 'http' is set + if (http == null) { + throw new ApiException(400, "Missing the required parameter 'http' when calling testQueryParameterCollectionFormat"); + } + + // verify the required parameter 'url' is set + if (url == null) { + throw new ApiException(400, "Missing the required parameter 'url' when calling testQueryParameterCollectionFormat"); + } + + // verify the required parameter 'context' is set + if (context == null) { + throw new ApiException(400, "Missing the required parameter 'context' when calling testQueryParameterCollectionFormat"); + } + + // create path and map variables + String localVarPath = "/fake/test-query-paramters"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "pipe", pipe)); + localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "ioutil", ioutil)); + localVarQueryParams.addAll(apiClient.parameterToPairs("space", "http", http)); + localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "url", url)); + localVarQueryParams.addAll(apiClient.parameterToPairs("multi", "context", context)); + + + + final String[] localVarAccepts = { + + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + + return apiClient.invokeAPI(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); + } } diff --git a/samples/client/petstore/java/jersey2-java8/docs/FakeApi.md b/samples/client/petstore/java/jersey2-java8/docs/FakeApi.md index 9a2e4770201..bc84c13561e 100644 --- a/samples/client/petstore/java/jersey2-java8/docs/FakeApi.md +++ b/samples/client/petstore/java/jersey2-java8/docs/FakeApi.md @@ -17,6 +17,7 @@ Method | HTTP request | Description [**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data +[**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-paramters | @@ -912,3 +913,75 @@ No authorization required |-------------|-------------|------------------| | **200** | successful operation | - | + +## testQueryParameterCollectionFormat + +> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context) + + + +To test the collection format in query parameters + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + List pipe = Arrays.asList(); // List | + List ioutil = Arrays.asList(); // List | + List http = Arrays.asList(); // List | + List url = Arrays.asList(); // List | + List context = Arrays.asList(); // List | + try { + apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testQueryParameterCollectionFormat"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**List<String>**](String.md)| | + **ioutil** | [**List<String>**](String.md)| | + **http** | [**List<String>**](String.md)| | + **url** | [**List<String>**](String.md)| | + **context** | [**List<String>**](String.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/FakeApi.java index ec5b45d4ec3..9437dff71b6 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/FakeApi.java @@ -970,4 +970,99 @@ if (param2 != null) return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); } + /** + * + * To test the collection format in query parameters + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @throws ApiException if fails to make API call + * @http.response.details + + + +
Status Code Description Response Headers
200 Success -
+ */ + public void testQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context) throws ApiException { + + testQueryParameterCollectionFormatWithHttpInfo(pipe, ioutil, http, url, context); + } + + /** + * + * To test the collection format in query parameters + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + + + +
Status Code Description Response Headers
200 Success -
+ */ + public ApiResponse testQueryParameterCollectionFormatWithHttpInfo(List pipe, List ioutil, List http, List url, List context) throws ApiException { + Object localVarPostBody = new Object(); + + // verify the required parameter 'pipe' is set + if (pipe == null) { + throw new ApiException(400, "Missing the required parameter 'pipe' when calling testQueryParameterCollectionFormat"); + } + + // verify the required parameter 'ioutil' is set + if (ioutil == null) { + throw new ApiException(400, "Missing the required parameter 'ioutil' when calling testQueryParameterCollectionFormat"); + } + + // verify the required parameter 'http' is set + if (http == null) { + throw new ApiException(400, "Missing the required parameter 'http' when calling testQueryParameterCollectionFormat"); + } + + // verify the required parameter 'url' is set + if (url == null) { + throw new ApiException(400, "Missing the required parameter 'url' when calling testQueryParameterCollectionFormat"); + } + + // verify the required parameter 'context' is set + if (context == null) { + throw new ApiException(400, "Missing the required parameter 'context' when calling testQueryParameterCollectionFormat"); + } + + // create path and map variables + String localVarPath = "/fake/test-query-paramters"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "pipe", pipe)); + localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "ioutil", ioutil)); + localVarQueryParams.addAll(apiClient.parameterToPairs("space", "http", http)); + localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "url", url)); + localVarQueryParams.addAll(apiClient.parameterToPairs("multi", "context", context)); + + + + final String[] localVarAccepts = { + + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + + return apiClient.invokeAPI(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); + } } diff --git a/samples/client/petstore/java/jersey2/docs/FakeApi.md b/samples/client/petstore/java/jersey2/docs/FakeApi.md index 9a2e4770201..bc84c13561e 100644 --- a/samples/client/petstore/java/jersey2/docs/FakeApi.md +++ b/samples/client/petstore/java/jersey2/docs/FakeApi.md @@ -17,6 +17,7 @@ Method | HTTP request | Description [**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data +[**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-paramters | @@ -912,3 +913,75 @@ No authorization required |-------------|-------------|------------------| | **200** | successful operation | - | + +## testQueryParameterCollectionFormat + +> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context) + + + +To test the collection format in query parameters + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + List pipe = Arrays.asList(); // List | + List ioutil = Arrays.asList(); // List | + List http = Arrays.asList(); // List | + List url = Arrays.asList(); // List | + List context = Arrays.asList(); // List | + try { + apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testQueryParameterCollectionFormat"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**List<String>**](String.md)| | + **ioutil** | [**List<String>**](String.md)| | + **http** | [**List<String>**](String.md)| | + **url** | [**List<String>**](String.md)| | + **context** | [**List<String>**](String.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/api/FakeApi.java index 70b4c329d61..a18ca5f3f56 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/api/FakeApi.java @@ -970,4 +970,99 @@ if (param2 != null) return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); } + /** + * + * To test the collection format in query parameters + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @throws ApiException if fails to make API call + * @http.response.details + + + +
Status Code Description Response Headers
200 Success -
+ */ + public void testQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context) throws ApiException { + + testQueryParameterCollectionFormatWithHttpInfo(pipe, ioutil, http, url, context); + } + + /** + * + * To test the collection format in query parameters + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + + + +
Status Code Description Response Headers
200 Success -
+ */ + public ApiResponse testQueryParameterCollectionFormatWithHttpInfo(List pipe, List ioutil, List http, List url, List context) throws ApiException { + Object localVarPostBody = new Object(); + + // verify the required parameter 'pipe' is set + if (pipe == null) { + throw new ApiException(400, "Missing the required parameter 'pipe' when calling testQueryParameterCollectionFormat"); + } + + // verify the required parameter 'ioutil' is set + if (ioutil == null) { + throw new ApiException(400, "Missing the required parameter 'ioutil' when calling testQueryParameterCollectionFormat"); + } + + // verify the required parameter 'http' is set + if (http == null) { + throw new ApiException(400, "Missing the required parameter 'http' when calling testQueryParameterCollectionFormat"); + } + + // verify the required parameter 'url' is set + if (url == null) { + throw new ApiException(400, "Missing the required parameter 'url' when calling testQueryParameterCollectionFormat"); + } + + // verify the required parameter 'context' is set + if (context == null) { + throw new ApiException(400, "Missing the required parameter 'context' when calling testQueryParameterCollectionFormat"); + } + + // create path and map variables + String localVarPath = "/fake/test-query-paramters"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "pipe", pipe)); + localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "ioutil", ioutil)); + localVarQueryParams.addAll(apiClient.parameterToPairs("space", "http", http)); + localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "url", url)); + localVarQueryParams.addAll(apiClient.parameterToPairs("multi", "context", context)); + + + + final String[] localVarAccepts = { + + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + + return apiClient.invokeAPI(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); + } } diff --git a/samples/client/petstore/java/native/docs/FakeApi.md b/samples/client/petstore/java/native/docs/FakeApi.md index 9a2e4770201..bc84c13561e 100644 --- a/samples/client/petstore/java/native/docs/FakeApi.md +++ b/samples/client/petstore/java/native/docs/FakeApi.md @@ -17,6 +17,7 @@ Method | HTTP request | Description [**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data +[**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-paramters | @@ -912,3 +913,75 @@ No authorization required |-------------|-------------|------------------| | **200** | successful operation | - | + +## testQueryParameterCollectionFormat + +> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context) + + + +To test the collection format in query parameters + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + List pipe = Arrays.asList(); // List | + List ioutil = Arrays.asList(); // List | + List http = Arrays.asList(); // List | + List url = Arrays.asList(); // List | + List context = Arrays.asList(); // List | + try { + apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testQueryParameterCollectionFormat"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**List<String>**](String.md)| | + **ioutil** | [**List<String>**](String.md)| | + **http** | [**List<String>**](String.md)| | + **url** | [**List<String>**](String.md)| | + **context** | [**List<String>**](String.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/FakeApi.java index 740a9719ca4..1fff23d16e9 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/FakeApi.java @@ -730,4 +730,80 @@ public class FakeApi { throw new ApiException(e); } } + /** + * + * To test the collection format in query parameters + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @throws ApiException if fails to make API call + */ + public void testQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context) throws ApiException { + // verify the required parameter 'pipe' is set + if (pipe == null) { + throw new ApiException(400, "Missing the required parameter 'pipe' when calling testQueryParameterCollectionFormat"); + } + // verify the required parameter 'ioutil' is set + if (ioutil == null) { + throw new ApiException(400, "Missing the required parameter 'ioutil' when calling testQueryParameterCollectionFormat"); + } + // verify the required parameter 'http' is set + if (http == null) { + throw new ApiException(400, "Missing the required parameter 'http' when calling testQueryParameterCollectionFormat"); + } + // verify the required parameter 'url' is set + if (url == null) { + throw new ApiException(400, "Missing the required parameter 'url' when calling testQueryParameterCollectionFormat"); + } + // verify the required parameter 'context' is set + if (context == null) { + throw new ApiException(400, "Missing the required parameter 'context' when calling testQueryParameterCollectionFormat"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/fake/test-query-paramters"; + + List localVarQueryParams = new ArrayList<>(); + localVarQueryParams.addAll(ApiClient.parameterToPairs("csv", "pipe", pipe)); + localVarQueryParams.addAll(ApiClient.parameterToPairs("csv", "ioutil", ioutil)); + localVarQueryParams.addAll(ApiClient.parameterToPairs("space", "http", http)); + localVarQueryParams.addAll(ApiClient.parameterToPairs("csv", "url", url)); + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "context", context)); + + if (!localVarQueryParams.isEmpty()) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + try { + localVarRequestBuilder.method("PUT", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (localVarResponse.statusCode()/ 100 != 2) { + throw new ApiException(localVarResponse.statusCode(), + "testQueryParameterCollectionFormat call received non-success response", + localVarResponse.headers(), + localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes())); + } + + } catch (IOException | InterruptedException e) { + throw new ApiException(e); + } + } } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/FakeApi.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/FakeApi.md index 6b06529329f..afec253f8a9 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/FakeApi.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/FakeApi.md @@ -17,6 +17,7 @@ Method | HTTP request | Description [**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data +[**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-paramters | @@ -877,3 +878,72 @@ No authorization required |-------------|-------------|------------------| **200** | successful operation | - | + +# **testQueryParameterCollectionFormat** +> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context) + + + +To test the collection format in query parameters + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + List pipe = Arrays.asList(); // List | + List ioutil = Arrays.asList(); // List | + List http = Arrays.asList(); // List | + List url = Arrays.asList(); // List | + List context = Arrays.asList(); // List | + try { + apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testQueryParameterCollectionFormat"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**List<String>**](String.md)| | + **ioutil** | [**List<String>**](String.md)| | + **http** | [**List<String>**](String.md)| | + **url** | [**List<String>**](String.md)| | + **context** | [**List<String>**](String.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Success | - | + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/FakeApi.java index 44c7a97ffc4..2fe5bcfc164 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/FakeApi.java @@ -1745,4 +1745,165 @@ public class FakeApi { localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } + /** + * Build call for testQueryParameterCollectionFormat + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 Success -
+ */ + public okhttp3.Call testQueryParameterCollectionFormatCall(List pipe, List ioutil, List http, List url, List context, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = new Object(); + + // create path and map variables + String localVarPath = "/fake/test-query-paramters"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (pipe != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "pipe", pipe)); + } + + if (ioutil != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "ioutil", ioutil)); + } + + if (http != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("space", "http", http)); + } + + if (url != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "url", url)); + } + + if (context != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "context", context)); + } + + Map localVarHeaderParams = new HashMap(); + Map localVarFormParams = new HashMap(); + final String[] localVarAccepts = { + + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call testQueryParameterCollectionFormatValidateBeforeCall(List pipe, List ioutil, List http, List url, List context, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'pipe' is set + if (pipe == null) { + throw new ApiException("Missing the required parameter 'pipe' when calling testQueryParameterCollectionFormat(Async)"); + } + + // verify the required parameter 'ioutil' is set + if (ioutil == null) { + throw new ApiException("Missing the required parameter 'ioutil' when calling testQueryParameterCollectionFormat(Async)"); + } + + // verify the required parameter 'http' is set + if (http == null) { + throw new ApiException("Missing the required parameter 'http' when calling testQueryParameterCollectionFormat(Async)"); + } + + // verify the required parameter 'url' is set + if (url == null) { + throw new ApiException("Missing the required parameter 'url' when calling testQueryParameterCollectionFormat(Async)"); + } + + // verify the required parameter 'context' is set + if (context == null) { + throw new ApiException("Missing the required parameter 'context' when calling testQueryParameterCollectionFormat(Async)"); + } + + + okhttp3.Call localVarCall = testQueryParameterCollectionFormatCall(pipe, ioutil, http, url, context, _callback); + return localVarCall; + + } + + /** + * + * To test the collection format in query parameters + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 Success -
+ */ + public void testQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context) throws ApiException { + testQueryParameterCollectionFormatWithHttpInfo(pipe, ioutil, http, url, context); + } + + /** + * + * To test the collection format in query parameters + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 Success -
+ */ + public ApiResponse testQueryParameterCollectionFormatWithHttpInfo(List pipe, List ioutil, List http, List url, List context) throws ApiException { + okhttp3.Call localVarCall = testQueryParameterCollectionFormatValidateBeforeCall(pipe, ioutil, http, url, context, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * (asynchronously) + * To test the collection format in query parameters + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 Success -
+ */ + public okhttp3.Call testQueryParameterCollectionFormatAsync(List pipe, List ioutil, List http, List url, List context, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = testQueryParameterCollectionFormatValidateBeforeCall(pipe, ioutil, http, url, context, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } } diff --git a/samples/client/petstore/java/okhttp-gson/docs/FakeApi.md b/samples/client/petstore/java/okhttp-gson/docs/FakeApi.md index 6b06529329f..afec253f8a9 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/FakeApi.md +++ b/samples/client/petstore/java/okhttp-gson/docs/FakeApi.md @@ -17,6 +17,7 @@ Method | HTTP request | Description [**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data +[**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-paramters | @@ -877,3 +878,72 @@ No authorization required |-------------|-------------|------------------| **200** | successful operation | - | + +# **testQueryParameterCollectionFormat** +> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context) + + + +To test the collection format in query parameters + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + List pipe = Arrays.asList(); // List | + List ioutil = Arrays.asList(); // List | + List http = Arrays.asList(); // List | + List url = Arrays.asList(); // List | + List context = Arrays.asList(); // List | + try { + apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testQueryParameterCollectionFormat"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**List<String>**](String.md)| | + **ioutil** | [**List<String>**](String.md)| | + **http** | [**List<String>**](String.md)| | + **url** | [**List<String>**](String.md)| | + **context** | [**List<String>**](String.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Success | - | + diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeApi.java index 44c7a97ffc4..2fe5bcfc164 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeApi.java @@ -1745,4 +1745,165 @@ public class FakeApi { localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } + /** + * Build call for testQueryParameterCollectionFormat + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 Success -
+ */ + public okhttp3.Call testQueryParameterCollectionFormatCall(List pipe, List ioutil, List http, List url, List context, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = new Object(); + + // create path and map variables + String localVarPath = "/fake/test-query-paramters"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (pipe != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "pipe", pipe)); + } + + if (ioutil != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "ioutil", ioutil)); + } + + if (http != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("space", "http", http)); + } + + if (url != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("csv", "url", url)); + } + + if (context != null) { + localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("multi", "context", context)); + } + + Map localVarHeaderParams = new HashMap(); + Map localVarFormParams = new HashMap(); + final String[] localVarAccepts = { + + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { }; + return localVarApiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call testQueryParameterCollectionFormatValidateBeforeCall(List pipe, List ioutil, List http, List url, List context, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'pipe' is set + if (pipe == null) { + throw new ApiException("Missing the required parameter 'pipe' when calling testQueryParameterCollectionFormat(Async)"); + } + + // verify the required parameter 'ioutil' is set + if (ioutil == null) { + throw new ApiException("Missing the required parameter 'ioutil' when calling testQueryParameterCollectionFormat(Async)"); + } + + // verify the required parameter 'http' is set + if (http == null) { + throw new ApiException("Missing the required parameter 'http' when calling testQueryParameterCollectionFormat(Async)"); + } + + // verify the required parameter 'url' is set + if (url == null) { + throw new ApiException("Missing the required parameter 'url' when calling testQueryParameterCollectionFormat(Async)"); + } + + // verify the required parameter 'context' is set + if (context == null) { + throw new ApiException("Missing the required parameter 'context' when calling testQueryParameterCollectionFormat(Async)"); + } + + + okhttp3.Call localVarCall = testQueryParameterCollectionFormatCall(pipe, ioutil, http, url, context, _callback); + return localVarCall; + + } + + /** + * + * To test the collection format in query parameters + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 Success -
+ */ + public void testQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context) throws ApiException { + testQueryParameterCollectionFormatWithHttpInfo(pipe, ioutil, http, url, context); + } + + /** + * + * To test the collection format in query parameters + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 Success -
+ */ + public ApiResponse testQueryParameterCollectionFormatWithHttpInfo(List pipe, List ioutil, List http, List url, List context) throws ApiException { + okhttp3.Call localVarCall = testQueryParameterCollectionFormatValidateBeforeCall(pipe, ioutil, http, url, context, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * (asynchronously) + * To test the collection format in query parameters + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 Success -
+ */ + public okhttp3.Call testQueryParameterCollectionFormatAsync(List pipe, List ioutil, List http, List url, List context, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = testQueryParameterCollectionFormatValidateBeforeCall(pipe, ioutil, http, url, context, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } } diff --git a/samples/client/petstore/java/rest-assured/docs/FakeApi.md b/samples/client/petstore/java/rest-assured/docs/FakeApi.md index cda10bf74d5..c60da0e25a5 100644 --- a/samples/client/petstore/java/rest-assured/docs/FakeApi.md +++ b/samples/client/petstore/java/rest-assured/docs/FakeApi.md @@ -17,6 +17,7 @@ Method | HTTP request | Description [**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data +[**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-paramters | @@ -588,3 +589,53 @@ No authorization required - **Content-Type**: application/x-www-form-urlencoded - **Accept**: Not defined + +# **testQueryParameterCollectionFormat** +> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context) + + + +To test the collection format in query parameters + +### Example +```java +// Import classes: +//import org.openapitools.client.ApiClient; +//import io.restassured.builder.RequestSpecBuilder; +//import io.restassured.filter.log.ErrorLoggingFilter; + +FakeApi api = ApiClient.api(ApiClient.Config.apiConfig().withReqSpecSupplier( + () -> new RequestSpecBuilder() + .setBaseUri("http://petstore.swagger.io:80/v2"))).fake(); + +api.testQueryParameterCollectionFormat() + .pipeQuery(pipe) + .ioutilQuery(ioutil) + .httpQuery(http) + .urlQuery(url) + .contextQuery(context).execute(r -> r.prettyPeek()); +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**List<String>**](String.md)| | [default to new ArrayList<String>()] + **ioutil** | [**List<String>**](String.md)| | [default to new ArrayList<String>()] + **http** | [**List<String>**](String.md)| | [default to new ArrayList<String>()] + **url** | [**List<String>**](String.md)| | [default to new ArrayList<String>()] + **context** | [**List<String>**](String.md)| | [default to new ArrayList<String>()] + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/FakeApi.java index 7ba6b4294ae..feac4151857 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/FakeApi.java @@ -199,6 +199,16 @@ public class FakeApi { return new TestJsonFormDataOper(createReqSpec()); } + @ApiOperation(value = "", + notes = "To test the collection format in query parameters", + nickname = "testQueryParameterCollectionFormat", + tags = { "fake" }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success") }) + public TestQueryParameterCollectionFormatOper testQueryParameterCollectionFormat() { + return new TestQueryParameterCollectionFormatOper(createReqSpec()); + } + /** * Customize request specification * @param reqSpecCustomizer consumer to modify the RequestSpecBuilder @@ -1375,4 +1385,113 @@ public class FakeApi { return this; } } + /** + * + * To test the collection format in query parameters + * + * @see #pipeQuery (required) + * @see #ioutilQuery (required) + * @see #httpQuery (required) + * @see #urlQuery (required) + * @see #contextQuery (required) + */ + public static class TestQueryParameterCollectionFormatOper { + + public static final Method REQ_METHOD = PUT; + public static final String REQ_URI = "/fake/test-query-paramters"; + + private RequestSpecBuilder reqSpec; + private ResponseSpecBuilder respSpec; + + public TestQueryParameterCollectionFormatOper(RequestSpecBuilder reqSpec) { + this.reqSpec = reqSpec; + reqSpec.setAccept("application/json"); + this.respSpec = new ResponseSpecBuilder(); + } + + /** + * PUT /fake/test-query-paramters + * @param handler handler + * @param type + * @return type + */ + public T execute(Function handler) { + return handler.apply(RestAssured.given().spec(reqSpec.build()).expect().spec(respSpec.build()).when().request(REQ_METHOD, REQ_URI)); + } + + public static final String PIPE_QUERY = "pipe"; + + /** + * @param pipe (List<String>) (required) + * @return operation + */ + public TestQueryParameterCollectionFormatOper pipeQuery(Object... pipe) { + reqSpec.addQueryParam(PIPE_QUERY, pipe); + return this; + } + + public static final String IOUTIL_QUERY = "ioutil"; + + /** + * @param ioutil (List<String>) (required) + * @return operation + */ + public TestQueryParameterCollectionFormatOper ioutilQuery(Object... ioutil) { + reqSpec.addQueryParam(IOUTIL_QUERY, ioutil); + return this; + } + + public static final String HTTP_QUERY = "http"; + + /** + * @param http (List<String>) (required) + * @return operation + */ + public TestQueryParameterCollectionFormatOper httpQuery(Object... http) { + reqSpec.addQueryParam(HTTP_QUERY, http); + return this; + } + + public static final String URL_QUERY = "url"; + + /** + * @param url (List<String>) (required) + * @return operation + */ + public TestQueryParameterCollectionFormatOper urlQuery(Object... url) { + reqSpec.addQueryParam(URL_QUERY, url); + return this; + } + + public static final String CONTEXT_QUERY = "context"; + + /** + * @param context (List<String>) (required) + * @return operation + */ + public TestQueryParameterCollectionFormatOper contextQuery(Object... context) { + reqSpec.addQueryParam(CONTEXT_QUERY, context); + return this; + } + + /** + * Customize request specification + * @param reqSpecCustomizer consumer to modify the RequestSpecBuilder + * @return operation + */ + public TestQueryParameterCollectionFormatOper reqSpec(Consumer reqSpecCustomizer) { + reqSpecCustomizer.accept(reqSpec); + return this; + } + + /** + * Customize response specification + * @param respSpecCustomizer consumer to modify the ResponseSpecBuilder + * @return operation + */ + public TestQueryParameterCollectionFormatOper respSpec(Consumer respSpecCustomizer) { + respSpecCustomizer.accept(respSpec); + return this; + } + } } diff --git a/samples/client/petstore/java/resteasy/docs/FakeApi.md b/samples/client/petstore/java/resteasy/docs/FakeApi.md index 9a2e4770201..bc84c13561e 100644 --- a/samples/client/petstore/java/resteasy/docs/FakeApi.md +++ b/samples/client/petstore/java/resteasy/docs/FakeApi.md @@ -17,6 +17,7 @@ Method | HTTP request | Description [**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data +[**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-paramters | @@ -912,3 +913,75 @@ No authorization required |-------------|-------------|------------------| | **200** | successful operation | - | + +## testQueryParameterCollectionFormat + +> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context) + + + +To test the collection format in query parameters + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + List pipe = Arrays.asList(); // List | + List ioutil = Arrays.asList(); // List | + List http = Arrays.asList(); // List | + List url = Arrays.asList(); // List | + List context = Arrays.asList(); // List | + try { + apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testQueryParameterCollectionFormat"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**List<String>**](String.md)| | + **ioutil** | [**List<String>**](String.md)| | + **http** | [**List<String>**](String.md)| | + **url** | [**List<String>**](String.md)| | + **context** | [**List<String>**](String.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/api/FakeApi.java index 753f181e971..ff840639782 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/api/FakeApi.java @@ -657,4 +657,73 @@ if (param2 != null) apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); } + /** + * + * To test the collection format in query parameters + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @throws ApiException if fails to make API call + */ + public void testQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context) throws ApiException { + Object localVarPostBody = new Object(); + + // verify the required parameter 'pipe' is set + if (pipe == null) { + throw new ApiException(400, "Missing the required parameter 'pipe' when calling testQueryParameterCollectionFormat"); + } + + // verify the required parameter 'ioutil' is set + if (ioutil == null) { + throw new ApiException(400, "Missing the required parameter 'ioutil' when calling testQueryParameterCollectionFormat"); + } + + // verify the required parameter 'http' is set + if (http == null) { + throw new ApiException(400, "Missing the required parameter 'http' when calling testQueryParameterCollectionFormat"); + } + + // verify the required parameter 'url' is set + if (url == null) { + throw new ApiException(400, "Missing the required parameter 'url' when calling testQueryParameterCollectionFormat"); + } + + // verify the required parameter 'context' is set + if (context == null) { + throw new ApiException(400, "Missing the required parameter 'context' when calling testQueryParameterCollectionFormat"); + } + + // create path and map variables + String localVarPath = "/fake/test-query-paramters".replaceAll("\\{format\\}","json"); + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "pipe", pipe)); + localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "ioutil", ioutil)); + localVarQueryParams.addAll(apiClient.parameterToPairs("space", "http", http)); + localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "url", url)); + localVarQueryParams.addAll(apiClient.parameterToPairs("multi", "context", context)); + + + + final String[] localVarAccepts = { + + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + + apiClient.invokeAPI(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); + } } diff --git a/samples/client/petstore/java/resttemplate-withXml/docs/FakeApi.md b/samples/client/petstore/java/resttemplate-withXml/docs/FakeApi.md index 9a2e4770201..bc84c13561e 100644 --- a/samples/client/petstore/java/resttemplate-withXml/docs/FakeApi.md +++ b/samples/client/petstore/java/resttemplate-withXml/docs/FakeApi.md @@ -17,6 +17,7 @@ Method | HTTP request | Description [**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data +[**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-paramters | @@ -912,3 +913,75 @@ No authorization required |-------------|-------------|------------------| | **200** | successful operation | - | + +## testQueryParameterCollectionFormat + +> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context) + + + +To test the collection format in query parameters + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + List pipe = Arrays.asList(); // List | + List ioutil = Arrays.asList(); // List | + List http = Arrays.asList(); // List | + List url = Arrays.asList(); // List | + List context = Arrays.asList(); // List | + try { + apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testQueryParameterCollectionFormat"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**List<String>**](String.md)| | + **ioutil** | [**List<String>**](String.md)| | + **http** | [**List<String>**](String.md)| | + **url** | [**List<String>**](String.md)| | + **context** | [**List<String>**](String.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/FakeApi.java index 4981d7ea3a8..8b7f1118e5f 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/FakeApi.java @@ -589,4 +589,65 @@ public class FakeApi { ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); } + /** + * + * To test the collection format in query parameters + *

200 - Success + * @param pipe The pipe parameter + * @param ioutil The ioutil parameter + * @param http The http parameter + * @param url The url parameter + * @param context The context parameter + * @throws RestClientException if an error occurs while attempting to invoke the API + */ + public void testQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context) throws RestClientException { + Object postBody = null; + + // verify the required parameter 'pipe' is set + if (pipe == null) { + throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'pipe' when calling testQueryParameterCollectionFormat"); + } + + // verify the required parameter 'ioutil' is set + if (ioutil == null) { + throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'ioutil' when calling testQueryParameterCollectionFormat"); + } + + // verify the required parameter 'http' is set + if (http == null) { + throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'http' when calling testQueryParameterCollectionFormat"); + } + + // verify the required parameter 'url' is set + if (url == null) { + throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'url' when calling testQueryParameterCollectionFormat"); + } + + // verify the required parameter 'context' is set + if (context == null) { + throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'context' when calling testQueryParameterCollectionFormat"); + } + + String path = apiClient.expandPath("/fake/test-query-paramters", Collections.emptyMap()); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "pipe", pipe)); + queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "ioutil", ioutil)); + queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("space".toUpperCase(Locale.ROOT)), "http", http)); + 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)); + + final String[] accepts = { }; + final List accept = apiClient.selectHeaderAccept(accepts); + final String[] contentTypes = { }; + final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); + + String[] authNames = new String[] { }; + + ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; + apiClient.invokeAPI(path, HttpMethod.PUT, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); + } } diff --git a/samples/client/petstore/java/resttemplate/docs/FakeApi.md b/samples/client/petstore/java/resttemplate/docs/FakeApi.md index 9a2e4770201..bc84c13561e 100644 --- a/samples/client/petstore/java/resttemplate/docs/FakeApi.md +++ b/samples/client/petstore/java/resttemplate/docs/FakeApi.md @@ -17,6 +17,7 @@ Method | HTTP request | Description [**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data +[**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-paramters | @@ -912,3 +913,75 @@ No authorization required |-------------|-------------|------------------| | **200** | successful operation | - | + +## testQueryParameterCollectionFormat + +> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context) + + + +To test the collection format in query parameters + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + List pipe = Arrays.asList(); // List | + List ioutil = Arrays.asList(); // List | + List http = Arrays.asList(); // List | + List url = Arrays.asList(); // List | + List context = Arrays.asList(); // List | + try { + apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testQueryParameterCollectionFormat"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**List<String>**](String.md)| | + **ioutil** | [**List<String>**](String.md)| | + **http** | [**List<String>**](String.md)| | + **url** | [**List<String>**](String.md)| | + **context** | [**List<String>**](String.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/FakeApi.java index 4981d7ea3a8..8b7f1118e5f 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/FakeApi.java @@ -589,4 +589,65 @@ public class FakeApi { ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); } + /** + * + * To test the collection format in query parameters + *

200 - Success + * @param pipe The pipe parameter + * @param ioutil The ioutil parameter + * @param http The http parameter + * @param url The url parameter + * @param context The context parameter + * @throws RestClientException if an error occurs while attempting to invoke the API + */ + public void testQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context) throws RestClientException { + Object postBody = null; + + // verify the required parameter 'pipe' is set + if (pipe == null) { + throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'pipe' when calling testQueryParameterCollectionFormat"); + } + + // verify the required parameter 'ioutil' is set + if (ioutil == null) { + throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'ioutil' when calling testQueryParameterCollectionFormat"); + } + + // verify the required parameter 'http' is set + if (http == null) { + throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'http' when calling testQueryParameterCollectionFormat"); + } + + // verify the required parameter 'url' is set + if (url == null) { + throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'url' when calling testQueryParameterCollectionFormat"); + } + + // verify the required parameter 'context' is set + if (context == null) { + throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'context' when calling testQueryParameterCollectionFormat"); + } + + String path = apiClient.expandPath("/fake/test-query-paramters", Collections.emptyMap()); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "pipe", pipe)); + queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "ioutil", ioutil)); + queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("space".toUpperCase(Locale.ROOT)), "http", http)); + 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)); + + final String[] accepts = { }; + final List accept = apiClient.selectHeaderAccept(accepts); + final String[] contentTypes = { }; + final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); + + String[] authNames = new String[] { }; + + ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; + apiClient.invokeAPI(path, HttpMethod.PUT, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); + } } diff --git a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/CollectionFormats.java b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/CollectionFormats.java index 402f5c7c793..2283c382cc3 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/CollectionFormats.java +++ b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/CollectionFormats.java @@ -35,6 +35,10 @@ public class CollectionFormats { } + public static class SPACEParams extends SSVParams { + + } + public static class SSVParams extends CSVParams { public SSVParams() { diff --git a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/api/FakeApi.java index 279f91bb9a9..e258826a9aa 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/api/FakeApi.java @@ -394,4 +394,36 @@ public interface FakeApi { void testJsonFormData( @retrofit.http.Field("param") String param, @retrofit.http.Field("param2") String param2, Callback cb ); + /** + * + * Sync method + * To test the collection format in query parameters + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @return Void + */ + + @PUT("/fake/test-query-paramters") + Void testQueryParameterCollectionFormat( + @retrofit.http.Query("pipe") CSVParams pipe, @retrofit.http.Query("ioutil") CSVParams ioutil, @retrofit.http.Query("http") SPACEParams http, @retrofit.http.Query("url") CSVParams url, @retrofit.http.Query("context") List context + ); + + /** + * + * Async method + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @param cb callback method + */ + + @PUT("/fake/test-query-paramters") + void testQueryParameterCollectionFormat( + @retrofit.http.Query("pipe") CSVParams pipe, @retrofit.http.Query("ioutil") CSVParams ioutil, @retrofit.http.Query("http") SPACEParams http, @retrofit.http.Query("url") CSVParams url, @retrofit.http.Query("context") List context, Callback cb + ); } diff --git a/samples/client/petstore/java/retrofit2-play24/docs/FakeApi.md b/samples/client/petstore/java/retrofit2-play24/docs/FakeApi.md index 29d71d3620d..24e2d7f5be2 100644 --- a/samples/client/petstore/java/retrofit2-play24/docs/FakeApi.md +++ b/samples/client/petstore/java/retrofit2-play24/docs/FakeApi.md @@ -17,6 +17,7 @@ Method | HTTP request | Description [**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** fake | Fake endpoint to test group parameters (optional) [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** fake/inline-additionalProperties | test inline additionalProperties [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** fake/jsonFormData | test json serialization of form data +[**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** fake/test-query-paramters | @@ -912,3 +913,75 @@ No authorization required |-------------|-------------|------------------| | **200** | successful operation | - | + +## testQueryParameterCollectionFormat + +> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context) + + + +To test the collection format in query parameters + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + List pipe = Arrays.asList(); // List | + List ioutil = Arrays.asList(); // List | + List http = Arrays.asList(); // List | + List url = Arrays.asList(); // List | + List context = Arrays.asList(); // List | + try { + apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testQueryParameterCollectionFormat"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**List<String>**](String.md)| | + **ioutil** | [**List<String>**](String.md)| | + **http** | [**List<String>**](String.md)| | + **url** | [**List<String>**](String.md)| | + **context** | [**List<String>**](String.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/CollectionFormats.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/CollectionFormats.java index 15cfcd1bd93..20cbb0e7d6a 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/CollectionFormats.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/CollectionFormats.java @@ -35,6 +35,10 @@ public class CollectionFormats { } + public static class SPACEParams extends SSVParams { + + } + public static class SSVParams extends CSVParams { public SSVParams() { diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/api/FakeApi.java index 158a7b06002..ead81434c62 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/api/FakeApi.java @@ -218,4 +218,19 @@ public interface FakeApi { @retrofit2.http.Field("param") String param, @retrofit2.http.Field("param2") String param2 ); + /** + * + * To test the collection format in query parameters + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @return Call<Void> + */ + @PUT("fake/test-query-paramters") + F.Promise> testQueryParameterCollectionFormat( + @retrofit2.http.Query("pipe") CSVParams pipe, @retrofit2.http.Query("ioutil") CSVParams ioutil, @retrofit2.http.Query("http") SPACEParams http, @retrofit2.http.Query("url") CSVParams url, @retrofit2.http.Query("context") List context + ); + } diff --git a/samples/client/petstore/java/retrofit2-play25/docs/FakeApi.md b/samples/client/petstore/java/retrofit2-play25/docs/FakeApi.md index 29d71d3620d..24e2d7f5be2 100644 --- a/samples/client/petstore/java/retrofit2-play25/docs/FakeApi.md +++ b/samples/client/petstore/java/retrofit2-play25/docs/FakeApi.md @@ -17,6 +17,7 @@ Method | HTTP request | Description [**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** fake | Fake endpoint to test group parameters (optional) [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** fake/inline-additionalProperties | test inline additionalProperties [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** fake/jsonFormData | test json serialization of form data +[**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** fake/test-query-paramters | @@ -912,3 +913,75 @@ No authorization required |-------------|-------------|------------------| | **200** | successful operation | - | + +## testQueryParameterCollectionFormat + +> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context) + + + +To test the collection format in query parameters + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + List pipe = Arrays.asList(); // List | + List ioutil = Arrays.asList(); // List | + List http = Arrays.asList(); // List | + List url = Arrays.asList(); // List | + List context = Arrays.asList(); // List | + try { + apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testQueryParameterCollectionFormat"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**List<String>**](String.md)| | + **ioutil** | [**List<String>**](String.md)| | + **http** | [**List<String>**](String.md)| | + **url** | [**List<String>**](String.md)| | + **context** | [**List<String>**](String.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/CollectionFormats.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/CollectionFormats.java index 15cfcd1bd93..20cbb0e7d6a 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/CollectionFormats.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/CollectionFormats.java @@ -35,6 +35,10 @@ public class CollectionFormats { } + public static class SPACEParams extends SSVParams { + + } + public static class SSVParams extends CSVParams { public SSVParams() { diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/api/FakeApi.java index 12e091d78ee..101757f03d0 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/api/FakeApi.java @@ -218,4 +218,19 @@ public interface FakeApi { @retrofit2.http.Field("param") String param, @retrofit2.http.Field("param2") String param2 ); + /** + * + * To test the collection format in query parameters + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @return Call<Void> + */ + @PUT("fake/test-query-paramters") + CompletionStage> testQueryParameterCollectionFormat( + @retrofit2.http.Query("pipe") CSVParams pipe, @retrofit2.http.Query("ioutil") CSVParams ioutil, @retrofit2.http.Query("http") SPACEParams http, @retrofit2.http.Query("url") CSVParams url, @retrofit2.http.Query("context") List context + ); + } diff --git a/samples/client/petstore/java/retrofit2-play26/docs/FakeApi.md b/samples/client/petstore/java/retrofit2-play26/docs/FakeApi.md index 29d71d3620d..24e2d7f5be2 100644 --- a/samples/client/petstore/java/retrofit2-play26/docs/FakeApi.md +++ b/samples/client/petstore/java/retrofit2-play26/docs/FakeApi.md @@ -17,6 +17,7 @@ Method | HTTP request | Description [**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** fake | Fake endpoint to test group parameters (optional) [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** fake/inline-additionalProperties | test inline additionalProperties [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** fake/jsonFormData | test json serialization of form data +[**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** fake/test-query-paramters | @@ -912,3 +913,75 @@ No authorization required |-------------|-------------|------------------| | **200** | successful operation | - | + +## testQueryParameterCollectionFormat + +> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context) + + + +To test the collection format in query parameters + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + List pipe = Arrays.asList(); // List | + List ioutil = Arrays.asList(); // List | + List http = Arrays.asList(); // List | + List url = Arrays.asList(); // List | + List context = Arrays.asList(); // List | + try { + apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testQueryParameterCollectionFormat"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**List<String>**](String.md)| | + **ioutil** | [**List<String>**](String.md)| | + **http** | [**List<String>**](String.md)| | + **url** | [**List<String>**](String.md)| | + **context** | [**List<String>**](String.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/CollectionFormats.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/CollectionFormats.java index 15cfcd1bd93..20cbb0e7d6a 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/CollectionFormats.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/CollectionFormats.java @@ -35,6 +35,10 @@ public class CollectionFormats { } + public static class SPACEParams extends SSVParams { + + } + public static class SSVParams extends CSVParams { public SSVParams() { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/api/FakeApi.java index 12e091d78ee..101757f03d0 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/api/FakeApi.java @@ -218,4 +218,19 @@ public interface FakeApi { @retrofit2.http.Field("param") String param, @retrofit2.http.Field("param2") String param2 ); + /** + * + * To test the collection format in query parameters + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @return Call<Void> + */ + @PUT("fake/test-query-paramters") + CompletionStage> testQueryParameterCollectionFormat( + @retrofit2.http.Query("pipe") CSVParams pipe, @retrofit2.http.Query("ioutil") CSVParams ioutil, @retrofit2.http.Query("http") SPACEParams http, @retrofit2.http.Query("url") CSVParams url, @retrofit2.http.Query("context") List context + ); + } diff --git a/samples/client/petstore/java/retrofit2/docs/FakeApi.md b/samples/client/petstore/java/retrofit2/docs/FakeApi.md index 29d71d3620d..24e2d7f5be2 100644 --- a/samples/client/petstore/java/retrofit2/docs/FakeApi.md +++ b/samples/client/petstore/java/retrofit2/docs/FakeApi.md @@ -17,6 +17,7 @@ Method | HTTP request | Description [**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** fake | Fake endpoint to test group parameters (optional) [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** fake/inline-additionalProperties | test inline additionalProperties [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** fake/jsonFormData | test json serialization of form data +[**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** fake/test-query-paramters | @@ -912,3 +913,75 @@ No authorization required |-------------|-------------|------------------| | **200** | successful operation | - | + +## testQueryParameterCollectionFormat + +> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context) + + + +To test the collection format in query parameters + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + List pipe = Arrays.asList(); // List | + List ioutil = Arrays.asList(); // List | + List http = Arrays.asList(); // List | + List url = Arrays.asList(); // List | + List context = Arrays.asList(); // List | + try { + apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testQueryParameterCollectionFormat"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**List<String>**](String.md)| | + **ioutil** | [**List<String>**](String.md)| | + **http** | [**List<String>**](String.md)| | + **url** | [**List<String>**](String.md)| | + **context** | [**List<String>**](String.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/CollectionFormats.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/CollectionFormats.java index 15cfcd1bd93..20cbb0e7d6a 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/CollectionFormats.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/CollectionFormats.java @@ -35,6 +35,10 @@ public class CollectionFormats { } + public static class SPACEParams extends SSVParams { + + } + public static class SSVParams extends CSVParams { public SSVParams() { diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/api/FakeApi.java index 79e12d56c03..69bcdb0b251 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/api/FakeApi.java @@ -213,4 +213,19 @@ public interface FakeApi { @retrofit2.http.Field("param") String param, @retrofit2.http.Field("param2") String param2 ); + /** + * + * To test the collection format in query parameters + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @return Call<Void> + */ + @PUT("fake/test-query-paramters") + Call testQueryParameterCollectionFormat( + @retrofit2.http.Query("pipe") CSVParams pipe, @retrofit2.http.Query("ioutil") CSVParams ioutil, @retrofit2.http.Query("http") SPACEParams http, @retrofit2.http.Query("url") CSVParams url, @retrofit2.http.Query("context") List context + ); + } diff --git a/samples/client/petstore/java/retrofit2rx/docs/FakeApi.md b/samples/client/petstore/java/retrofit2rx/docs/FakeApi.md index 29d71d3620d..24e2d7f5be2 100644 --- a/samples/client/petstore/java/retrofit2rx/docs/FakeApi.md +++ b/samples/client/petstore/java/retrofit2rx/docs/FakeApi.md @@ -17,6 +17,7 @@ Method | HTTP request | Description [**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** fake | Fake endpoint to test group parameters (optional) [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** fake/inline-additionalProperties | test inline additionalProperties [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** fake/jsonFormData | test json serialization of form data +[**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** fake/test-query-paramters | @@ -912,3 +913,75 @@ No authorization required |-------------|-------------|------------------| | **200** | successful operation | - | + +## testQueryParameterCollectionFormat + +> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context) + + + +To test the collection format in query parameters + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + List pipe = Arrays.asList(); // List | + List ioutil = Arrays.asList(); // List | + List http = Arrays.asList(); // List | + List url = Arrays.asList(); // List | + List context = Arrays.asList(); // List | + try { + apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testQueryParameterCollectionFormat"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**List<String>**](String.md)| | + **ioutil** | [**List<String>**](String.md)| | + **http** | [**List<String>**](String.md)| | + **url** | [**List<String>**](String.md)| | + **context** | [**List<String>**](String.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/CollectionFormats.java b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/CollectionFormats.java index 15cfcd1bd93..20cbb0e7d6a 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/CollectionFormats.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/CollectionFormats.java @@ -35,6 +35,10 @@ public class CollectionFormats { } + public static class SPACEParams extends SSVParams { + + } + public static class SSVParams extends CSVParams { public SSVParams() { diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/api/FakeApi.java index f557b64a0b5..cd8ff7deca0 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/api/FakeApi.java @@ -213,4 +213,19 @@ public interface FakeApi { @retrofit2.http.Field("param") String param, @retrofit2.http.Field("param2") String param2 ); + /** + * + * To test the collection format in query parameters + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @return Observable<Void> + */ + @PUT("fake/test-query-paramters") + Observable testQueryParameterCollectionFormat( + @retrofit2.http.Query("pipe") CSVParams pipe, @retrofit2.http.Query("ioutil") CSVParams ioutil, @retrofit2.http.Query("http") SPACEParams http, @retrofit2.http.Query("url") CSVParams url, @retrofit2.http.Query("context") List context + ); + } diff --git a/samples/client/petstore/java/retrofit2rx2/docs/FakeApi.md b/samples/client/petstore/java/retrofit2rx2/docs/FakeApi.md index 29d71d3620d..24e2d7f5be2 100644 --- a/samples/client/petstore/java/retrofit2rx2/docs/FakeApi.md +++ b/samples/client/petstore/java/retrofit2rx2/docs/FakeApi.md @@ -17,6 +17,7 @@ Method | HTTP request | Description [**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** fake | Fake endpoint to test group parameters (optional) [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** fake/inline-additionalProperties | test inline additionalProperties [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** fake/jsonFormData | test json serialization of form data +[**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** fake/test-query-paramters | @@ -912,3 +913,75 @@ No authorization required |-------------|-------------|------------------| | **200** | successful operation | - | + +## testQueryParameterCollectionFormat + +> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context) + + + +To test the collection format in query parameters + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + List pipe = Arrays.asList(); // List | + List ioutil = Arrays.asList(); // List | + List http = Arrays.asList(); // List | + List url = Arrays.asList(); // List | + List context = Arrays.asList(); // List | + try { + apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testQueryParameterCollectionFormat"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**List<String>**](String.md)| | + **ioutil** | [**List<String>**](String.md)| | + **http** | [**List<String>**](String.md)| | + **url** | [**List<String>**](String.md)| | + **context** | [**List<String>**](String.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/CollectionFormats.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/CollectionFormats.java index 15cfcd1bd93..20cbb0e7d6a 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/CollectionFormats.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/CollectionFormats.java @@ -35,6 +35,10 @@ public class CollectionFormats { } + public static class SPACEParams extends SSVParams { + + } + public static class SSVParams extends CSVParams { public SSVParams() { diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/api/FakeApi.java index 4ca310afcf8..d3cd78e39f4 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/api/FakeApi.java @@ -214,4 +214,19 @@ public interface FakeApi { @retrofit2.http.Field("param") String param, @retrofit2.http.Field("param2") String param2 ); + /** + * + * To test the collection format in query parameters + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @return Completable + */ + @PUT("fake/test-query-paramters") + Completable testQueryParameterCollectionFormat( + @retrofit2.http.Query("pipe") CSVParams pipe, @retrofit2.http.Query("ioutil") CSVParams ioutil, @retrofit2.http.Query("http") SPACEParams http, @retrofit2.http.Query("url") CSVParams url, @retrofit2.http.Query("context") List context + ); + } diff --git a/samples/client/petstore/java/vertx/docs/FakeApi.md b/samples/client/petstore/java/vertx/docs/FakeApi.md index 9224b4d80d5..4872227b32e 100644 --- a/samples/client/petstore/java/vertx/docs/FakeApi.md +++ b/samples/client/petstore/java/vertx/docs/FakeApi.md @@ -17,6 +17,7 @@ Method | HTTP request | Description [**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data +[**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-paramters | @@ -912,3 +913,75 @@ No authorization required |-------------|-------------|------------------| | **200** | successful operation | - | + +## testQueryParameterCollectionFormat + +> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context) + + + +To test the collection format in query parameters + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + List pipe = Arrays.asList(); // List | + List ioutil = Arrays.asList(); // List | + List http = Arrays.asList(); // List | + List url = Arrays.asList(); // List | + List context = Arrays.asList(); // List | + try { + apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testQueryParameterCollectionFormat"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**List<String>**](String.md)| | + **ioutil** | [**List<String>**](String.md)| | + **http** | [**List<String>**](String.md)| | + **url** | [**List<String>**](String.md)| | + **context** | [**List<String>**](String.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/FakeApi.java index 0e836e197b8..ff2793b4245 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/FakeApi.java @@ -43,4 +43,6 @@ public interface FakeApi { void testJsonFormData(String param, String param2, Handler> handler); + void testQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context, Handler> handler); + } diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/FakeApiImpl.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/FakeApiImpl.java index 4f04994cb41..9b74239af41 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/FakeApiImpl.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/FakeApiImpl.java @@ -561,4 +561,71 @@ if (param2 != null) localVarFormParams.put("param2", param2); apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarBody, localVarHeaderParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, null, resultHandler); } + /** + * + * To test the collection format in query parameters + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @param resultHandler Asynchronous result handler + */ + public void testQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context, Handler> resultHandler) { + Object localVarBody = null; + + // verify the required parameter 'pipe' is set + if (pipe == null) { + resultHandler.handle(ApiException.fail(400, "Missing the required parameter 'pipe' when calling testQueryParameterCollectionFormat")); + return; + } + + // verify the required parameter 'ioutil' is set + if (ioutil == null) { + resultHandler.handle(ApiException.fail(400, "Missing the required parameter 'ioutil' when calling testQueryParameterCollectionFormat")); + return; + } + + // verify the required parameter 'http' is set + if (http == null) { + resultHandler.handle(ApiException.fail(400, "Missing the required parameter 'http' when calling testQueryParameterCollectionFormat")); + return; + } + + // verify the required parameter 'url' is set + if (url == null) { + resultHandler.handle(ApiException.fail(400, "Missing the required parameter 'url' when calling testQueryParameterCollectionFormat")); + return; + } + + // verify the required parameter 'context' is set + if (context == null) { + resultHandler.handle(ApiException.fail(400, "Missing the required parameter 'context' when calling testQueryParameterCollectionFormat")); + return; + } + + // create path and map variables + String localVarPath = "/fake/test-query-paramters"; + + // query params + List localVarQueryParams = new ArrayList<>(); + localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "pipe", pipe)); + localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "ioutil", ioutil)); + localVarQueryParams.addAll(apiClient.parameterToPairs("space", "http", http)); + localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "url", url)); + localVarQueryParams.addAll(apiClient.parameterToPairs("multi", "context", context)); + + // header params + MultiMap localVarHeaderParams = MultiMap.caseInsensitiveMultiMap(); + + // form params + // TODO: sending files within multipart/form-data is not supported yet (because of vertx web-client) + Map localVarFormParams = new HashMap<>(); + + String[] localVarAccepts = { }; + String[] localVarContentTypes = { }; + String[] localVarAuthNames = new String[] { }; + + apiClient.invokeAPI(localVarPath, "PUT", localVarQueryParams, localVarBody, localVarHeaderParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, null, resultHandler); + } } diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/rxjava/FakeApi.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/rxjava/FakeApi.java index dee8abe5c9c..42239d4edfc 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/rxjava/FakeApi.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/rxjava/FakeApi.java @@ -356,6 +356,35 @@ public class FakeApi { delegate.testJsonFormData(param, param2, fut); })); } + /** + * + * To test the collection format in query parameters + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @param resultHandler Asynchronous result handler + */ + public void testQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context, Handler> resultHandler) { + delegate.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, resultHandler); + } + + /** + * + * To test the collection format in query parameters + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @return Asynchronous result handler (RxJava Single) + */ + public Single rxTestQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context) { + return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { + delegate.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, fut); + })); + } public static FakeApi newInstance(org.openapitools.client.api.FakeApi arg) { return arg != null ? new FakeApi(arg) : null; diff --git a/samples/client/petstore/java/webclient/docs/FakeApi.md b/samples/client/petstore/java/webclient/docs/FakeApi.md index 9a2e4770201..bc84c13561e 100644 --- a/samples/client/petstore/java/webclient/docs/FakeApi.md +++ b/samples/client/petstore/java/webclient/docs/FakeApi.md @@ -17,6 +17,7 @@ Method | HTTP request | Description [**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data +[**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-paramters | @@ -912,3 +913,75 @@ No authorization required |-------------|-------------|------------------| | **200** | successful operation | - | + +## testQueryParameterCollectionFormat + +> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context) + + + +To test the collection format in query parameters + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + List pipe = Arrays.asList(); // List | + List ioutil = Arrays.asList(); // List | + List http = Arrays.asList(); // List | + List url = Arrays.asList(); // List | + List context = Arrays.asList(); // List | + try { + apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testQueryParameterCollectionFormat"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**List<String>**](String.md)| | + **ioutil** | [**List<String>**](String.md)| | + **http** | [**List<String>**](String.md)| | + **url** | [**List<String>**](String.md)| | + **context** | [**List<String>**](String.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + 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 805dc32e6c4..958f88eb87a 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 @@ -587,4 +587,65 @@ public class FakeApi { ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); } + /** + * + * To test the collection format in query parameters + *

200 - Success + * @param pipe The pipe parameter + * @param ioutil The ioutil parameter + * @param http The http parameter + * @param url The url parameter + * @param context The context parameter + * @throws RestClientException if an error occurs while attempting to invoke the API + */ + public Mono testQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context) throws RestClientException { + Object postBody = null; + + // verify the required parameter 'pipe' is set + if (pipe == null) { + throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'pipe' when calling testQueryParameterCollectionFormat"); + } + + // verify the required parameter 'ioutil' is set + if (ioutil == null) { + throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'ioutil' when calling testQueryParameterCollectionFormat"); + } + + // verify the required parameter 'http' is set + if (http == null) { + throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'http' when calling testQueryParameterCollectionFormat"); + } + + // verify the required parameter 'url' is set + if (url == null) { + throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'url' when calling testQueryParameterCollectionFormat"); + } + + // verify the required parameter 'context' is set + if (context == null) { + throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'context' when calling testQueryParameterCollectionFormat"); + } + + String path = UriComponentsBuilder.fromPath("/fake/test-query-paramters").build().toUriString(); + + final MultiValueMap queryParams = new LinkedMultiValueMap(); + final HttpHeaders headerParams = new HttpHeaders(); + final MultiValueMap formParams = new LinkedMultiValueMap(); + + queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "pipe", pipe)); + queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "ioutil", ioutil)); + queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("space".toUpperCase(Locale.ROOT)), "http", http)); + 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)); + + final String[] accepts = { }; + final List accept = apiClient.selectHeaderAccept(accepts); + final String[] contentTypes = { }; + final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); + + String[] authNames = new String[] { }; + + ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; + return apiClient.invokeAPI(path, HttpMethod.PUT, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); + } } diff --git a/samples/client/petstore/javascript-es6/README.md b/samples/client/petstore/javascript-es6/README.md index d66a692c691..711b08bb799 100644 --- a/samples/client/petstore/javascript-es6/README.md +++ b/samples/client/petstore/javascript-es6/README.md @@ -134,6 +134,7 @@ Class | Method | HTTP request | Description *OpenApiPetstore.FakeApi* | [**testGroupParameters**](docs/FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *OpenApiPetstore.FakeApi* | [**testInlineAdditionalProperties**](docs/FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties *OpenApiPetstore.FakeApi* | [**testJsonFormData**](docs/FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data +*OpenApiPetstore.FakeApi* | [**testQueryParameterCollectionFormat**](docs/FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-paramters | *OpenApiPetstore.FakeClassnameTags123Api* | [**testClassname**](docs/FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case *OpenApiPetstore.PetApi* | [**addPet**](docs/PetApi.md#addPet) | **POST** /pet | Add a new pet to the store *OpenApiPetstore.PetApi* | [**deletePet**](docs/PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet diff --git a/samples/client/petstore/javascript-es6/docs/FakeApi.md b/samples/client/petstore/javascript-es6/docs/FakeApi.md index c46ac4f5383..46868a5f7d4 100644 --- a/samples/client/petstore/javascript-es6/docs/FakeApi.md +++ b/samples/client/petstore/javascript-es6/docs/FakeApi.md @@ -17,6 +17,7 @@ Method | HTTP request | Description [**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data +[**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-paramters | @@ -671,3 +672,56 @@ No authorization required - **Content-Type**: application/x-www-form-urlencoded - **Accept**: Not defined + +## testQueryParameterCollectionFormat + +> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context) + + + +To test the collection format in query parameters + +### Example + +```javascript +import OpenApiPetstore from 'open_api_petstore'; + +let apiInstance = new OpenApiPetstore.FakeApi(); +let pipe = ["null"]; // [String] | +let ioutil = ["null"]; // [String] | +let http = ["null"]; // [String] | +let url = ["null"]; // [String] | +let context = ["null"]; // [String] | +apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, (error, data, response) => { + if (error) { + console.error(error); + } else { + console.log('API called successfully.'); + } +}); +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**[String]**](String.md)| | + **ioutil** | [**[String]**](String.md)| | + **http** | [**[String]**](String.md)| | + **url** | [**[String]**](String.md)| | + **context** | [**[String]**](String.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + diff --git a/samples/client/petstore/javascript-es6/src/api/FakeApi.js b/samples/client/petstore/javascript-es6/src/api/FakeApi.js index 24b2405dc92..854b8face47 100644 --- a/samples/client/petstore/javascript-es6/src/api/FakeApi.js +++ b/samples/client/petstore/javascript-es6/src/api/FakeApi.js @@ -647,5 +647,70 @@ export default class FakeApi { ); } + /** + * Callback function to receive the result of the testQueryParameterCollectionFormat operation. + * @callback module:api/FakeApi~testQueryParameterCollectionFormatCallback + * @param {String} error Error message, if any. + * @param data This operation does not return a value. + * @param {String} response The complete HTTP response. + */ + + /** + * To test the collection format in query parameters + * @param {Array.} pipe + * @param {Array.} ioutil + * @param {Array.} http + * @param {Array.} url + * @param {Array.} context + * @param {module:api/FakeApi~testQueryParameterCollectionFormatCallback} callback The callback function, accepting three arguments: error, data, response + */ + testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, callback) { + 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, callback + ); + } + } diff --git a/samples/client/petstore/javascript-promise-es6/README.md b/samples/client/petstore/javascript-promise-es6/README.md index a37ff17a108..b325aae5404 100644 --- a/samples/client/petstore/javascript-promise-es6/README.md +++ b/samples/client/petstore/javascript-promise-es6/README.md @@ -132,6 +132,7 @@ Class | Method | HTTP request | Description *OpenApiPetstore.FakeApi* | [**testGroupParameters**](docs/FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *OpenApiPetstore.FakeApi* | [**testInlineAdditionalProperties**](docs/FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties *OpenApiPetstore.FakeApi* | [**testJsonFormData**](docs/FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data +*OpenApiPetstore.FakeApi* | [**testQueryParameterCollectionFormat**](docs/FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-paramters | *OpenApiPetstore.FakeClassnameTags123Api* | [**testClassname**](docs/FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case *OpenApiPetstore.PetApi* | [**addPet**](docs/PetApi.md#addPet) | **POST** /pet | Add a new pet to the store *OpenApiPetstore.PetApi* | [**deletePet**](docs/PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet diff --git a/samples/client/petstore/javascript-promise-es6/docs/FakeApi.md b/samples/client/petstore/javascript-promise-es6/docs/FakeApi.md index 88125f185d8..f28125722b0 100644 --- a/samples/client/petstore/javascript-promise-es6/docs/FakeApi.md +++ b/samples/client/petstore/javascript-promise-es6/docs/FakeApi.md @@ -17,6 +17,7 @@ Method | HTTP request | Description [**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data +[**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-paramters | @@ -658,3 +659,55 @@ No authorization required - **Content-Type**: application/x-www-form-urlencoded - **Accept**: Not defined + +## testQueryParameterCollectionFormat + +> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context) + + + +To test the collection format in query parameters + +### Example + +```javascript +import OpenApiPetstore from 'open_api_petstore'; + +let apiInstance = new OpenApiPetstore.FakeApi(); +let pipe = ["null"]; // [String] | +let ioutil = ["null"]; // [String] | +let http = ["null"]; // [String] | +let url = ["null"]; // [String] | +let context = ["null"]; // [String] | +apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context).then(() => { + console.log('API called successfully.'); +}, (error) => { + console.error(error); +}); + +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**[String]**](String.md)| | + **ioutil** | [**[String]**](String.md)| | + **http** | [**[String]**](String.md)| | + **url** | [**[String]**](String.md)| | + **context** | [**[String]**](String.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + 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 18b335d4def..f8b26290b2b 100644 --- a/samples/client/petstore/javascript-promise-es6/src/api/FakeApi.js +++ b/samples/client/petstore/javascript-promise-es6/src/api/FakeApi.js @@ -746,4 +746,78 @@ export default class FakeApi { } + /** + * To test the collection format in query parameters + * @param {Array.} pipe + * @param {Array.} ioutil + * @param {Array.} http + * @param {Array.} url + * @param {Array.} 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.} pipe + * @param {Array.} ioutil + * @param {Array.} http + * @param {Array.} url + * @param {Array.} 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; + }); + } + + } diff --git a/samples/client/petstore/javascript-promise/README.md b/samples/client/petstore/javascript-promise/README.md index 1e20aa84af1..95124df4284 100644 --- a/samples/client/petstore/javascript-promise/README.md +++ b/samples/client/petstore/javascript-promise/README.md @@ -120,6 +120,7 @@ Class | Method | HTTP request | Description *OpenApiPetstore.FakeApi* | [**testGroupParameters**](docs/FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *OpenApiPetstore.FakeApi* | [**testInlineAdditionalProperties**](docs/FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties *OpenApiPetstore.FakeApi* | [**testJsonFormData**](docs/FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data +*OpenApiPetstore.FakeApi* | [**testQueryParameterCollectionFormat**](docs/FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-paramters | *OpenApiPetstore.FakeClassnameTags123Api* | [**testClassname**](docs/FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case *OpenApiPetstore.PetApi* | [**addPet**](docs/PetApi.md#addPet) | **POST** /pet | Add a new pet to the store *OpenApiPetstore.PetApi* | [**deletePet**](docs/PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet diff --git a/samples/client/petstore/javascript-promise/docs/FakeApi.md b/samples/client/petstore/javascript-promise/docs/FakeApi.md index b5a3986744a..37ce18eea22 100644 --- a/samples/client/petstore/javascript-promise/docs/FakeApi.md +++ b/samples/client/petstore/javascript-promise/docs/FakeApi.md @@ -17,6 +17,7 @@ Method | HTTP request | Description [**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data +[**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-paramters | @@ -671,3 +672,56 @@ No authorization required - **Content-Type**: application/x-www-form-urlencoded - **Accept**: Not defined + +## testQueryParameterCollectionFormat + +> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context) + + + +To test the collection format in query parameters + +### Example + +```javascript +var OpenApiPetstore = require('open_api_petstore'); + +var apiInstance = new OpenApiPetstore.FakeApi(); +var pipe = ["null"]; // [String] | +var ioutil = ["null"]; // [String] | +var http = ["null"]; // [String] | +var url = ["null"]; // [String] | +var context = ["null"]; // [String] | +apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context).then(function() { + console.log('API called successfully.'); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**[String]**](String.md)| | + **ioutil** | [**[String]**](String.md)| | + **http** | [**[String]**](String.md)| | + **url** | [**[String]**](String.md)| | + **context** | [**[String]**](String.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + diff --git a/samples/client/petstore/javascript-promise/src/api/FakeApi.js b/samples/client/petstore/javascript-promise/src/api/FakeApi.js index d5a4c353453..84d9ef53719 100644 --- a/samples/client/petstore/javascript-promise/src/api/FakeApi.js +++ b/samples/client/petstore/javascript-promise/src/api/FakeApi.js @@ -782,6 +782,97 @@ return response_and_data.data; }); } + + + /** + * To test the collection format in query parameters + * @param {Array.} pipe + * @param {Array.} ioutil + * @param {Array.} http + * @param {Array.} url + * @param {Array.} 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.} pipe + * @param {Array.} ioutil + * @param {Array.} http + * @param {Array.} url + * @param {Array.} 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; diff --git a/samples/client/petstore/javascript/README.md b/samples/client/petstore/javascript/README.md index 153f22fa4e4..c11860f7675 100644 --- a/samples/client/petstore/javascript/README.md +++ b/samples/client/petstore/javascript/README.md @@ -123,6 +123,7 @@ Class | Method | HTTP request | Description *OpenApiPetstore.FakeApi* | [**testGroupParameters**](docs/FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *OpenApiPetstore.FakeApi* | [**testInlineAdditionalProperties**](docs/FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties *OpenApiPetstore.FakeApi* | [**testJsonFormData**](docs/FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data +*OpenApiPetstore.FakeApi* | [**testQueryParameterCollectionFormat**](docs/FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-paramters | *OpenApiPetstore.FakeClassnameTags123Api* | [**testClassname**](docs/FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case *OpenApiPetstore.PetApi* | [**addPet**](docs/PetApi.md#addPet) | **POST** /pet | Add a new pet to the store *OpenApiPetstore.PetApi* | [**deletePet**](docs/PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet diff --git a/samples/client/petstore/javascript/docs/FakeApi.md b/samples/client/petstore/javascript/docs/FakeApi.md index b2d599002da..24e490409e6 100644 --- a/samples/client/petstore/javascript/docs/FakeApi.md +++ b/samples/client/petstore/javascript/docs/FakeApi.md @@ -17,6 +17,7 @@ Method | HTTP request | Description [**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data +[**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-paramters | @@ -697,3 +698,58 @@ No authorization required - **Content-Type**: application/x-www-form-urlencoded - **Accept**: Not defined + +## testQueryParameterCollectionFormat + +> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context) + + + +To test the collection format in query parameters + +### Example + +```javascript +var OpenApiPetstore = require('open_api_petstore'); + +var apiInstance = new OpenApiPetstore.FakeApi(); +var pipe = ["null"]; // [String] | +var ioutil = ["null"]; // [String] | +var http = ["null"]; // [String] | +var url = ["null"]; // [String] | +var context = ["null"]; // [String] | +var callback = function(error, data, response) { + if (error) { + console.error(error); + } else { + console.log('API called successfully.'); + } +}; +apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, callback); +``` + +### Parameters + + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**[String]**](String.md)| | + **ioutil** | [**[String]**](String.md)| | + **http** | [**[String]**](String.md)| | + **url** | [**[String]**](String.md)| | + **context** | [**[String]**](String.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + diff --git a/samples/client/petstore/javascript/src/api/FakeApi.js b/samples/client/petstore/javascript/src/api/FakeApi.js index fc77d90b910..2c72a83ff22 100644 --- a/samples/client/petstore/javascript/src/api/FakeApi.js +++ b/samples/client/petstore/javascript/src/api/FakeApi.js @@ -684,6 +684,88 @@ authNames, contentTypes, accepts, returnType, null, callback ); } + + /** + * Callback function to receive the result of the testQueryParameterCollectionFormat operation. + * @callback module:api/FakeApi~testQueryParameterCollectionFormatCallback + * @param {String} error Error message, if any. + * @param data This operation does not return a value. + * @param {String} response The complete HTTP response. + */ + + /** + * To test the collection format in query parameters + * @param {Array.} pipe + * @param {Array.} ioutil + * @param {Array.} http + * @param {Array.} url + * @param {Array.} context + * @param {module:api/FakeApi~testQueryParameterCollectionFormatCallback} callback The callback function, accepting three arguments: error, data, response + */ + this.testQueryParameterCollectionFormat = function(pipe, ioutil, http, url, context, callback) { + 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, callback + ); + } }; return exports; diff --git a/samples/client/petstore/perl/README.md b/samples/client/petstore/perl/README.md index ee3b3777823..6f5090566a9 100644 --- a/samples/client/petstore/perl/README.md +++ b/samples/client/petstore/perl/README.md @@ -383,6 +383,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**test_group_parameters**](docs/FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *FakeApi* | [**test_inline_additional_properties**](docs/FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties *FakeApi* | [**test_json_form_data**](docs/FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data +*FakeApi* | [**test_query_parameter_collection_format**](docs/FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-paramters | *FakeClassnameTags123Api* | [**test_classname**](docs/FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case *PetApi* | [**add_pet**](docs/PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store *PetApi* | [**delete_pet**](docs/PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet diff --git a/samples/client/petstore/perl/docs/FakeApi.md b/samples/client/petstore/perl/docs/FakeApi.md index 71f47ac441d..0aa13eb6104 100644 --- a/samples/client/petstore/perl/docs/FakeApi.md +++ b/samples/client/petstore/perl/docs/FakeApi.md @@ -22,6 +22,7 @@ Method | HTTP request | Description [**test_group_parameters**](FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**test_inline_additional_properties**](FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties [**test_json_form_data**](FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data +[**test_query_parameter_collection_format**](FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-paramters | # **create_xml_item** @@ -667,3 +668,56 @@ 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) + + + +To test the collection format in query parameters + +### Example +```perl +use Data::Dumper; +use WWW::OpenAPIClient::FakeApi; +my $api_instance = WWW::OpenAPIClient::FakeApi->new( +); + +my $pipe = [("null")]; # ARRAY[string] | +my $ioutil = [("null")]; # ARRAY[string] | +my $http = [("null")]; # ARRAY[string] | +my $url = [("null")]; # ARRAY[string] | +my $context = [("null")]; # ARRAY[string] | + +eval { + $api_instance->test_query_parameter_collection_format(pipe => $pipe, ioutil => $ioutil, http => $http, url => $url, context => $context); +}; +if ($@) { + warn "Exception when calling FakeApi->test_query_parameter_collection_format: $@\n"; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**ARRAY[string]**](string.md)| | + **ioutil** | [**ARRAY[string]**](string.md)| | + **http** | [**ARRAY[string]**](string.md)| | + **url** | [**ARRAY[string]**](string.md)| | + **context** | [**ARRAY[string]**](string.md)| | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[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) + diff --git a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/FakeApi.pm b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/FakeApi.pm index 5309ef4b29c..facf8615da1 100644 --- a/samples/client/petstore/perl/lib/WWW/OpenAPIClient/FakeApi.pm +++ b/samples/client/petstore/perl/lib/WWW/OpenAPIClient/FakeApi.pm @@ -1169,4 +1169,129 @@ sub test_json_form_data { return; } +# +# test_query_parameter_collection_format +# +# +# +# @param ARRAY[string] $pipe (required) +# @param ARRAY[string] $ioutil (required) +# @param ARRAY[string] $http (required) +# @param ARRAY[string] $url (required) +# @param ARRAY[string] $context (required) +{ + my $params = { + 'pipe' => { + data_type => 'ARRAY[string]', + description => '', + required => '1', + }, + 'ioutil' => { + data_type => 'ARRAY[string]', + description => '', + required => '1', + }, + 'http' => { + data_type => 'ARRAY[string]', + description => '', + required => '1', + }, + 'url' => { + data_type => 'ARRAY[string]', + description => '', + required => '1', + }, + 'context' => { + data_type => 'ARRAY[string]', + description => '', + required => '1', + }, + }; + __PACKAGE__->method_documentation->{ 'test_query_parameter_collection_format' } = { + summary => '', + params => $params, + returns => undef, + }; +} +# @return void +# +sub test_query_parameter_collection_format { + my ($self, %args) = @_; + + # verify the required parameter 'pipe' is set + unless (exists $args{'pipe'}) { + croak("Missing the required parameter 'pipe' when calling test_query_parameter_collection_format"); + } + + # verify the required parameter 'ioutil' is set + unless (exists $args{'ioutil'}) { + croak("Missing the required parameter 'ioutil' when calling test_query_parameter_collection_format"); + } + + # verify the required parameter 'http' is set + unless (exists $args{'http'}) { + croak("Missing the required parameter 'http' when calling test_query_parameter_collection_format"); + } + + # verify the required parameter 'url' is set + unless (exists $args{'url'}) { + croak("Missing the required parameter 'url' when calling test_query_parameter_collection_format"); + } + + # verify the required parameter 'context' is set + unless (exists $args{'context'}) { + croak("Missing the required parameter 'context' when calling test_query_parameter_collection_format"); + } + + # parse inputs + my $_resource_path = '/fake/test-query-paramters'; + + my $_method = 'PUT'; + my $query_params = {}; + my $header_params = {}; + my $form_params = {}; + + # 'Accept' and 'Content-Type' header + my $_header_accept = $self->{api_client}->select_header_accept(); + if ($_header_accept) { + $header_params->{'Accept'} = $_header_accept; + } + $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type(); + + # query params + if ( exists $args{'pipe'}) { + $query_params->{'pipe'} = $self->{api_client}->to_query_value($args{'pipe'}); + } + + # query params + if ( exists $args{'ioutil'}) { + $query_params->{'ioutil'} = $self->{api_client}->to_query_value($args{'ioutil'}); + } + + # query params + if ( exists $args{'http'}) { + $query_params->{'http'} = $self->{api_client}->to_query_value($args{'http'}); + } + + # query params + if ( exists $args{'url'}) { + $query_params->{'url'} = $self->{api_client}->to_query_value($args{'url'}); + } + + # query params + if ( exists $args{'context'}) { + $query_params->{'context'} = $self->{api_client}->to_query_value($args{'context'}); + } + + my $_body_data; + # authentication setting, if any + my $auth_settings = [qw()]; + + # make the API Call + $self->{api_client}->call_api($_resource_path, $_method, + $query_params, $form_params, + $header_params, $_body_data, $auth_settings); + return; +} + 1; diff --git a/samples/client/petstore/php/OpenAPIClient-php/README.md b/samples/client/petstore/php/OpenAPIClient-php/README.md index 918f708ef90..f84c670fa30 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/README.md +++ b/samples/client/petstore/php/OpenAPIClient-php/README.md @@ -97,6 +97,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**testGroupParameters**](docs/Api/FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *FakeApi* | [**testInlineAdditionalProperties**](docs/Api/FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties *FakeApi* | [**testJsonFormData**](docs/Api/FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data +*FakeApi* | [**testQueryParameterCollectionFormat**](docs/Api/FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-paramters | *FakeClassnameTags123Api* | [**testClassname**](docs/Api/FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case *PetApi* | [**addPet**](docs/Api/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store *PetApi* | [**deletePet**](docs/Api/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet 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 21ca8b4d479..c2ac9a71e31 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/docs/Api/FakeApi.md +++ b/samples/client/petstore/php/OpenAPIClient-php/docs/Api/FakeApi.md @@ -17,6 +17,7 @@ Method | HTTP request | Description [**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data +[**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-paramters | @@ -796,3 +797,66 @@ No authorization required [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +## testQueryParameterCollectionFormat + +> testQueryParameterCollectionFormat($pipe, $ioutil, $http, $url, $context) + + + +To test the collection format in query parameters + +### Example + +```php +testQueryParameterCollectionFormat($pipe, $ioutil, $http, $url, $context); +} catch (Exception $e) { + echo 'Exception when calling FakeApi->testQueryParameterCollectionFormat: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**string[]**](../Model/string.md)| | + **ioutil** | [**string[]**](../Model/string.md)| | + **http** | [**string[]**](../Model/string.md)| | + **url** | [**string[]**](../Model/string.md)| | + **context** | [**string[]**](../Model/string.md)| | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[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) + 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 d3f96368a9d..a001add5960 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php @@ -3513,6 +3513,297 @@ class FakeApi ); } + /** + * Operation testQueryParameterCollectionFormat + * + * @param string[] $pipe pipe (required) + * @param string[] $ioutil ioutil (required) + * @param string[] $http http (required) + * @param string[] $url url (required) + * @param string[] $context context (required) + * + * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function testQueryParameterCollectionFormat($pipe, $ioutil, $http, $url, $context) + { + $this->testQueryParameterCollectionFormatWithHttpInfo($pipe, $ioutil, $http, $url, $context); + } + + /** + * Operation testQueryParameterCollectionFormatWithHttpInfo + * + * @param string[] $pipe (required) + * @param string[] $ioutil (required) + * @param string[] $http (required) + * @param string[] $url (required) + * @param string[] $context (required) + * + * @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) + { + $request = $this->testQueryParameterCollectionFormatRequest($pipe, $ioutil, $http, $url, $context); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation testQueryParameterCollectionFormatAsync + * + * + * + * @param string[] $pipe (required) + * @param string[] $ioutil (required) + * @param string[] $http (required) + * @param string[] $url (required) + * @param string[] $context (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function testQueryParameterCollectionFormatAsync($pipe, $ioutil, $http, $url, $context) + { + return $this->testQueryParameterCollectionFormatAsyncWithHttpInfo($pipe, $ioutil, $http, $url, $context) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation testQueryParameterCollectionFormatAsyncWithHttpInfo + * + * + * + * @param string[] $pipe (required) + * @param string[] $ioutil (required) + * @param string[] $http (required) + * @param string[] $url (required) + * @param string[] $context (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function testQueryParameterCollectionFormatAsyncWithHttpInfo($pipe, $ioutil, $http, $url, $context) + { + $returnType = ''; + $request = $this->testQueryParameterCollectionFormatRequest($pipe, $ioutil, $http, $url, $context); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'testQueryParameterCollectionFormat' + * + * @param string[] $pipe (required) + * @param string[] $ioutil (required) + * @param string[] $http (required) + * @param string[] $url (required) + * @param string[] $context (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function testQueryParameterCollectionFormatRequest($pipe, $ioutil, $http, $url, $context) + { + // verify the required parameter 'pipe' is set + if ($pipe === null || (is_array($pipe) && count($pipe) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $pipe when calling testQueryParameterCollectionFormat' + ); + } + // verify the required parameter 'ioutil' is set + if ($ioutil === null || (is_array($ioutil) && count($ioutil) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $ioutil when calling testQueryParameterCollectionFormat' + ); + } + // verify the required parameter 'http' is set + if ($http === null || (is_array($http) && count($http) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $http when calling testQueryParameterCollectionFormat' + ); + } + // verify the required parameter 'url' is set + if ($url === null || (is_array($url) && count($url) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $url when calling testQueryParameterCollectionFormat' + ); + } + // verify the required parameter 'context' is set + if ($context === null || (is_array($context) && count($context) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $context when calling testQueryParameterCollectionFormat' + ); + } + + $resourcePath = '/fake/test-query-paramters'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if (is_array($pipe)) { + $pipe = ObjectSerializer::serializeCollection($pipe, 'csv', true); + } + if ($pipe !== null) { + $queryParams['pipe'] = ObjectSerializer::toQueryValue($pipe); + } + // query params + if (is_array($ioutil)) { + $ioutil = ObjectSerializer::serializeCollection($ioutil, 'csv', true); + } + if ($ioutil !== null) { + $queryParams['ioutil'] = ObjectSerializer::toQueryValue($ioutil); + } + // query params + if (is_array($http)) { + $http = ObjectSerializer::serializeCollection($http, 'space', true); + } + if ($http !== null) { + $queryParams['http'] = ObjectSerializer::toQueryValue($http); + } + // query params + if (is_array($url)) { + $url = ObjectSerializer::serializeCollection($url, 'csv', true); + } + if ($url !== null) { + $queryParams['url'] = ObjectSerializer::toQueryValue($url); + } + // query params + if (is_array($context)) { + $context = ObjectSerializer::serializeCollection($context, 'multi', true); + } + if ($context !== null) { + $queryParams['context'] = ObjectSerializer::toQueryValue($context); + } + + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + [] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + [], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'PUT', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + /** * Create http client option * diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Api/FakeApiTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Api/FakeApiTest.php index c28d4a2fecc..fea248aeee7 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Api/FakeApiTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Api/FakeApiTest.php @@ -201,4 +201,14 @@ class FakeApiTest extends TestCase public function testTestJsonFormData() { } + + /** + * Test case for testQueryParameterCollectionFormat + * + * . + * + */ + public function testTestQueryParameterCollectionFormat() + { + } } diff --git a/samples/client/petstore/python-asyncio/README.md b/samples/client/petstore/python-asyncio/README.md index 27a0490dc04..3ff6ae7cf29 100644 --- a/samples/client/petstore/python-asyncio/README.md +++ b/samples/client/petstore/python-asyncio/README.md @@ -87,6 +87,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**test_group_parameters**](docs/FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *FakeApi* | [**test_inline_additional_properties**](docs/FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties *FakeApi* | [**test_json_form_data**](docs/FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data +*FakeApi* | [**test_query_parameter_collection_format**](docs/FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-paramters | *FakeClassnameTags123Api* | [**test_classname**](docs/FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case *PetApi* | [**add_pet**](docs/PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store *PetApi* | [**delete_pet**](docs/PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet diff --git a/samples/client/petstore/python-asyncio/docs/FakeApi.md b/samples/client/petstore/python-asyncio/docs/FakeApi.md index 3aa6aadb2b7..6ad90d76d77 100644 --- a/samples/client/petstore/python-asyncio/docs/FakeApi.md +++ b/samples/client/petstore/python-asyncio/docs/FakeApi.md @@ -17,6 +17,7 @@ Method | HTTP request | Description [**test_group_parameters**](FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**test_inline_additional_properties**](FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties [**test_json_form_data**](FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data +[**test_query_parameter_collection_format**](FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-paramters | # **create_xml_item** @@ -764,3 +765,63 @@ 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) + + + +To test the collection format in query parameters + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.FakeApi() +pipe = ['pipe_example'] # list[str] | +ioutil = ['ioutil_example'] # list[str] | +http = ['http_example'] # list[str] | +url = ['url_example'] # list[str] | +context = ['context_example'] # list[str] | + +try: + api_instance.test_query_parameter_collection_format(pipe, ioutil, http, url, context) +except ApiException as e: + print("Exception when calling FakeApi->test_query_parameter_collection_format: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**list[str]**](str.md)| | + **ioutil** | [**list[str]**](str.md)| | + **http** | [**list[str]**](str.md)| | + **url** | [**list[str]**](str.md)| | + **context** | [**list[str]**](str.md)| | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Success | - | + +[[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) + diff --git a/samples/client/petstore/python-asyncio/petstore_api/api/fake_api.py b/samples/client/petstore/python-asyncio/petstore_api/api/fake_api.py index 1847804c552..00333bfd2c4 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/api/fake_api.py +++ b/samples/client/petstore/python-asyncio/petstore_api/api/fake_api.py @@ -1580,3 +1580,144 @@ class FakeApi(object): _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) + + def test_query_parameter_collection_format(self, pipe, ioutil, http, url, context, **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) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param list[str] pipe: (required) + :param list[str] ioutil: (required) + :param list[str] http: (required) + :param list[str] url: (required) + :param list[str] context: (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, **kwargs) # noqa: E501 + + def test_query_parameter_collection_format_with_http_info(self, pipe, ioutil, http, url, context, **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) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param list[str] pipe: (required) + :param list[str] ioutil: (required) + :param list[str] http: (required) + :param list[str] url: (required) + :param list[str] context: (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['pipe', 'ioutil', 'http', 'url', 'context'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method test_query_parameter_collection_format" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'pipe' is set + if ('pipe' not in local_var_params or + local_var_params['pipe'] is None): + raise ApiValueError("Missing the required parameter `pipe` when calling `test_query_parameter_collection_format`") # noqa: E501 + # verify the required parameter 'ioutil' is set + if ('ioutil' not in local_var_params or + local_var_params['ioutil'] is None): + raise ApiValueError("Missing the required parameter `ioutil` when calling `test_query_parameter_collection_format`") # noqa: E501 + # verify the required parameter 'http' is set + if ('http' not in local_var_params or + local_var_params['http'] is None): + raise ApiValueError("Missing the required parameter `http` when calling `test_query_parameter_collection_format`") # noqa: E501 + # verify the required parameter 'url' is set + if ('url' not in local_var_params or + local_var_params['url'] is None): + raise ApiValueError("Missing the required parameter `url` when calling `test_query_parameter_collection_format`") # noqa: E501 + # verify the required parameter 'context' is set + if ('context' not in local_var_params or + local_var_params['context'] is None): + raise ApiValueError("Missing the required parameter `context` when calling `test_query_parameter_collection_format`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'pipe' in local_var_params: + query_params.append(('pipe', local_var_params['pipe'])) # noqa: E501 + collection_formats['pipe'] = 'csv' # noqa: E501 + if 'ioutil' in local_var_params: + query_params.append(('ioutil', local_var_params['ioutil'])) # noqa: E501 + collection_formats['ioutil'] = 'csv' # noqa: E501 + if 'http' in local_var_params: + query_params.append(('http', local_var_params['http'])) # noqa: E501 + collection_formats['http'] = 'space' # noqa: E501 + if 'url' in local_var_params: + query_params.append(('url', local_var_params['url'])) # noqa: E501 + collection_formats['url'] = 'csv' # noqa: E501 + if 'context' in local_var_params: + query_params.append(('context', local_var_params['context'])) # noqa: E501 + collection_formats['context'] = 'multi' # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/fake/test-query-paramters', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/samples/client/petstore/python-tornado/README.md b/samples/client/petstore/python-tornado/README.md index 27a0490dc04..3ff6ae7cf29 100644 --- a/samples/client/petstore/python-tornado/README.md +++ b/samples/client/petstore/python-tornado/README.md @@ -87,6 +87,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**test_group_parameters**](docs/FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *FakeApi* | [**test_inline_additional_properties**](docs/FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties *FakeApi* | [**test_json_form_data**](docs/FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data +*FakeApi* | [**test_query_parameter_collection_format**](docs/FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-paramters | *FakeClassnameTags123Api* | [**test_classname**](docs/FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case *PetApi* | [**add_pet**](docs/PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store *PetApi* | [**delete_pet**](docs/PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet diff --git a/samples/client/petstore/python-tornado/docs/FakeApi.md b/samples/client/petstore/python-tornado/docs/FakeApi.md index 3aa6aadb2b7..6ad90d76d77 100644 --- a/samples/client/petstore/python-tornado/docs/FakeApi.md +++ b/samples/client/petstore/python-tornado/docs/FakeApi.md @@ -17,6 +17,7 @@ Method | HTTP request | Description [**test_group_parameters**](FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**test_inline_additional_properties**](FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties [**test_json_form_data**](FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data +[**test_query_parameter_collection_format**](FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-paramters | # **create_xml_item** @@ -764,3 +765,63 @@ 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) + + + +To test the collection format in query parameters + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.FakeApi() +pipe = ['pipe_example'] # list[str] | +ioutil = ['ioutil_example'] # list[str] | +http = ['http_example'] # list[str] | +url = ['url_example'] # list[str] | +context = ['context_example'] # list[str] | + +try: + api_instance.test_query_parameter_collection_format(pipe, ioutil, http, url, context) +except ApiException as e: + print("Exception when calling FakeApi->test_query_parameter_collection_format: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**list[str]**](str.md)| | + **ioutil** | [**list[str]**](str.md)| | + **http** | [**list[str]**](str.md)| | + **url** | [**list[str]**](str.md)| | + **context** | [**list[str]**](str.md)| | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Success | - | + +[[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) + diff --git a/samples/client/petstore/python-tornado/petstore_api/api/fake_api.py b/samples/client/petstore/python-tornado/petstore_api/api/fake_api.py index 1847804c552..00333bfd2c4 100644 --- a/samples/client/petstore/python-tornado/petstore_api/api/fake_api.py +++ b/samples/client/petstore/python-tornado/petstore_api/api/fake_api.py @@ -1580,3 +1580,144 @@ class FakeApi(object): _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) + + def test_query_parameter_collection_format(self, pipe, ioutil, http, url, context, **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) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param list[str] pipe: (required) + :param list[str] ioutil: (required) + :param list[str] http: (required) + :param list[str] url: (required) + :param list[str] context: (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, **kwargs) # noqa: E501 + + def test_query_parameter_collection_format_with_http_info(self, pipe, ioutil, http, url, context, **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) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param list[str] pipe: (required) + :param list[str] ioutil: (required) + :param list[str] http: (required) + :param list[str] url: (required) + :param list[str] context: (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['pipe', 'ioutil', 'http', 'url', 'context'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method test_query_parameter_collection_format" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'pipe' is set + if ('pipe' not in local_var_params or + local_var_params['pipe'] is None): + raise ApiValueError("Missing the required parameter `pipe` when calling `test_query_parameter_collection_format`") # noqa: E501 + # verify the required parameter 'ioutil' is set + if ('ioutil' not in local_var_params or + local_var_params['ioutil'] is None): + raise ApiValueError("Missing the required parameter `ioutil` when calling `test_query_parameter_collection_format`") # noqa: E501 + # verify the required parameter 'http' is set + if ('http' not in local_var_params or + local_var_params['http'] is None): + raise ApiValueError("Missing the required parameter `http` when calling `test_query_parameter_collection_format`") # noqa: E501 + # verify the required parameter 'url' is set + if ('url' not in local_var_params or + local_var_params['url'] is None): + raise ApiValueError("Missing the required parameter `url` when calling `test_query_parameter_collection_format`") # noqa: E501 + # verify the required parameter 'context' is set + if ('context' not in local_var_params or + local_var_params['context'] is None): + raise ApiValueError("Missing the required parameter `context` when calling `test_query_parameter_collection_format`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'pipe' in local_var_params: + query_params.append(('pipe', local_var_params['pipe'])) # noqa: E501 + collection_formats['pipe'] = 'csv' # noqa: E501 + if 'ioutil' in local_var_params: + query_params.append(('ioutil', local_var_params['ioutil'])) # noqa: E501 + collection_formats['ioutil'] = 'csv' # noqa: E501 + if 'http' in local_var_params: + query_params.append(('http', local_var_params['http'])) # noqa: E501 + collection_formats['http'] = 'space' # noqa: E501 + if 'url' in local_var_params: + query_params.append(('url', local_var_params['url'])) # noqa: E501 + collection_formats['url'] = 'csv' # noqa: E501 + if 'context' in local_var_params: + query_params.append(('context', local_var_params['context'])) # noqa: E501 + collection_formats['context'] = 'multi' # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/fake/test-query-paramters', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/samples/client/petstore/python/README.md b/samples/client/petstore/python/README.md index 27a0490dc04..3ff6ae7cf29 100644 --- a/samples/client/petstore/python/README.md +++ b/samples/client/petstore/python/README.md @@ -87,6 +87,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**test_group_parameters**](docs/FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *FakeApi* | [**test_inline_additional_properties**](docs/FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties *FakeApi* | [**test_json_form_data**](docs/FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data +*FakeApi* | [**test_query_parameter_collection_format**](docs/FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-paramters | *FakeClassnameTags123Api* | [**test_classname**](docs/FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case *PetApi* | [**add_pet**](docs/PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store *PetApi* | [**delete_pet**](docs/PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet diff --git a/samples/client/petstore/python/docs/FakeApi.md b/samples/client/petstore/python/docs/FakeApi.md index 3aa6aadb2b7..6ad90d76d77 100644 --- a/samples/client/petstore/python/docs/FakeApi.md +++ b/samples/client/petstore/python/docs/FakeApi.md @@ -17,6 +17,7 @@ Method | HTTP request | Description [**test_group_parameters**](FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**test_inline_additional_properties**](FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties [**test_json_form_data**](FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data +[**test_query_parameter_collection_format**](FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-paramters | # **create_xml_item** @@ -764,3 +765,63 @@ 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) + + + +To test the collection format in query parameters + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.FakeApi() +pipe = ['pipe_example'] # list[str] | +ioutil = ['ioutil_example'] # list[str] | +http = ['http_example'] # list[str] | +url = ['url_example'] # list[str] | +context = ['context_example'] # list[str] | + +try: + api_instance.test_query_parameter_collection_format(pipe, ioutil, http, url, context) +except ApiException as e: + print("Exception when calling FakeApi->test_query_parameter_collection_format: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**list[str]**](str.md)| | + **ioutil** | [**list[str]**](str.md)| | + **http** | [**list[str]**](str.md)| | + **url** | [**list[str]**](str.md)| | + **context** | [**list[str]**](str.md)| | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Success | - | + +[[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) + diff --git a/samples/client/petstore/python/petstore_api/api/fake_api.py b/samples/client/petstore/python/petstore_api/api/fake_api.py index 1847804c552..00333bfd2c4 100644 --- a/samples/client/petstore/python/petstore_api/api/fake_api.py +++ b/samples/client/petstore/python/petstore_api/api/fake_api.py @@ -1580,3 +1580,144 @@ class FakeApi(object): _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) + + def test_query_parameter_collection_format(self, pipe, ioutil, http, url, context, **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) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param list[str] pipe: (required) + :param list[str] ioutil: (required) + :param list[str] http: (required) + :param list[str] url: (required) + :param list[str] context: (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, **kwargs) # noqa: E501 + + def test_query_parameter_collection_format_with_http_info(self, pipe, ioutil, http, url, context, **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) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param list[str] pipe: (required) + :param list[str] ioutil: (required) + :param list[str] http: (required) + :param list[str] url: (required) + :param list[str] context: (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['pipe', 'ioutil', 'http', 'url', 'context'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method test_query_parameter_collection_format" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'pipe' is set + if ('pipe' not in local_var_params or + local_var_params['pipe'] is None): + raise ApiValueError("Missing the required parameter `pipe` when calling `test_query_parameter_collection_format`") # noqa: E501 + # verify the required parameter 'ioutil' is set + if ('ioutil' not in local_var_params or + local_var_params['ioutil'] is None): + raise ApiValueError("Missing the required parameter `ioutil` when calling `test_query_parameter_collection_format`") # noqa: E501 + # verify the required parameter 'http' is set + if ('http' not in local_var_params or + local_var_params['http'] is None): + raise ApiValueError("Missing the required parameter `http` when calling `test_query_parameter_collection_format`") # noqa: E501 + # verify the required parameter 'url' is set + if ('url' not in local_var_params or + local_var_params['url'] is None): + raise ApiValueError("Missing the required parameter `url` when calling `test_query_parameter_collection_format`") # noqa: E501 + # verify the required parameter 'context' is set + if ('context' not in local_var_params or + local_var_params['context'] is None): + raise ApiValueError("Missing the required parameter `context` when calling `test_query_parameter_collection_format`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'pipe' in local_var_params: + query_params.append(('pipe', local_var_params['pipe'])) # noqa: E501 + collection_formats['pipe'] = 'csv' # noqa: E501 + if 'ioutil' in local_var_params: + query_params.append(('ioutil', local_var_params['ioutil'])) # noqa: E501 + collection_formats['ioutil'] = 'csv' # noqa: E501 + if 'http' in local_var_params: + query_params.append(('http', local_var_params['http'])) # noqa: E501 + collection_formats['http'] = 'space' # noqa: E501 + if 'url' in local_var_params: + query_params.append(('url', local_var_params['url'])) # noqa: E501 + collection_formats['url'] = 'csv' # noqa: E501 + if 'context' in local_var_params: + query_params.append(('context', local_var_params['context'])) # noqa: E501 + collection_formats['context'] = 'multi' # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/fake/test-query-paramters', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/samples/client/petstore/ruby/README.md b/samples/client/petstore/ruby/README.md index e7b6b2ae402..c3cbbb05666 100644 --- a/samples/client/petstore/ruby/README.md +++ b/samples/client/petstore/ruby/README.md @@ -89,6 +89,7 @@ Class | Method | HTTP request | Description *Petstore::FakeApi* | [**test_group_parameters**](docs/FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *Petstore::FakeApi* | [**test_inline_additional_properties**](docs/FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties *Petstore::FakeApi* | [**test_json_form_data**](docs/FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data +*Petstore::FakeApi* | [**test_query_parameter_collection_format**](docs/FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-paramters | *Petstore::FakeClassnameTags123Api* | [**test_classname**](docs/FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case *Petstore::PetApi* | [**add_pet**](docs/PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store *Petstore::PetApi* | [**delete_pet**](docs/PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet diff --git a/samples/client/petstore/ruby/docs/FakeApi.md b/samples/client/petstore/ruby/docs/FakeApi.md index 227bb2bf788..57ea6d6d106 100644 --- a/samples/client/petstore/ruby/docs/FakeApi.md +++ b/samples/client/petstore/ruby/docs/FakeApi.md @@ -17,6 +17,7 @@ Method | HTTP request | Description [**test_group_parameters**](FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**test_inline_additional_properties**](FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties [**test_json_form_data**](FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data +[**test_query_parameter_collection_format**](FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-paramters | @@ -684,3 +685,56 @@ No authorization required - **Content-Type**: application/x-www-form-urlencoded - **Accept**: Not defined + +## test_query_parameter_collection_format + +> test_query_parameter_collection_format(pipe, ioutil, http, url, context) + + + +To test the collection format in query parameters + +### Example + +```ruby +# load the gem +require 'petstore' + +api_instance = Petstore::FakeApi.new +pipe = ['pipe_example'] # Array | +ioutil = ['ioutil_example'] # Array | +http = ['http_example'] # Array | +url = ['url_example'] # Array | +context = ['context_example'] # Array | + +begin + api_instance.test_query_parameter_collection_format(pipe, ioutil, http, url, context) +rescue Petstore::ApiError => e + puts "Exception when calling FakeApi->test_query_parameter_collection_format: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**Array<String>**](String.md)| | + **ioutil** | [**Array<String>**](String.md)| | + **http** | [**Array<String>**](String.md)| | + **url** | [**Array<String>**](String.md)| | + **context** | [**Array<String>**](String.md)| | + +### Return type + +nil (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + 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 163c2fea794..b6a04048e7e 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb @@ -985,5 +985,92 @@ module Petstore end return data, status_code, headers end + + # To test the collection format in query parameters + # @param pipe [Array] + # @param ioutil [Array] + # @param http [Array] + # @param url [Array] + # @param context [Array] + # @param [Hash] opts the optional parameters + # @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) + nil + end + + # To test the collection format in query parameters + # @param pipe [Array] + # @param ioutil [Array] + # @param http [Array] + # @param url [Array] + # @param context [Array] + # @param [Hash] opts the optional parameters + # @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 = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FakeApi.test_query_parameter_collection_format ...' + end + # verify the required parameter 'pipe' is set + if @api_client.config.client_side_validation && pipe.nil? + fail ArgumentError, "Missing the required parameter 'pipe' when calling FakeApi.test_query_parameter_collection_format" + end + # verify the required parameter 'ioutil' is set + if @api_client.config.client_side_validation && ioutil.nil? + fail ArgumentError, "Missing the required parameter 'ioutil' when calling FakeApi.test_query_parameter_collection_format" + end + # verify the required parameter 'http' is set + if @api_client.config.client_side_validation && http.nil? + fail ArgumentError, "Missing the required parameter 'http' when calling FakeApi.test_query_parameter_collection_format" + end + # verify the required parameter 'url' is set + if @api_client.config.client_side_validation && url.nil? + fail ArgumentError, "Missing the required parameter 'url' when calling FakeApi.test_query_parameter_collection_format" + end + # verify the required parameter 'context' is set + 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 + # resource path + local_var_path = '/fake/test-query-paramters' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'pipe'] = @api_client.build_collection_param(pipe, :csv) + query_params[:'ioutil'] = @api_client.build_collection_param(ioutil, :csv) + query_params[:'http'] = @api_client.build_collection_param(http, :space) + query_params[:'url'] = @api_client.build_collection_param(url, :csv) + query_params[:'context'] = @api_client.build_collection_param(context, :multi) + + # header parameters + header_params = opts[:header_params] || {} + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] + + # auth_names + auth_names = opts[:auth_names] || [] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FakeApi#test_query_parameter_collection_format\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end end end diff --git a/samples/client/petstore/ruby/spec/api/fake_api_spec.rb b/samples/client/petstore/ruby/spec/api/fake_api_spec.rb index aa2dc701023..a1c16171897 100644 --- a/samples/client/petstore/ruby/spec/api/fake_api_spec.rb +++ b/samples/client/petstore/ruby/spec/api/fake_api_spec.rb @@ -206,4 +206,19 @@ describe 'FakeApi' do end end + # unit tests for test_query_parameter_collection_format + # To test the collection format in query parameters + # @param pipe + # @param ioutil + # @param http + # @param url + # @param context + # @param [Hash] opts the optional parameters + # @return [nil] + describe 'test_query_parameter_collection_format test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + end diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/README.md b/samples/openapi3/client/petstore/php/OpenAPIClient-php/README.md index ddff6397573..2f2c6d2e0a6 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/README.md +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/README.md @@ -98,6 +98,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**testGroupParameters**](docs/Api/FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *FakeApi* | [**testInlineAdditionalProperties**](docs/Api/FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties *FakeApi* | [**testJsonFormData**](docs/Api/FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data +*FakeApi* | [**testQueryParameterCollectionFormat**](docs/Api/FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-paramters | *FakeClassnameTags123Api* | [**testClassname**](docs/Api/FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case *PetApi* | [**addPet**](docs/Api/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store *PetApi* | [**deletePet**](docs/Api/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Api/FakeApi.md b/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Api/FakeApi.md index ddd809a7014..c3b5b2f1e27 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Api/FakeApi.md +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Api/FakeApi.md @@ -17,6 +17,7 @@ Method | HTTP request | Description [**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data +[**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-paramters | @@ -796,3 +797,66 @@ No authorization required [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +## testQueryParameterCollectionFormat + +> testQueryParameterCollectionFormat($pipe, $ioutil, $http, $url, $context) + + + +To test the collection format in query parameters + +### Example + +```php +testQueryParameterCollectionFormat($pipe, $ioutil, $http, $url, $context); +} catch (Exception $e) { + echo 'Exception when calling FakeApi->testQueryParameterCollectionFormat: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**string[]**](../Model/string.md)| | + **ioutil** | [**string[]**](../Model/string.md)| | + **http** | [**string[]**](../Model/string.md)| | + **url** | [**string[]**](../Model/string.md)| | + **context** | [**string[]**](../Model/string.md)| | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[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) + diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php index 185418cadfb..75a3b2d792a 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php @@ -3551,6 +3551,297 @@ class FakeApi ); } + /** + * Operation testQueryParameterCollectionFormat + * + * @param string[] $pipe pipe (required) + * @param string[] $ioutil ioutil (required) + * @param string[] $http http (required) + * @param string[] $url url (required) + * @param string[] $context context (required) + * + * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function testQueryParameterCollectionFormat($pipe, $ioutil, $http, $url, $context) + { + $this->testQueryParameterCollectionFormatWithHttpInfo($pipe, $ioutil, $http, $url, $context); + } + + /** + * Operation testQueryParameterCollectionFormatWithHttpInfo + * + * @param string[] $pipe (required) + * @param string[] $ioutil (required) + * @param string[] $http (required) + * @param string[] $url (required) + * @param string[] $context (required) + * + * @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) + { + $request = $this->testQueryParameterCollectionFormatRequest($pipe, $ioutil, $http, $url, $context); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation testQueryParameterCollectionFormatAsync + * + * + * + * @param string[] $pipe (required) + * @param string[] $ioutil (required) + * @param string[] $http (required) + * @param string[] $url (required) + * @param string[] $context (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function testQueryParameterCollectionFormatAsync($pipe, $ioutil, $http, $url, $context) + { + return $this->testQueryParameterCollectionFormatAsyncWithHttpInfo($pipe, $ioutil, $http, $url, $context) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation testQueryParameterCollectionFormatAsyncWithHttpInfo + * + * + * + * @param string[] $pipe (required) + * @param string[] $ioutil (required) + * @param string[] $http (required) + * @param string[] $url (required) + * @param string[] $context (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function testQueryParameterCollectionFormatAsyncWithHttpInfo($pipe, $ioutil, $http, $url, $context) + { + $returnType = ''; + $request = $this->testQueryParameterCollectionFormatRequest($pipe, $ioutil, $http, $url, $context); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'testQueryParameterCollectionFormat' + * + * @param string[] $pipe (required) + * @param string[] $ioutil (required) + * @param string[] $http (required) + * @param string[] $url (required) + * @param string[] $context (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function testQueryParameterCollectionFormatRequest($pipe, $ioutil, $http, $url, $context) + { + // verify the required parameter 'pipe' is set + if ($pipe === null || (is_array($pipe) && count($pipe) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $pipe when calling testQueryParameterCollectionFormat' + ); + } + // verify the required parameter 'ioutil' is set + if ($ioutil === null || (is_array($ioutil) && count($ioutil) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $ioutil when calling testQueryParameterCollectionFormat' + ); + } + // verify the required parameter 'http' is set + if ($http === null || (is_array($http) && count($http) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $http when calling testQueryParameterCollectionFormat' + ); + } + // verify the required parameter 'url' is set + if ($url === null || (is_array($url) && count($url) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $url when calling testQueryParameterCollectionFormat' + ); + } + // verify the required parameter 'context' is set + if ($context === null || (is_array($context) && count($context) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $context when calling testQueryParameterCollectionFormat' + ); + } + + $resourcePath = '/fake/test-query-paramters'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if (is_array($pipe)) { + $pipe = ObjectSerializer::serializeCollection($pipe, 'multi', true); + } + if ($pipe !== null) { + $queryParams['pipe'] = ObjectSerializer::toQueryValue($pipe); + } + // query params + if (is_array($ioutil)) { + $ioutil = ObjectSerializer::serializeCollection($ioutil, 'csv', true); + } + if ($ioutil !== null) { + $queryParams['ioutil'] = ObjectSerializer::toQueryValue($ioutil); + } + // query params + if (is_array($http)) { + $http = ObjectSerializer::serializeCollection($http, 'space', true); + } + if ($http !== null) { + $queryParams['http'] = ObjectSerializer::toQueryValue($http); + } + // query params + if (is_array($url)) { + $url = ObjectSerializer::serializeCollection($url, 'csv', true); + } + if ($url !== null) { + $queryParams['url'] = ObjectSerializer::toQueryValue($url); + } + // query params + if (is_array($context)) { + $context = ObjectSerializer::serializeCollection($context, 'multi', true); + } + if ($context !== null) { + $queryParams['context'] = ObjectSerializer::toQueryValue($context); + } + + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + [] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + [], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'PUT', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + /** * Create http client option * diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/FakeApiTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/FakeApiTest.php index 738ce73466c..f6930831247 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/FakeApiTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/FakeApiTest.php @@ -201,4 +201,14 @@ class FakeApiTest extends TestCase public function testTestJsonFormData() { } + + /** + * Test case for testQueryParameterCollectionFormat + * + * . + * + */ + public function testTestQueryParameterCollectionFormat() + { + } } diff --git a/samples/openapi3/client/petstore/python/README.md b/samples/openapi3/client/petstore/python/README.md index d10f52f9f63..76b4857547d 100644 --- a/samples/openapi3/client/petstore/python/README.md +++ b/samples/openapi3/client/petstore/python/README.md @@ -88,6 +88,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**test_group_parameters**](docs/FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *FakeApi* | [**test_inline_additional_properties**](docs/FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties *FakeApi* | [**test_json_form_data**](docs/FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data +*FakeApi* | [**test_query_parameter_collection_format**](docs/FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-paramters | *FakeClassnameTags123Api* | [**test_classname**](docs/FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case *PetApi* | [**add_pet**](docs/PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store *PetApi* | [**delete_pet**](docs/PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet diff --git a/samples/openapi3/client/petstore/python/docs/FakeApi.md b/samples/openapi3/client/petstore/python/docs/FakeApi.md index 6e5c9478295..428e61341c3 100644 --- a/samples/openapi3/client/petstore/python/docs/FakeApi.md +++ b/samples/openapi3/client/petstore/python/docs/FakeApi.md @@ -17,6 +17,7 @@ Method | HTTP request | Description [**test_group_parameters**](FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**test_inline_additional_properties**](FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties [**test_json_form_data**](FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data +[**test_query_parameter_collection_format**](FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-paramters | # **fake_health_get** @@ -765,3 +766,63 @@ 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) + + + +To test the collection format in query parameters + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.FakeApi() +pipe = ['pipe_example'] # list[str] | +ioutil = ['ioutil_example'] # list[str] | +http = ['http_example'] # list[str] | +url = ['url_example'] # list[str] | +context = ['context_example'] # list[str] | + +try: + api_instance.test_query_parameter_collection_format(pipe, ioutil, http, url, context) +except ApiException as e: + print("Exception when calling FakeApi->test_query_parameter_collection_format: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**list[str]**](str.md)| | + **ioutil** | [**list[str]**](str.md)| | + **http** | [**list[str]**](str.md)| | + **url** | [**list[str]**](str.md)| | + **context** | [**list[str]**](str.md)| | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Success | - | + +[[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) + diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/fake_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/fake_api.py index 3f95f76d345..bd4e6f6c3e2 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api/fake_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/fake_api.py @@ -1586,3 +1586,144 @@ class FakeApi(object): _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) + + def test_query_parameter_collection_format(self, pipe, ioutil, http, url, context, **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) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param list[str] pipe: (required) + :param list[str] ioutil: (required) + :param list[str] http: (required) + :param list[str] url: (required) + :param list[str] context: (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, **kwargs) # noqa: E501 + + def test_query_parameter_collection_format_with_http_info(self, pipe, ioutil, http, url, context, **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) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param list[str] pipe: (required) + :param list[str] ioutil: (required) + :param list[str] http: (required) + :param list[str] url: (required) + :param list[str] context: (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['pipe', 'ioutil', 'http', 'url', 'context'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method test_query_parameter_collection_format" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'pipe' is set + if ('pipe' not in local_var_params or + local_var_params['pipe'] is None): + raise ApiValueError("Missing the required parameter `pipe` when calling `test_query_parameter_collection_format`") # noqa: E501 + # verify the required parameter 'ioutil' is set + if ('ioutil' not in local_var_params or + local_var_params['ioutil'] is None): + raise ApiValueError("Missing the required parameter `ioutil` when calling `test_query_parameter_collection_format`") # noqa: E501 + # verify the required parameter 'http' is set + if ('http' not in local_var_params or + local_var_params['http'] is None): + raise ApiValueError("Missing the required parameter `http` when calling `test_query_parameter_collection_format`") # noqa: E501 + # verify the required parameter 'url' is set + if ('url' not in local_var_params or + local_var_params['url'] is None): + raise ApiValueError("Missing the required parameter `url` when calling `test_query_parameter_collection_format`") # noqa: E501 + # verify the required parameter 'context' is set + if ('context' not in local_var_params or + local_var_params['context'] is None): + raise ApiValueError("Missing the required parameter `context` when calling `test_query_parameter_collection_format`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'pipe' in local_var_params: + query_params.append(('pipe', local_var_params['pipe'])) # noqa: E501 + collection_formats['pipe'] = 'multi' # noqa: E501 + if 'ioutil' in local_var_params: + query_params.append(('ioutil', local_var_params['ioutil'])) # noqa: E501 + collection_formats['ioutil'] = 'csv' # noqa: E501 + if 'http' in local_var_params: + query_params.append(('http', local_var_params['http'])) # noqa: E501 + collection_formats['http'] = 'space' # noqa: E501 + if 'url' in local_var_params: + query_params.append(('url', local_var_params['url'])) # noqa: E501 + collection_formats['url'] = 'csv' # noqa: E501 + if 'context' in local_var_params: + query_params.append(('context', local_var_params['context'])) # noqa: E501 + collection_formats['context'] = 'multi' # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/fake/test-query-paramters', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/samples/openapi3/client/petstore/ruby-faraday/README.md b/samples/openapi3/client/petstore/ruby-faraday/README.md index 6be30fc3115..c23142438a5 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/README.md +++ b/samples/openapi3/client/petstore/ruby-faraday/README.md @@ -90,6 +90,7 @@ Class | Method | HTTP request | Description *Petstore::FakeApi* | [**test_group_parameters**](docs/FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *Petstore::FakeApi* | [**test_inline_additional_properties**](docs/FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties *Petstore::FakeApi* | [**test_json_form_data**](docs/FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data +*Petstore::FakeApi* | [**test_query_parameter_collection_format**](docs/FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-paramters | *Petstore::FakeClassnameTags123Api* | [**test_classname**](docs/FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case *Petstore::PetApi* | [**add_pet**](docs/PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store *Petstore::PetApi* | [**delete_pet**](docs/PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/FakeApi.md b/samples/openapi3/client/petstore/ruby-faraday/docs/FakeApi.md index ab79170143b..e29e28ea1a3 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/docs/FakeApi.md +++ b/samples/openapi3/client/petstore/ruby-faraday/docs/FakeApi.md @@ -17,6 +17,7 @@ Method | HTTP request | Description [**test_group_parameters**](FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**test_inline_additional_properties**](FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties [**test_json_form_data**](FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data +[**test_query_parameter_collection_format**](FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-paramters | @@ -684,3 +685,56 @@ No authorization required - **Content-Type**: application/x-www-form-urlencoded - **Accept**: Not defined + +## test_query_parameter_collection_format + +> test_query_parameter_collection_format(pipe, ioutil, http, url, context) + + + +To test the collection format in query parameters + +### Example + +```ruby +# load the gem +require 'petstore' + +api_instance = Petstore::FakeApi.new +pipe = ['pipe_example'] # Array | +ioutil = ['ioutil_example'] # Array | +http = ['http_example'] # Array | +url = ['url_example'] # Array | +context = ['context_example'] # Array | + +begin + api_instance.test_query_parameter_collection_format(pipe, ioutil, http, url, context) +rescue Petstore::ApiError => e + puts "Exception when calling FakeApi->test_query_parameter_collection_format: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**Array<String>**](String.md)| | + **ioutil** | [**Array<String>**](String.md)| | + **http** | [**Array<String>**](String.md)| | + **url** | [**Array<String>**](String.md)| | + **context** | [**Array<String>**](String.md)| | + +### Return type + +nil (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb index 9d04817774d..3ebd284fd1f 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb @@ -985,5 +985,92 @@ module Petstore end return data, status_code, headers end + + # To test the collection format in query parameters + # @param pipe [Array] + # @param ioutil [Array] + # @param http [Array] + # @param url [Array] + # @param context [Array] + # @param [Hash] opts the optional parameters + # @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) + nil + end + + # To test the collection format in query parameters + # @param pipe [Array] + # @param ioutil [Array] + # @param http [Array] + # @param url [Array] + # @param context [Array] + # @param [Hash] opts the optional parameters + # @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 = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FakeApi.test_query_parameter_collection_format ...' + end + # verify the required parameter 'pipe' is set + if @api_client.config.client_side_validation && pipe.nil? + fail ArgumentError, "Missing the required parameter 'pipe' when calling FakeApi.test_query_parameter_collection_format" + end + # verify the required parameter 'ioutil' is set + if @api_client.config.client_side_validation && ioutil.nil? + fail ArgumentError, "Missing the required parameter 'ioutil' when calling FakeApi.test_query_parameter_collection_format" + end + # verify the required parameter 'http' is set + if @api_client.config.client_side_validation && http.nil? + fail ArgumentError, "Missing the required parameter 'http' when calling FakeApi.test_query_parameter_collection_format" + end + # verify the required parameter 'url' is set + if @api_client.config.client_side_validation && url.nil? + fail ArgumentError, "Missing the required parameter 'url' when calling FakeApi.test_query_parameter_collection_format" + end + # verify the required parameter 'context' is set + 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 + # resource path + local_var_path = '/fake/test-query-paramters' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'pipe'] = @api_client.build_collection_param(pipe, :multi) + query_params[:'ioutil'] = @api_client.build_collection_param(ioutil, :csv) + query_params[:'http'] = @api_client.build_collection_param(http, :space) + query_params[:'url'] = @api_client.build_collection_param(url, :csv) + query_params[:'context'] = @api_client.build_collection_param(context, :multi) + + # header parameters + header_params = opts[:header_params] || {} + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] + + # auth_names + auth_names = opts[:auth_names] || [] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FakeApi#test_query_parameter_collection_format\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end end end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/api/fake_api_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/api/fake_api_spec.rb index 3c9cce607b8..1778f3e8efa 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/api/fake_api_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/api/fake_api_spec.rb @@ -204,4 +204,19 @@ describe 'FakeApi' do end end + # unit tests for test_query_parameter_collection_format + # To test the collection format in query parameters + # @param pipe + # @param ioutil + # @param http + # @param url + # @param context + # @param [Hash] opts the optional parameters + # @return [nil] + describe 'test_query_parameter_collection_format test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + end diff --git a/samples/openapi3/client/petstore/ruby/README.md b/samples/openapi3/client/petstore/ruby/README.md index 6be30fc3115..c23142438a5 100644 --- a/samples/openapi3/client/petstore/ruby/README.md +++ b/samples/openapi3/client/petstore/ruby/README.md @@ -90,6 +90,7 @@ Class | Method | HTTP request | Description *Petstore::FakeApi* | [**test_group_parameters**](docs/FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *Petstore::FakeApi* | [**test_inline_additional_properties**](docs/FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties *Petstore::FakeApi* | [**test_json_form_data**](docs/FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data +*Petstore::FakeApi* | [**test_query_parameter_collection_format**](docs/FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-paramters | *Petstore::FakeClassnameTags123Api* | [**test_classname**](docs/FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case *Petstore::PetApi* | [**add_pet**](docs/PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store *Petstore::PetApi* | [**delete_pet**](docs/PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet diff --git a/samples/openapi3/client/petstore/ruby/docs/FakeApi.md b/samples/openapi3/client/petstore/ruby/docs/FakeApi.md index ab79170143b..e29e28ea1a3 100644 --- a/samples/openapi3/client/petstore/ruby/docs/FakeApi.md +++ b/samples/openapi3/client/petstore/ruby/docs/FakeApi.md @@ -17,6 +17,7 @@ Method | HTTP request | Description [**test_group_parameters**](FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**test_inline_additional_properties**](FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties [**test_json_form_data**](FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data +[**test_query_parameter_collection_format**](FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-paramters | @@ -684,3 +685,56 @@ No authorization required - **Content-Type**: application/x-www-form-urlencoded - **Accept**: Not defined + +## test_query_parameter_collection_format + +> test_query_parameter_collection_format(pipe, ioutil, http, url, context) + + + +To test the collection format in query parameters + +### Example + +```ruby +# load the gem +require 'petstore' + +api_instance = Petstore::FakeApi.new +pipe = ['pipe_example'] # Array | +ioutil = ['ioutil_example'] # Array | +http = ['http_example'] # Array | +url = ['url_example'] # Array | +context = ['context_example'] # Array | + +begin + api_instance.test_query_parameter_collection_format(pipe, ioutil, http, url, context) +rescue Petstore::ApiError => e + puts "Exception when calling FakeApi->test_query_parameter_collection_format: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**Array<String>**](String.md)| | + **ioutil** | [**Array<String>**](String.md)| | + **http** | [**Array<String>**](String.md)| | + **url** | [**Array<String>**](String.md)| | + **context** | [**Array<String>**](String.md)| | + +### Return type + +nil (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/api/fake_api.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/api/fake_api.rb index 9d04817774d..3ebd284fd1f 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/api/fake_api.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/api/fake_api.rb @@ -985,5 +985,92 @@ module Petstore end return data, status_code, headers end + + # To test the collection format in query parameters + # @param pipe [Array] + # @param ioutil [Array] + # @param http [Array] + # @param url [Array] + # @param context [Array] + # @param [Hash] opts the optional parameters + # @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) + nil + end + + # To test the collection format in query parameters + # @param pipe [Array] + # @param ioutil [Array] + # @param http [Array] + # @param url [Array] + # @param context [Array] + # @param [Hash] opts the optional parameters + # @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 = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FakeApi.test_query_parameter_collection_format ...' + end + # verify the required parameter 'pipe' is set + if @api_client.config.client_side_validation && pipe.nil? + fail ArgumentError, "Missing the required parameter 'pipe' when calling FakeApi.test_query_parameter_collection_format" + end + # verify the required parameter 'ioutil' is set + if @api_client.config.client_side_validation && ioutil.nil? + fail ArgumentError, "Missing the required parameter 'ioutil' when calling FakeApi.test_query_parameter_collection_format" + end + # verify the required parameter 'http' is set + if @api_client.config.client_side_validation && http.nil? + fail ArgumentError, "Missing the required parameter 'http' when calling FakeApi.test_query_parameter_collection_format" + end + # verify the required parameter 'url' is set + if @api_client.config.client_side_validation && url.nil? + fail ArgumentError, "Missing the required parameter 'url' when calling FakeApi.test_query_parameter_collection_format" + end + # verify the required parameter 'context' is set + 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 + # resource path + local_var_path = '/fake/test-query-paramters' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'pipe'] = @api_client.build_collection_param(pipe, :multi) + query_params[:'ioutil'] = @api_client.build_collection_param(ioutil, :csv) + query_params[:'http'] = @api_client.build_collection_param(http, :space) + query_params[:'url'] = @api_client.build_collection_param(url, :csv) + query_params[:'context'] = @api_client.build_collection_param(context, :multi) + + # header parameters + header_params = opts[:header_params] || {} + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] + + # auth_names + auth_names = opts[:auth_names] || [] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FakeApi#test_query_parameter_collection_format\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end end end diff --git a/samples/openapi3/client/petstore/ruby/spec/api/fake_api_spec.rb b/samples/openapi3/client/petstore/ruby/spec/api/fake_api_spec.rb index 3c9cce607b8..1778f3e8efa 100644 --- a/samples/openapi3/client/petstore/ruby/spec/api/fake_api_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/api/fake_api_spec.rb @@ -204,4 +204,19 @@ describe 'FakeApi' do end end + # unit tests for test_query_parameter_collection_format + # To test the collection format in query parameters + # @param pipe + # @param ioutil + # @param http + # @param url + # @param context + # @param [Hash] opts the optional parameters + # @return [nil] + describe 'test_query_parameter_collection_format test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + end diff --git a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/api/FakeApi.java index d632341919d..52732fb652b 100644 --- a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/api/FakeApi.java @@ -230,6 +230,22 @@ public class FakeApi { throws NotFoundException { return delegate.testJsonFormData(param,param2); } + @PUT + @Path("/test-query-paramters") + + + @io.swagger.annotations.ApiOperation(value = "", notes = "To test the collection format in query parameters", response = Void.class, tags={ "fake", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "Success", response = Void.class) }) + public Response testQueryParameterCollectionFormat(@ApiParam(value = "",required=true, defaultValue="new ArrayList()") @DefaultValue("new ArrayList()") @QueryParam("pipe") List pipe +,@ApiParam(value = "",required=true, defaultValue="new ArrayList()") @DefaultValue("new ArrayList()") @QueryParam("ioutil") List ioutil +,@ApiParam(value = "",required=true, defaultValue="new ArrayList()") @DefaultValue("new ArrayList()") @QueryParam("http") List http +,@ApiParam(value = "",required=true, defaultValue="new ArrayList()") @DefaultValue("new ArrayList()") @QueryParam("url") List url +,@ApiParam(value = "",required=true, defaultValue="new ArrayList()") @DefaultValue("new ArrayList()") @QueryParam("context") List context +) + throws NotFoundException { + return delegate.testQueryParameterCollectionFormat(pipe,ioutil,http,url,context); + } @POST @Path("/{petId}/uploadImageWithRequiredFile") @Consumes({ "multipart/form-data" }) diff --git a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/api/FakeApiService.java b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/api/FakeApiService.java index 848b5ac67bd..2414c140c2f 100644 --- a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/api/FakeApiService.java +++ b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/api/FakeApiService.java @@ -79,6 +79,12 @@ public abstract class FakeApiService { ) throws NotFoundException; public abstract Response testJsonFormData(String param ,String param2 + ) throws NotFoundException; + public abstract Response testQueryParameterCollectionFormat(List pipe + ,List ioutil + ,List http + ,List url + ,List context ) throws NotFoundException; public abstract Response uploadFileWithRequiredFile(Long petId ,InputStream requiredFileInputStream, FileInfo requiredFileDetail diff --git a/samples/server/petstore/java-msf4j/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java b/samples/server/petstore/java-msf4j/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java index 3bd65b6d0d4..bbf37cfaaab 100644 --- a/samples/server/petstore/java-msf4j/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java +++ b/samples/server/petstore/java-msf4j/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java @@ -128,6 +128,16 @@ public class FakeApiServiceImpl extends FakeApiService { @Override public Response testJsonFormData(String param , String param2 + ) throws NotFoundException { + // do some magic! + return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + } + @Override + public Response testQueryParameterCollectionFormat(List pipe +, List ioutil +, List http +, List url +, List context ) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/api/FakeApi.java index fcc0d030d6a..0f10d00a16a 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/api/FakeApi.java @@ -177,9 +177,16 @@ public interface FakeApi { @GET @Path("/fake/jsonFormData") @Consumes({ "application/x-www-form-urlencoded" }) - @ApiOperation(value = "test json serialization of form data", tags={ "fake" }) + @ApiOperation(value = "test json serialization of form data", tags={ "fake", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation") }) public void testJsonFormData(@Multipart(value = "param") String param, @Multipart(value = "param2") String param2); + + @PUT + @Path("/fake/test-query-paramters") + @ApiOperation(value = "", tags={ "fake" }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success") }) + public void testQueryParameterCollectionFormat(@QueryParam("pipe") @NotNull List pipe, @QueryParam("ioutil") @NotNull List ioutil, @QueryParam("http") @NotNull List http, @QueryParam("url") @NotNull List url, @QueryParam("context") @NotNull List context); } diff --git a/samples/server/petstore/jaxrs-cxf/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java index 5857b27c3eb..8e4b6ab67ea 100644 --- a/samples/server/petstore/jaxrs-cxf/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java @@ -148,5 +148,11 @@ public class FakeApiServiceImpl implements FakeApi { } + public void testQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context) { + // TODO: Implement... + + + } + } diff --git a/samples/server/petstore/jaxrs-cxf/src/test/java/org/openapitools/api/FakeApiTest.java b/samples/server/petstore/jaxrs-cxf/src/test/java/org/openapitools/api/FakeApiTest.java index 55ea1b44566..ddaddcf8141 100644 --- a/samples/server/petstore/jaxrs-cxf/src/test/java/org/openapitools/api/FakeApiTest.java +++ b/samples/server/petstore/jaxrs-cxf/src/test/java/org/openapitools/api/FakeApiTest.java @@ -313,4 +313,22 @@ public class FakeApiTest { } + /** + * @throws ApiException + * if the Api call fails + */ + @Test + public void testQueryParameterCollectionFormatTest() { + List pipe = null; + List ioutil = null; + List http = null; + List url = null; + List context = null; + //api.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); + + // TODO: test validations + + + } + } diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/FakeApi.java index 726d5bf768a..dcf098f9613 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/FakeApi.java @@ -256,6 +256,22 @@ public class FakeApi { throws NotFoundException { return delegate.testJsonFormData(param, param2, securityContext); } + @PUT + @Path("/test-query-paramters") + + + @io.swagger.annotations.ApiOperation(value = "", notes = "To test the collection format in query parameters", response = Void.class, tags={ "fake", }) + @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") List pipe +,@ApiParam(value = "",required=true)@QueryParam("ioutil") List ioutil +,@ApiParam(value = "",required=true)@QueryParam("http") List http +,@ApiParam(value = "",required=true)@QueryParam("url") List url +,@ApiParam(value = "",required=true)@QueryParam("context") List context +,@Context SecurityContext securityContext) + throws NotFoundException { + return delegate.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, securityContext); + } @POST @Path("/{petId}/uploadImageWithRequiredFile") @Consumes({ "multipart/form-data" }) diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/FakeApiService.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/FakeApiService.java index 834fcfed482..4565d8b002a 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/FakeApiService.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/FakeApiService.java @@ -40,5 +40,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 param,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,SecurityContext securityContext) throws NotFoundException; public abstract Response uploadFileWithRequiredFile(Long petId,InputStream requiredFileInputStream, FormDataContentDisposition requiredFileDetail,String additionalMetadata,SecurityContext securityContext) throws NotFoundException; } diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java b/samples/server/petstore/jaxrs-datelib-j8/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java index cd0ac7e1e58..ffd3185fe0a 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java @@ -93,6 +93,11 @@ 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, SecurityContext securityContext) throws NotFoundException { + // do some magic! + return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + } + @Override public Response uploadFileWithRequiredFile(Long petId, InputStream requiredFileInputStream, FormDataContentDisposition requiredFileDetail, String additionalMetadata, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); 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 a89e7df0c2a..c97675926f7 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 @@ -256,6 +256,22 @@ public class FakeApi { throws NotFoundException { return delegate.testJsonFormData(param, param2, securityContext); } + @PUT + @Path("/test-query-paramters") + + + @io.swagger.annotations.ApiOperation(value = "", notes = "To test the collection format in query parameters", response = Void.class, tags={ "fake", }) + @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") List pipe +,@ApiParam(value = "",required=true)@QueryParam("ioutil") List ioutil +,@ApiParam(value = "",required=true)@QueryParam("http") List http +,@ApiParam(value = "",required=true)@QueryParam("url") List url +,@ApiParam(value = "",required=true)@QueryParam("context") List context +,@Context SecurityContext securityContext) + throws NotFoundException { + return delegate.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, securityContext); + } @POST @Path("/{petId}/uploadImageWithRequiredFile") @Consumes({ "multipart/form-data" }) 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 f42f7694ef6..ffb6a868cdd 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 @@ -39,5 +39,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,SecurityContext securityContext) throws NotFoundException; public abstract Response uploadFileWithRequiredFile(Long petId,InputStream requiredFileInputStream, FormDataContentDisposition requiredFileDetail,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 fe6f25e1aaa..6e2fb3f06f8 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 @@ -92,6 +92,11 @@ 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, SecurityContext securityContext) throws NotFoundException { + // do some magic! + return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + } + @Override public Response uploadFileWithRequiredFile(Long petId, InputStream requiredFileInputStream, FormDataContentDisposition requiredFileDetail, String additionalMetadata, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/api/FakeApi.java index 3a5c58f415a..c065aca629a 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/api/FakeApi.java @@ -131,6 +131,13 @@ public interface FakeApi { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) void testJsonFormData(@FormParam(value = "param") String param,@FormParam(value = "param2") String param2); + @PUT + @Path("/test-query-paramters") + @ApiOperation(value = "", notes = "To test the collection format in query parameters", tags={ "fake", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success", response = Void.class) }) + void testQueryParameterCollectionFormat(@QueryParam("pipe") @NotNull List pipe,@QueryParam("ioutil") @NotNull List ioutil,@QueryParam("http") @NotNull List http,@QueryParam("url") @NotNull List url,@QueryParam("context") @NotNull List context); + @POST @Path("/{petId}/uploadImageWithRequiredFile") @Consumes({ "multipart/form-data" }) diff --git a/samples/server/petstore/jaxrs-spec-interface/src/main/openapi/openapi.yaml b/samples/server/petstore/jaxrs-spec-interface/src/main/openapi/openapi.yaml index 67ecc530a56..9958080557a 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/main/openapi/openapi.yaml +++ b/samples/server/petstore/jaxrs-spec-interface/src/main/openapi/openapi.yaml @@ -1228,6 +1228,62 @@ paths: x-accepts: application/json x-tags: - tag: fake + /fake/test-query-paramters: + put: + description: To test the collection format in query parameters + operationId: testQueryParameterCollectionFormat + parameters: + - explode: false + in: query + name: pipe + required: true + schema: + items: + type: string + type: array + style: form + - in: query + name: ioutil + required: true + schema: + items: + type: string + type: array + - in: query + name: http + required: true + schema: + items: + type: string + type: array + style: spaceDelimited + - explode: false + in: query + name: url + required: true + schema: + items: + type: string + type: array + style: form + - explode: true + in: query + name: context + required: true + schema: + items: + type: string + type: array + style: form + responses: + 200: + content: {} + description: Success + tags: + - fake + x-accepts: application/json + x-tags: + - tag: fake /fake/{petId}/uploadImageWithRequiredFile: post: operationId: uploadFileWithRequiredFile diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/FakeApi.java index 45b18817320..37d6206104a 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/FakeApi.java @@ -170,6 +170,16 @@ public class FakeApi { return Response.ok().entity("magic!").build(); } + @PUT + @Path("/test-query-paramters") + @ApiOperation(value = "", notes = "To test the collection format in query parameters", response = Void.class, tags={ "fake", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success", response = Void.class) + }) + public Response testQueryParameterCollectionFormat(@QueryParam("pipe") @NotNull List pipe,@QueryParam("ioutil") @NotNull List ioutil,@QueryParam("http") @NotNull List http,@QueryParam("url") @NotNull List url,@QueryParam("context") @NotNull List context) { + return Response.ok().entity("magic!").build(); + } + @POST @Path("/{petId}/uploadImageWithRequiredFile") @Consumes({ "multipart/form-data" }) diff --git a/samples/server/petstore/jaxrs-spec/src/main/openapi/openapi.yaml b/samples/server/petstore/jaxrs-spec/src/main/openapi/openapi.yaml index 67ecc530a56..9958080557a 100644 --- a/samples/server/petstore/jaxrs-spec/src/main/openapi/openapi.yaml +++ b/samples/server/petstore/jaxrs-spec/src/main/openapi/openapi.yaml @@ -1228,6 +1228,62 @@ paths: x-accepts: application/json x-tags: - tag: fake + /fake/test-query-paramters: + put: + description: To test the collection format in query parameters + operationId: testQueryParameterCollectionFormat + parameters: + - explode: false + in: query + name: pipe + required: true + schema: + items: + type: string + type: array + style: form + - in: query + name: ioutil + required: true + schema: + items: + type: string + type: array + - in: query + name: http + required: true + schema: + items: + type: string + type: array + style: spaceDelimited + - explode: false + in: query + name: url + required: true + schema: + items: + type: string + type: array + style: form + - explode: true + in: query + name: context + required: true + schema: + items: + type: string + type: array + style: form + responses: + 200: + content: {} + description: Success + tags: + - fake + x-accepts: application/json + x-tags: + - tag: fake /fake/{petId}/uploadImageWithRequiredFile: post: operationId: uploadFileWithRequiredFile diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/api/FakeApi.java index b1b5f931584..856c8fefbb6 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/api/FakeApi.java @@ -232,7 +232,7 @@ public class FakeApi { @Path("/jsonFormData") @Consumes({ "application/x-www-form-urlencoded" }) - @io.swagger.annotations.ApiOperation(value = "test json serialization of form data", notes = "", response = Void.class, tags={ "fake" }) + @io.swagger.annotations.ApiOperation(value = "test json serialization of form data", notes = "", response = Void.class, tags={ "fake", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) public Response testJsonFormData( @@ -242,4 +242,21 @@ public class FakeApi { throws NotFoundException { return delegate.testJsonFormData(param,param2,securityContext); } + @PUT + @Path("/test-query-paramters") + + + @io.swagger.annotations.ApiOperation(value = "", notes = "To test the collection format in query parameters", response = Void.class, tags={ "fake" }) + @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") List pipe, + @ApiParam(value = "",required=true)@QueryParam("ioutil") List ioutil, + @ApiParam(value = "",required=true)@QueryParam("http") List http, + @ApiParam(value = "",required=true)@QueryParam("url") List url, + @ApiParam(value = "",required=true)@QueryParam("context") List context, + @Context SecurityContext securityContext) + throws NotFoundException { + return delegate.testQueryParameterCollectionFormat(pipe,ioutil,http,url,context,securityContext); + } } diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/api/FakeApiService.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/api/FakeApiService.java index 95092e85b4f..86e8f3040d8 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/api/FakeApiService.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/api/FakeApiService.java @@ -54,4 +54,6 @@ public abstract class FakeApiService { 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,SecurityContext securityContext) + throws NotFoundException; } diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java index 210912ff3b7..69b3c0f3b0b 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java @@ -106,4 +106,10 @@ public class FakeApiServiceImpl extends FakeApiService { // do some magic! 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, SecurityContext securityContext) + throws NotFoundException { + // do some magic! + return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + } } diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/api/FakeApi.java index 794c4cddd0d..0da73135d8e 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/api/FakeApi.java @@ -243,6 +243,23 @@ public class FakeApi { throws NotFoundException { return delegate.testJsonFormData(param,param2,securityContext); } + @PUT + @Path("/test-query-paramters") + + + @io.swagger.annotations.ApiOperation(value = "", notes = "To test the collection format in query parameters", response = Void.class, tags={ "fake", }) + @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") List pipe, + @ApiParam(value = "",required=true)@QueryParam("ioutil") List ioutil, + @ApiParam(value = "",required=true)@QueryParam("http") List http, + @ApiParam(value = "",required=true)@QueryParam("url") List url, + @ApiParam(value = "",required=true)@QueryParam("context") List context, + @Context SecurityContext securityContext) + throws NotFoundException { + return delegate.testQueryParameterCollectionFormat(pipe,ioutil,http,url,context,securityContext); + } @POST @Path("/{petId}/uploadImageWithRequiredFile") @Consumes({ "multipart/form-data" }) diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/api/FakeApiService.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/api/FakeApiService.java index dd2132bdad1..502afbcfccc 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/api/FakeApiService.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/api/FakeApiService.java @@ -55,6 +55,8 @@ public abstract class FakeApiService { 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,SecurityContext securityContext) + throws NotFoundException; public abstract Response uploadFileWithRequiredFile(Long petId,InputStream requiredFileInputStream, FormDataContentDisposition requiredFileDetail,String additionalMetadata,SecurityContext securityContext) throws NotFoundException; } diff --git a/samples/server/petstore/jaxrs/jersey1/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java b/samples/server/petstore/jaxrs/jersey1/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java index 258dbb0f864..7215c33e624 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java +++ b/samples/server/petstore/jaxrs/jersey1/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java @@ -108,6 +108,12 @@ 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, SecurityContext securityContext) + throws NotFoundException { + // do some magic! + return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + } + @Override public Response uploadFileWithRequiredFile(Long petId, InputStream requiredFileInputStream, FormDataContentDisposition requiredFileDetail, String additionalMetadata, SecurityContext securityContext) throws NotFoundException { // do some magic! diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/FakeApi.java index 177e149f8bb..4d1751d9eeb 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/FakeApi.java @@ -254,4 +254,20 @@ public class FakeApi { throws NotFoundException { return delegate.testJsonFormData(param, param2, securityContext); } + @PUT + @Path("/test-query-paramters") + + + @io.swagger.annotations.ApiOperation(value = "", notes = "To test the collection format in query parameters", response = Void.class, tags={ "fake", }) + @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") List pipe +,@ApiParam(value = "",required=true)@QueryParam("ioutil") List ioutil +,@ApiParam(value = "",required=true)@QueryParam("http") List http +,@ApiParam(value = "",required=true)@QueryParam("url") List url +,@ApiParam(value = "",required=true)@QueryParam("context") List context +,@Context SecurityContext securityContext) + throws NotFoundException { + return delegate.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, securityContext); + } } diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/FakeApiService.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/FakeApiService.java index dd457eb201f..561cd7ba2a5 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/FakeApiService.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/FakeApiService.java @@ -38,4 +38,5 @@ 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 param,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,SecurityContext securityContext) throws NotFoundException; } diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java index fd583260f59..8dbd3ce48f7 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java @@ -90,4 +90,9 @@ public class FakeApiServiceImpl extends FakeApiService { // do some magic! 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, SecurityContext securityContext) throws NotFoundException { + // do some magic! + return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + } } diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/FakeApi.java index 0110d936790..ce969dddcc9 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/FakeApi.java @@ -255,6 +255,22 @@ public class FakeApi { throws NotFoundException { return delegate.testJsonFormData(param, param2, securityContext); } + @PUT + @Path("/test-query-paramters") + + + @io.swagger.annotations.ApiOperation(value = "", notes = "To test the collection format in query parameters", response = Void.class, tags={ "fake", }) + @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") List pipe +,@ApiParam(value = "",required=true)@QueryParam("ioutil") List ioutil +,@ApiParam(value = "",required=true)@QueryParam("http") List http +,@ApiParam(value = "",required=true)@QueryParam("url") List url +,@ApiParam(value = "",required=true)@QueryParam("context") List context +,@Context SecurityContext securityContext) + throws NotFoundException { + return delegate.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, securityContext); + } @POST @Path("/{petId}/uploadImageWithRequiredFile") @Consumes({ "multipart/form-data" }) diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/FakeApiService.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/FakeApiService.java index 9b2c44ef2a7..4b9b5aa80e2 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/FakeApiService.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/FakeApiService.java @@ -39,5 +39,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 param,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,SecurityContext securityContext) throws NotFoundException; public abstract Response uploadFileWithRequiredFile(Long petId,InputStream requiredFileInputStream, FormDataContentDisposition requiredFileDetail,String additionalMetadata,SecurityContext securityContext) throws NotFoundException; } diff --git a/samples/server/petstore/jaxrs/jersey2/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java b/samples/server/petstore/jaxrs/jersey2/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java index ad1d5f118e2..99af04a85b5 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java +++ b/samples/server/petstore/jaxrs/jersey2/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java @@ -92,6 +92,11 @@ 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, SecurityContext securityContext) throws NotFoundException { + // do some magic! + return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + } + @Override public Response uploadFileWithRequiredFile(Long petId, InputStream requiredFileInputStream, FormDataContentDisposition requiredFileDetail, String additionalMetadata, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); 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 d65f0ce9d58..58e4a46be9b 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 @@ -437,4 +437,48 @@ class FakeApi extends Controller return response('How about implementing fakeOuterStringSerialize as a post method ?'); } + /** + * Operation testQueryParameterCollectionFormat + * + * . + * + * + * @return Http response + */ + public function testQueryParameterCollectionFormat() + { + $input = Request::all(); + + //path params validation + + + //not path params validation + if (!isset($input['pipe'])) { + throw new \InvalidArgumentException('Missing the required parameter $pipe when calling testQueryParameterCollectionFormat'); + } + $pipe = $input['pipe']; + + if (!isset($input['ioutil'])) { + throw new \InvalidArgumentException('Missing the required parameter $ioutil when calling testQueryParameterCollectionFormat'); + } + $ioutil = $input['ioutil']; + + if (!isset($input['http'])) { + throw new \InvalidArgumentException('Missing the required parameter $http when calling testQueryParameterCollectionFormat'); + } + $http = $input['http']; + + if (!isset($input['url'])) { + throw new \InvalidArgumentException('Missing the required parameter $url when calling testQueryParameterCollectionFormat'); + } + $url = $input['url']; + + if (!isset($input['context'])) { + throw new \InvalidArgumentException('Missing the required parameter $context when calling testQueryParameterCollectionFormat'); + } + $context = $input['context']; + + + return response('How about implementing testQueryParameterCollectionFormat as a put method ?'); + } } diff --git a/samples/server/petstore/php-lumen/lib/routes/web.php b/samples/server/petstore/php-lumen/lib/routes/web.php index f694f4c48d9..e4e6201b513 100644 --- a/samples/server/petstore/php-lumen/lib/routes/web.php +++ b/samples/server/petstore/php-lumen/lib/routes/web.php @@ -105,6 +105,12 @@ $router->post('/v2/fake/outer/number', 'FakeApi@fakeOuterNumberSerialize'); * Notes: Test serialization of outer string types */ $router->post('/v2/fake/outer/string', 'FakeApi@fakeOuterStringSerialize'); +/** + * put testQueryParameterCollectionFormat + * Summary: + * Notes: To test the collection format in query parameters + */ +$router->put('/v2/fake/test-query-paramters', 'FakeApi@testQueryParameterCollectionFormat'); /** * patch testClassname * Summary: To test class name in snake case diff --git a/samples/server/petstore/php-slim/README.md b/samples/server/petstore/php-slim/README.md index 3df90ccbeda..0d639b32a11 100644 --- a/samples/server/petstore/php-slim/README.md +++ b/samples/server/petstore/php-slim/README.md @@ -133,6 +133,7 @@ Class | Method | HTTP request | Description *AbstractFakeApi* | **testGroupParameters** | **DELETE** /fake | Fake endpoint to test group parameters (optional) *AbstractFakeApi* | **testInlineAdditionalProperties** | **POST** /fake/inline-additionalProperties | test inline additionalProperties *AbstractFakeApi* | **testJsonFormData** | **GET** /fake/jsonFormData | test json serialization of form data +*AbstractFakeApi* | **testQueryParameterCollectionFormat** | **PUT** /fake/test-query-paramters | *AbstractFakeClassnameTags123Api* | **testClassname** | **PATCH** /fake_classname_test | To test class name in snake case *AbstractPetApi* | **addPet** | **POST** /pet | Add a new pet to the store *AbstractPetApi* | **findPetsByStatus** | **GET** /pet/findByStatus | Finds Pets by status diff --git a/samples/server/petstore/php-slim/lib/Api/AbstractFakeApi.php b/samples/server/petstore/php-slim/lib/Api/AbstractFakeApi.php index 9197121d006..a226169c69e 100644 --- a/samples/server/petstore/php-slim/lib/Api/AbstractFakeApi.php +++ b/samples/server/petstore/php-slim/lib/Api/AbstractFakeApi.php @@ -355,4 +355,29 @@ abstract class AbstractFakeApi return $response->write($message)->withStatus(501); } + + /** + * PUT testQueryParameterCollectionFormat + * Notes: To test the collection format in query parameters + * + * @param ServerRequestInterface $request Request + * @param ResponseInterface $response Response + * @param array|null $args Path arguments + * + * @return ResponseInterface + * @throws Exception to force implementation class to override this method + */ + public function testQueryParameterCollectionFormat(ServerRequestInterface $request, ResponseInterface $response, array $args) + { + $queryParams = $request->getQueryParams(); + $pipe = $request->getQueryParam('pipe'); + $ioutil = $request->getQueryParam('ioutil'); + $http = $request->getQueryParam('http'); + $url = $request->getQueryParam('url'); + $context = $request->getQueryParam('context'); + $message = "How about implementing testQueryParameterCollectionFormat as a PUT method in OpenAPIServer\Api\FakeApi class?"; + throw new Exception($message); + + return $response->write($message)->withStatus(501); + } } diff --git a/samples/server/petstore/php-slim/lib/SlimRouter.php b/samples/server/petstore/php-slim/lib/SlimRouter.php index d39788c0e9f..7d084c80b57 100644 --- a/samples/server/petstore/php-slim/lib/SlimRouter.php +++ b/samples/server/petstore/php-slim/lib/SlimRouter.php @@ -210,6 +210,17 @@ class SlimRouter 'authMethods' => [ ], ], + [ + 'httpMethod' => 'PUT', + 'basePathWithoutHost' => '/v2', + 'path' => '/fake/test-query-paramters', + 'apiPackage' => 'OpenAPIServer\Api', + 'classname' => 'AbstractFakeApi', + 'userClassname' => 'FakeApi', + 'operationId' => 'testQueryParameterCollectionFormat', + 'authMethods' => [ + ], + ], [ 'httpMethod' => 'PATCH', 'basePathWithoutHost' => '/v2', diff --git a/samples/server/petstore/php-ze-ph/application/config/path_handler.yml b/samples/server/petstore/php-ze-ph/application/config/path_handler.yml index 33daffd998c..786a0330ced 100644 --- a/samples/server/petstore/php-ze-ph/application/config/path_handler.yml +++ b/samples/server/petstore/php-ze-ph/application/config/path_handler.yml @@ -12,6 +12,7 @@ Articus\PathHandler\RouteInjection\Factory: - App\Handler\FakeOuterComposite - App\Handler\FakeOuterNumber - App\Handler\FakeOuterString + - App\Handler\FakeTestQueryParamters - App\Handler\FakePetIdUploadImageWithRequiredFile - App\Handler\FakeClassnameTest - App\Handler\Pet @@ -53,6 +54,7 @@ Zend\ServiceManager\AbstractFactory\ConfigAbstractFactory: App\Handler\FakeOuterComposite: [] App\Handler\FakeOuterNumber: [] App\Handler\FakeOuterString: [] + App\Handler\FakeTestQueryParamters: [] App\Handler\FakePetIdUploadImageWithRequiredFile: [] App\Handler\FakeClassnameTest: [] App\Handler\Pet: [] diff --git a/samples/server/petstore/php-ze-ph/src/App/Handler/FakeTestQueryParamters.php b/samples/server/petstore/php-ze-ph/src/App/Handler/FakeTestQueryParamters.php new file mode 100644 index 00000000000..0648ce97f2d --- /dev/null +++ b/samples/server/petstore/php-ze-ph/src/App/Handler/FakeTestQueryParamters.php @@ -0,0 +1,29 @@ +> testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context) { + return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)); + + } + + @ApiOperation(value = "uploads an image (required)", nickname = "uploadFileWithRequiredFile", notes = "", response = ModelApiResponse.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeApi.java index 3773cff1b62..e055e00b340 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeApi.java @@ -221,6 +221,17 @@ public interface FakeApi { } + @ApiOperation(value = "", nickname = "testQueryParameterCollectionFormat", notes = "To test the collection format in query parameters", tags={ "fake", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success") }) + @RequestMapping(value = "/fake/test-query-paramters", + method = RequestMethod.PUT) + default ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + @ApiOperation(value = "uploads an image (required)", nickname = "uploadFileWithRequiredFile", notes = "", response = ModelApiResponse.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApi.java index 318dd09fa7e..535c019b021 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApi.java @@ -158,6 +158,14 @@ public interface FakeApi { ResponseEntity testJsonFormData(@ApiParam(value = "field1", required=true) @RequestParam(value="param", required=true) String param,@ApiParam(value = "field2", required=true) @RequestParam(value="param2", required=true) String param2); + @ApiOperation(value = "", nickname = "testQueryParameterCollectionFormat", notes = "To test the collection format in query parameters", tags={ "fake", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success") }) + @RequestMapping(value = "/fake/test-query-paramters", + method = RequestMethod.PUT) + ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context); + + @ApiOperation(value = "uploads an image (required)", nickname = "uploadFileWithRequiredFile", notes = "", response = ModelApiResponse.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApiController.java index 651f4147e8e..dc60b728055 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApiController.java @@ -118,6 +118,11 @@ public class FakeApiController implements FakeApi { } + public ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + public ResponseEntity uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "file detail") @Valid @RequestPart("file") MultipartFile requiredFile,@ApiParam(value = "Additional data to pass to server") @RequestParam(value="additionalMetadata", required=false) String additionalMetadata) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApi.java index 318dd09fa7e..535c019b021 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApi.java @@ -158,6 +158,14 @@ public interface FakeApi { ResponseEntity testJsonFormData(@ApiParam(value = "field1", required=true) @RequestParam(value="param", required=true) String param,@ApiParam(value = "field2", required=true) @RequestParam(value="param2", required=true) String param2); + @ApiOperation(value = "", nickname = "testQueryParameterCollectionFormat", notes = "To test the collection format in query parameters", tags={ "fake", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success") }) + @RequestMapping(value = "/fake/test-query-paramters", + method = RequestMethod.PUT) + ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context); + + @ApiOperation(value = "uploads an image (required)", nickname = "uploadFileWithRequiredFile", notes = "", response = ModelApiResponse.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApiController.java index 4249e8e1461..d03f6b39ba5 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApiController.java @@ -118,6 +118,11 @@ public class FakeApiController implements FakeApi { } + public ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + public ResponseEntity uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "file detail") @Valid @RequestPart("file") MultipartFile requiredFile,@ApiParam(value = "Additional data to pass to server") @RequestParam(value="additionalMetadata", required=false) String additionalMetadata) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApi.java index 9a0eed03978..125bbb33124 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApi.java @@ -188,6 +188,16 @@ public interface FakeApi { } + @ApiOperation(value = "", nickname = "testQueryParameterCollectionFormat", notes = "To test the collection format in query parameters", tags={ "fake", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success") }) + @RequestMapping(value = "/fake/test-query-paramters", + method = RequestMethod.PUT) + default ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context) { + return getDelegate().testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); + } + + @ApiOperation(value = "uploads an image (required)", nickname = "uploadFileWithRequiredFile", notes = "", response = ModelApiResponse.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApiDelegate.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApiDelegate.java index 8bd986cceb1..03441e760eb 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApiDelegate.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApiDelegate.java @@ -180,6 +180,18 @@ public interface FakeApiDelegate { } + /** + * @see FakeApi#testQueryParameterCollectionFormat + */ + default ResponseEntity testQueryParameterCollectionFormat(List pipe, + List ioutil, + List http, + List url, + List context) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + /** * @see FakeApi#uploadFileWithRequiredFile */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java index 318dd09fa7e..535c019b021 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java @@ -158,6 +158,14 @@ public interface FakeApi { ResponseEntity testJsonFormData(@ApiParam(value = "field1", required=true) @RequestParam(value="param", required=true) String param,@ApiParam(value = "field2", required=true) @RequestParam(value="param2", required=true) String param2); + @ApiOperation(value = "", nickname = "testQueryParameterCollectionFormat", notes = "To test the collection format in query parameters", tags={ "fake", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success") }) + @RequestMapping(value = "/fake/test-query-paramters", + method = RequestMethod.PUT) + ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context); + + @ApiOperation(value = "uploads an image (required)", nickname = "uploadFileWithRequiredFile", notes = "", response = ModelApiResponse.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiController.java index fd956bffb89..dcfb5423b51 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiController.java @@ -91,6 +91,10 @@ public class FakeApiController implements FakeApi { return delegate.testJsonFormData(param, param2); } + public ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context) { + return delegate.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); + } + public ResponseEntity uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "file detail") @Valid @RequestPart("file") MultipartFile requiredFile,@ApiParam(value = "Additional data to pass to server") @RequestParam(value="additionalMetadata", required=false) String additionalMetadata) { return delegate.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiDelegate.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiDelegate.java index 54b6a75569e..fea1038544c 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiDelegate.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiDelegate.java @@ -117,6 +117,15 @@ public interface FakeApiDelegate { ResponseEntity testJsonFormData(String param, String param2); + /** + * @see FakeApi#testQueryParameterCollectionFormat + */ + ResponseEntity testQueryParameterCollectionFormat(List pipe, + List ioutil, + List http, + List url, + List context); + /** * @see FakeApi#uploadFileWithRequiredFile */ diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java index 5be814af9b4..f8ed0fadd82 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java @@ -251,6 +251,19 @@ public interface FakeApi { } + @ApiOperation(value = "", nickname = "testQueryParameterCollectionFormat", notes = "To test the collection format in query parameters", tags={ "fake", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success") }) + @ApiImplicitParams({ + }) + @RequestMapping(value = "/fake/test-query-paramters", + method = RequestMethod.PUT) + default ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + @ApiOperation(value = "uploads an image (required)", nickname = "uploadFileWithRequiredFile", notes = "", response = ModelApiResponse.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java index 07695c6ec81..e05b98b4421 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java @@ -191,6 +191,16 @@ public interface FakeApi { } + @ApiOperation(value = "", nickname = "testQueryParameterCollectionFormat", notes = "To test the collection format in query parameters", tags={ "fake", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success") }) + @RequestMapping(value = "/fake/test-query-paramters", + method = RequestMethod.PUT) + default Mono> testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context, ServerWebExchange exchange) { + return getDelegate().testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, exchange); + } + + @ApiOperation(value = "uploads an image (required)", nickname = "uploadFileWithRequiredFile", notes = "", response = ModelApiResponse.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiDelegate.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiDelegate.java index 6ab9d3e32d8..2c23dcd502b 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiDelegate.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiDelegate.java @@ -218,6 +218,21 @@ public interface FakeApiDelegate { } + /** + * @see FakeApi#testQueryParameterCollectionFormat + */ + default Mono> testQueryParameterCollectionFormat(List pipe, + List ioutil, + List http, + List url, + List context, + ServerWebExchange exchange) { + Mono result = Mono.empty(); + exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); + return result.then(Mono.empty()); + + } + /** * @see FakeApi#uploadFileWithRequiredFile */ diff --git a/samples/server/petstore/springboot-reactive/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-reactive/src/main/resources/openapi.yaml index 67ecc530a56..9958080557a 100644 --- a/samples/server/petstore/springboot-reactive/src/main/resources/openapi.yaml +++ b/samples/server/petstore/springboot-reactive/src/main/resources/openapi.yaml @@ -1228,6 +1228,62 @@ paths: x-accepts: application/json x-tags: - tag: fake + /fake/test-query-paramters: + put: + description: To test the collection format in query parameters + operationId: testQueryParameterCollectionFormat + parameters: + - explode: false + in: query + name: pipe + required: true + schema: + items: + type: string + type: array + style: form + - in: query + name: ioutil + required: true + schema: + items: + type: string + type: array + - in: query + name: http + required: true + schema: + items: + type: string + type: array + style: spaceDelimited + - explode: false + in: query + name: url + required: true + schema: + items: + type: string + type: array + style: form + - explode: true + in: query + name: context + required: true + schema: + items: + type: string + type: array + style: form + responses: + 200: + content: {} + description: Success + tags: + - fake + x-accepts: application/json + x-tags: + - tag: fake /fake/{petId}/uploadImageWithRequiredFile: post: operationId: uploadFileWithRequiredFile diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java index eaa3162bec9..f909507d495 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java @@ -221,6 +221,17 @@ public interface FakeApi { } + @ApiOperation(value = "", nickname = "testQueryParameterCollectionFormat", notes = "To test the collection format in query parameters", tags={ "fake", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success") }) + @RequestMapping(value = "/fake/test-query-paramters", + method = RequestMethod.PUT) + default ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + @ApiOperation(value = "uploads an image (required)", nickname = "uploadFileWithRequiredFile", notes = "", response = ModelApiResponse.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApi.java index 73ae14b0900..c16ceaabfad 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApi.java @@ -237,6 +237,18 @@ public interface FakeApi { } + @ApiVirtual + @ApiOperation(value = "", nickname = "testQueryParameterCollectionFormat", notes = "To test the collection format in query parameters", tags={ "fake", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success") }) + @RequestMapping(value = "/fake/test-query-paramters", + method = RequestMethod.PUT) + default ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + @ApiVirtual @ApiOperation(value = "uploads an image (required)", nickname = "uploadFileWithRequiredFile", notes = "", response = ModelApiResponse.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java index 57721a746fe..4b999103a56 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java @@ -221,6 +221,17 @@ public interface FakeApi { } + @ApiOperation(value = "", nickname = "testQueryParameterCollectionFormat", notes = "To test the collection format in query parameters", tags={ "fake", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success") }) + @RequestMapping(value = "/fake/test-query-paramters", + method = RequestMethod.PUT) + default ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + @ApiOperation(value = "uploads an image (required)", nickname = "uploadFileWithRequiredFile", notes = "", response = ModelApiResponse.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),