Skip to content

Commit

Permalink
Merge branch 'tsi-2083-java-format' of github.com:phrase/openapi into…
Browse files Browse the repository at this point in the history
… tsi-2083-java-format
  • Loading branch information
jablan committed Oct 12, 2023
2 parents f945791 + fe4cf07 commit cdacd9c
Showing 1 changed file with 13 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -654,17 +654,24 @@ public class ApiClient {
}
}
public List<Pair> mappedParameterToPairs(String name, Map<String, String> parameter){
public List<Pair> mappedParameterToPairs(String name, Object 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 key = name + "[" + entry.getKey() + "]";
String value = entry.getValue();
if(parameter instanceof Map){
Map<String, String> mappedParameter = (Map<String, String>) parameter;
for(Map.Entry<String, String> entry : mappedParameter.entrySet()){
System.out.println(entry);
{{! String key = builder.append(name).append("[").append(entry.getKey()).append("]"); }}
String key = name + "[" + entry.getKey() + "]";
String value = entry.getValue();
params.add(new Pair(key, parameterToString(value)));
}
params.add(new Pair(key, parameterToString(value)));
}
return params;
}
Expand Down

0 comments on commit cdacd9c

Please sign in to comment.