Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1065,13 +1065,14 @@ private String mapCollectionFormat(String collectionFormat) {
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");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -549,14 +549,15 @@ private String makeQueryListType(String type, String collectionFormat) {
return "(QueryList 'CommaSeparated (" + type + "))";
case "tsv":
return "(QueryList 'TabSeparated (" + type + "))";
case "space":
case "ssv":
return "(QueryList 'SpaceSeparated (" + type + "))";
case "pipes":
return "(QueryList 'PipeSeparated (" + type + "))";
case "multi":
return "(QueryList 'MultiParamArray (" + type + "))";
default:
throw new UnsupportedOperationException();
throw new UnsupportedOperationException(collectionFormat + " (collection format) not supported");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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) :
Expand Down Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ public class CollectionFormats {

}

public static class SPACEParams extends SSVParams {

}

public static class SSVParams extends CSVParams {

public SSVParams() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ public class CollectionFormats {

}

public static class SPACEParams extends SSVParams {

}

public static class SSVParams extends CSVParams {

public SSVParams() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 |


<a name="createxmlitem"></a>
Expand Down Expand Up @@ -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)

<a name="testqueryparametercollectionformat"></a>
# **TestQueryParameterCollectionFormat**
> void TestQueryParameterCollectionFormat (List<string> pipe, List<string> ioutil, List<string> http, List<string> url, List<string> 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<string>(); // List<string> |
var ioutil = new List<string>(); // List<string> |
var http = new List<string>(); // List<string> |
var url = new List<string>(); // List<string> |
var context = new List<string>(); // List<string> |

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&lt;string&gt;**](string.md)| |
**ioutil** | [**List&lt;string&gt;**](string.md)| |
**http** | [**List&lt;string&gt;**](string.md)| |
**url** | [**List&lt;string&gt;**](string.md)| |
**context** | [**List&lt;string&gt;**](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)

Loading