Fix issue 8352: [Java][RestTemplate][WebClient] Incorrect handling of free form query parameters (#10428)

* [Java][RestTemplate][WebClient] fix issue #8352 handling of free-form
query parameters with Java

* replace tab by spaces

* commit samples files generated by the generate-samples.sh script
This commit is contained in:
RomainPruvostMHH
2021-09-21 05:40:56 +02:00
committed by GitHub
parent ce30a3f3bc
commit 04e67acd0a
8 changed files with 124 additions and 0 deletions

View File

@@ -435,6 +435,14 @@ public class ApiClient extends JavaTimeFormatter {
collectionFormat = CollectionFormat.CSV;
}
if (value instanceof Map) {
final Map<String, Object> valuesMap = (Map<String, Object>) value;
for (final Entry<String, Object> entry : valuesMap.entrySet()) {
params.add(entry.getKey(), parameterToString(entry.getValue()));
}
return params;
}
Collection<?> valueCollection = null;
if (value instanceof Collection) {
valueCollection = (Collection<?>) value;