Skip to content

Commit

Permalink
Fix typescript generator for parameter collectionFormat for pipes ssv (
Browse files Browse the repository at this point in the history
…#6553)

Co-authored-by: David Biesack <David.Biesack@apiture.com>
Co-authored-by: William Cheng <wing328hk@gmail.com>
Co-authored-by: Vikrant Balyan <vvb@users.noreply.github.com>
Co-authored-by: Michele Albano <michele.albano@gmail.com>
Co-authored-by: Esteban Gehring <esteban.gehring@bithost.ch>
  • Loading branch information
6 people authored Jun 5, 2020
1 parent c102ced commit 835dab4
Show file tree
Hide file tree
Showing 36 changed files with 40 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5594,9 +5594,9 @@ protected String getCollectionFormat(Parameter parameter) {
} else if (Parameter.StyleEnum.SIMPLE.equals(parameter.getStyle())) {
return "csv";
} else if (Parameter.StyleEnum.PIPEDELIMITED.equals(parameter.getStyle())) {
return "pipe";
return "pipes";
} else if (Parameter.StyleEnum.SPACEDELIMITED.equals(parameter.getStyle())) {
return "space";
return "ssv";
} else {
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2671,7 +2671,7 @@ public Org.OpenAPITools.Client.ApiResponse<Object> TestQueryParameterCollectionF

localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "pipe", pipe));
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "ioutil", ioutil));
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("space", "http", http));
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("ssv", "http", http));
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "url", url));
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("multi", "context", context));

Expand Down Expand Up @@ -2754,7 +2754,7 @@ public async System.Threading.Tasks.Task TestQueryParameterCollectionFormatAsync

localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "pipe", pipe));
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "ioutil", ioutil));
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("space", "http", http));
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("ssv", "http", http));
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "url", url));
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("multi", "context", context));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2671,7 +2671,7 @@ public Org.OpenAPITools.Client.ApiResponse<Object> TestQueryParameterCollectionF

localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "pipe", pipe));
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "ioutil", ioutil));
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("space", "http", http));
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("ssv", "http", http));
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "url", url));
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("multi", "context", context));

Expand Down Expand Up @@ -2754,7 +2754,7 @@ public async System.Threading.Tasks.Task TestQueryParameterCollectionFormatAsync

localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "pipe", pipe));
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "ioutil", ioutil));
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("space", "http", http));
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("ssv", "http", http));
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "url", url));
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("multi", "context", context));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3004,7 +3004,7 @@ public ApiResponse<Object> TestQueryParameterCollectionFormatWithHttpInfo (List<

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 (http != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("ssv", "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

Expand Down Expand Up @@ -3095,7 +3095,7 @@ public ApiResponse<Object> TestQueryParameterCollectionFormatWithHttpInfo (List<

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 (http != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("ssv", "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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1710,7 +1710,7 @@ func (r apiTestQueryParameterCollectionFormatRequest) Execute() (*_nethttp.Respo

localVarQueryParams.Add("pipe", parameterToString(*r.pipe, "csv"))
localVarQueryParams.Add("ioutil", parameterToString(*r.ioutil, "csv"))
localVarQueryParams.Add("http", parameterToString(*r.http, "space"))
localVarQueryParams.Add("http", parameterToString(*r.http, "ssv"))
localVarQueryParams.Add("url", parameterToString(*r.url, "csv"))
{
t := *r.context
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/go/go-petstore-withXml/api_fake.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion samples/client/petstore/go/go-petstore/api_fake.go
Original file line number Diff line number Diff line change
Expand Up @@ -1169,7 +1169,7 @@ func (a *FakeApiService) TestQueryParameterCollectionFormat(ctx _context.Context

localVarQueryParams.Add("pipe", parameterToString(pipe, "csv"))
localVarQueryParams.Add("ioutil", parameterToString(ioutil, "csv"))
localVarQueryParams.Add("http", parameterToString(http, "space"))
localVarQueryParams.Add("http", parameterToString(http, "ssv"))
localVarQueryParams.Add("url", parameterToString(url, "csv"))
{
t:=context
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ public TestQueryParameterCollectionFormatQueryParams ioutil(final List<String> v
return this;
}
public TestQueryParameterCollectionFormatQueryParams http(final List<String> value) {
put("http", EncodingUtils.encodeCollection(value, "space"));
put("http", EncodingUtils.encodeCollection(value, "ssv"));
return this;
}
public TestQueryParameterCollectionFormatQueryParams url(final List<String> value) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,7 @@ public void testQueryParameterCollectionFormat(List<String> pipe, List<String> i

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("ssv", "http", http));
localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("csv", "url", url));
localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("multi", "context", context));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1174,7 +1174,7 @@ public ApiResponse<Void> testQueryParameterCollectionFormatWithHttpInfo(List<Str

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("ssv", "http", http));
localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "url", url));
localVarQueryParams.addAll(apiClient.parameterToPairs("multi", "context", context));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -837,7 +837,7 @@ public void testQueryParameterCollectionFormat (List<String> pipe, List<String>
List<Pair> 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("ssv", "http", http));
localVarQueryParams.addAll(ApiClient.parameterToPairs("csv", "url", url));
localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "context", context));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1791,7 +1791,7 @@ public okhttp3.Call testQueryParameterCollectionFormatCall(List<String> pipe, Li
}

if (http != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("space", "http", http));
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("ssv", "http", http));
}

if (url != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1791,7 +1791,7 @@ public okhttp3.Call testQueryParameterCollectionFormatCall(List<String> pipe, Li
}

if (http != null) {
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("space", "http", http));
localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("ssv", "http", http));
}

if (url != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,7 @@ public void testQueryParameterCollectionFormat(List<String> pipe, List<String> i

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("ssv", "http", http));
localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "url", url));
localVarQueryParams.addAll(apiClient.parameterToPairs("multi", "context", context));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -852,7 +852,7 @@ public ResponseEntity<Void> testQueryParameterCollectionFormatWithHttpInfo(List<

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("ssv".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));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -852,7 +852,7 @@ public ResponseEntity<Void> testQueryParameterCollectionFormatWithHttpInfo(List<

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("ssv".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));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ F.Promise<Response<Void>> testJsonFormData(
*/
@PUT("fake/test-query-paramters")
F.Promise<Response<Void>> 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<String> context
@retrofit2.http.Query("pipe") CSVParams pipe, @retrofit2.http.Query("ioutil") CSVParams ioutil, @retrofit2.http.Query("http") SSVParams http, @retrofit2.http.Query("url") CSVParams url, @retrofit2.http.Query("context") List<String> context
);

}
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ CompletionStage<Response<Void>> testJsonFormData(
*/
@PUT("fake/test-query-paramters")
CompletionStage<Response<Void>> 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<String> context
@retrofit2.http.Query("pipe") CSVParams pipe, @retrofit2.http.Query("ioutil") CSVParams ioutil, @retrofit2.http.Query("http") SSVParams http, @retrofit2.http.Query("url") CSVParams url, @retrofit2.http.Query("context") List<String> context
);

}
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ CompletionStage<Response<Void>> testJsonFormData(
*/
@PUT("fake/test-query-paramters")
CompletionStage<Response<Void>> 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<String> context
@retrofit2.http.Query("pipe") CSVParams pipe, @retrofit2.http.Query("ioutil") CSVParams ioutil, @retrofit2.http.Query("http") SSVParams http, @retrofit2.http.Query("url") CSVParams url, @retrofit2.http.Query("context") List<String> context
);

}
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ Call<Void> testJsonFormData(
*/
@PUT("fake/test-query-paramters")
Call<Void> 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<String> context
@retrofit2.http.Query("pipe") CSVParams pipe, @retrofit2.http.Query("ioutil") CSVParams ioutil, @retrofit2.http.Query("http") SSVParams http, @retrofit2.http.Query("url") CSVParams url, @retrofit2.http.Query("context") List<String> context
);

}
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ Observable<Void> testJsonFormData(
*/
@PUT("fake/test-query-paramters")
Observable<Void> 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<String> context
@retrofit2.http.Query("pipe") CSVParams pipe, @retrofit2.http.Query("ioutil") CSVParams ioutil, @retrofit2.http.Query("http") SSVParams http, @retrofit2.http.Query("url") CSVParams url, @retrofit2.http.Query("context") List<String> context
);

}
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ Completable testJsonFormData(
*/
@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<String> context
@retrofit2.http.Query("pipe") CSVParams pipe, @retrofit2.http.Query("ioutil") CSVParams ioutil, @retrofit2.http.Query("http") SSVParams http, @retrofit2.http.Query("url") CSVParams url, @retrofit2.http.Query("context") List<String> context
);

}
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@ public void testQueryParameterCollectionFormat(List<String> pipe, List<String> i
List<Pair> 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("ssv", "http", http));
localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "url", url));
localVarQueryParams.addAll(apiClient.parameterToPairs("multi", "context", context));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ public Mono<Void> testQueryParameterCollectionFormat(List<String> pipe, List<Str

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("ssv".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));

Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/javascript-es6/src/api/FakeApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,7 @@ export default class FakeApi {
let queryParams = {
'pipe': this.apiClient.buildCollectionParam(pipe, 'multi'),
'ioutil': this.apiClient.buildCollectionParam(ioutil, 'csv'),
'http': this.apiClient.buildCollectionParam(http, 'space'),
'http': this.apiClient.buildCollectionParam(http, 'ssv'),
'url': this.apiClient.buildCollectionParam(url, 'csv'),
'context': this.apiClient.buildCollectionParam(context, 'multi')
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -830,7 +830,7 @@ export default class FakeApi {
let queryParams = {
'pipe': this.apiClient.buildCollectionParam(pipe, 'multi'),
'ioutil': this.apiClient.buildCollectionParam(ioutil, 'csv'),
'http': this.apiClient.buildCollectionParam(http, 'space'),
'http': this.apiClient.buildCollectionParam(http, 'ssv'),
'url': this.apiClient.buildCollectionParam(url, 'csv'),
'context': this.apiClient.buildCollectionParam(context, 'multi')
};
Expand Down
Loading

0 comments on commit 835dab4

Please sign in to comment.