Skip to content

Commit

Permalink
TSI-2083 update java client generation file
Browse files Browse the repository at this point in the history
  • Loading branch information
hahmed-dev committed Oct 11, 2023
1 parent e835843 commit 91bd098
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -654,6 +654,21 @@ public class ApiClient {
}
}
public List<Pair> mappedParameterToPairs(String name, Map<String, String> parameter){
List<Pair> params = new ArrayList<Pair>();
StringBuilder builder = new StringBuilder();
for(Map.Entry<String, String> entry : parameter.entrySet()){
String key = builder.append(name).append("[").append(entry.getKey()).append("]");
String value = entry.getValue();
params.add(new Pair(key, parameterToString(value)));
}
return params;
}
/**
* Formats the specified query parameter to a list containing a single {@code Pair} object.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,12 @@ public class {{classname}} {
{{javaUtilPrefix}}List<Pair> localVarCollectionQueryParams = new {{javaUtilPrefix}}ArrayList<Pair>();
{{#queryParams}}
if ({{paramName}} != null) {
{{#isMap}}
localVarQueryParams.addAll(localVarApiClient.mappedParameterToPairs("{{baseName}}", {{paramName}}));
{{/isMap}}
{{^isMap}}
{{#collectionFormat}}localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("{{{collectionFormat}}}", {{/collectionFormat}}{{^collectionFormat}}localVarQueryParams.addAll(localVarApiClient.parameterToPair({{/collectionFormat}}"{{baseName}}", {{paramName}}));
{{/isMap}}
}

{{/queryParams}}
Expand Down
2 changes: 2 additions & 0 deletions paths/locales/download.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ parameters:
schema:
type: object
properties: {}
style: deepObject
explode: true
- description: Enforces a specific encoding on the file contents. Valid options are "UTF-8", "UTF-16" and "ISO-8859-1".
example:
name: encoding
Expand Down

0 comments on commit 91bd098

Please sign in to comment.