forked from loafle/openapi-generator-original
* Error in the reactive client when the path variables are a list (#4687) * Update samples (#4687)
This commit is contained in:
parent
e0d6f7df1f
commit
06ba8317f9
@ -497,7 +497,7 @@ public class ApiClient {
|
||||
formParams
|
||||
.toSingleValueMap()
|
||||
.entrySet()
|
||||
.forEach(es -> map.add(es.getKey(), (String) es.getValue()));
|
||||
.forEach(es -> map.add(es.getKey(), String.valueOf(es.getValue())));
|
||||
|
||||
return BodyInserters.fromFormData(map);
|
||||
} else if(MediaType.MULTIPART_FORM_DATA.equals(contentType)) {
|
||||
@ -638,6 +638,28 @@ public class ApiClient {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Formats the specified collection path parameter to a string value.
|
||||
*
|
||||
* @param collectionFormat The collection format of the parameter.
|
||||
* @param values The values of the parameter.
|
||||
* @return String representation of the parameter
|
||||
*/
|
||||
public String collectionPathParameterToString(CollectionFormat collectionFormat, Collection<?> values) {
|
||||
// create the value based on the collection format
|
||||
if (CollectionFormat.MULTI.equals(collectionFormat)) {
|
||||
// not valid for path params
|
||||
return parameterToString(values);
|
||||
}
|
||||
|
||||
// collectionFormat is assumed to be "csv" by default
|
||||
if(collectionFormat == null) {
|
||||
collectionFormat = CollectionFormat.CSV;
|
||||
}
|
||||
|
||||
return collectionFormat.collectionToString(values);
|
||||
}
|
||||
|
||||
private class ApiClientHttpRequestInterceptor implements ClientHttpRequestInterceptor {
|
||||
private final Log log = LogFactory.getLog(ApiClientHttpRequestInterceptor.class);
|
||||
|
||||
|
@ -70,7 +70,8 @@ public class {{classname}} {
|
||||
{{/required}}{{/allParams}}
|
||||
// create path and map variables
|
||||
final Map<String, Object> pathParams = new HashMap<String, Object>();{{#hasPathParams}}{{#pathParams}}
|
||||
pathParams.put("{{baseName}}", {{{paramName}}});{{/pathParams}}{{/hasPathParams}}
|
||||
pathParams.put("{{baseName}}", {{#collectionFormat}}apiClient.collectionPathParameterToString(ApiClient.CollectionFormat.valueOf("csv".toUpperCase()), {{/collectionFormat}}{{{paramName}}}{{#collectionFormat}}){{/collectionFormat}});{{/pathParams}}{{/hasPathParams}}
|
||||
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
|
@ -493,7 +493,7 @@ public class ApiClient {
|
||||
formParams
|
||||
.toSingleValueMap()
|
||||
.entrySet()
|
||||
.forEach(es -> map.add(es.getKey(), (String) es.getValue()));
|
||||
.forEach(es -> map.add(es.getKey(), String.valueOf(es.getValue())));
|
||||
|
||||
return BodyInserters.fromFormData(map);
|
||||
} else if(MediaType.MULTIPART_FORM_DATA.equals(contentType)) {
|
||||
@ -634,6 +634,28 @@ public class ApiClient {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Formats the specified collection path parameter to a string value.
|
||||
*
|
||||
* @param collectionFormat The collection format of the parameter.
|
||||
* @param values The values of the parameter.
|
||||
* @return String representation of the parameter
|
||||
*/
|
||||
public String collectionPathParameterToString(CollectionFormat collectionFormat, Collection<?> values) {
|
||||
// create the value based on the collection format
|
||||
if (CollectionFormat.MULTI.equals(collectionFormat)) {
|
||||
// not valid for path params
|
||||
return parameterToString(values);
|
||||
}
|
||||
|
||||
// collectionFormat is assumed to be "csv" by default
|
||||
if(collectionFormat == null) {
|
||||
collectionFormat = CollectionFormat.CSV;
|
||||
}
|
||||
|
||||
return collectionFormat.collectionToString(values);
|
||||
}
|
||||
|
||||
private class ApiClientHttpRequestInterceptor implements ClientHttpRequestInterceptor {
|
||||
private final Log log = LogFactory.getLog(ApiClientHttpRequestInterceptor.class);
|
||||
|
||||
|
@ -64,6 +64,7 @@ public class AnotherFakeApi {
|
||||
// create path and map variables
|
||||
final Map<String, Object> pathParams = new HashMap<String, Object>();
|
||||
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
final MultiValueMap<String, String> cookieParams = new LinkedMultiValueMap<String, String>();
|
||||
|
@ -71,6 +71,7 @@ public class FakeApi {
|
||||
// create path and map variables
|
||||
final Map<String, Object> pathParams = new HashMap<String, Object>();
|
||||
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
final MultiValueMap<String, String> cookieParams = new LinkedMultiValueMap<String, String>();
|
||||
@ -102,6 +103,7 @@ public class FakeApi {
|
||||
// create path and map variables
|
||||
final Map<String, Object> pathParams = new HashMap<String, Object>();
|
||||
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
final MultiValueMap<String, String> cookieParams = new LinkedMultiValueMap<String, String>();
|
||||
@ -133,6 +135,7 @@ public class FakeApi {
|
||||
// create path and map variables
|
||||
final Map<String, Object> pathParams = new HashMap<String, Object>();
|
||||
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
final MultiValueMap<String, String> cookieParams = new LinkedMultiValueMap<String, String>();
|
||||
@ -164,6 +167,7 @@ public class FakeApi {
|
||||
// create path and map variables
|
||||
final Map<String, Object> pathParams = new HashMap<String, Object>();
|
||||
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
final MultiValueMap<String, String> cookieParams = new LinkedMultiValueMap<String, String>();
|
||||
@ -195,6 +199,7 @@ public class FakeApi {
|
||||
// create path and map variables
|
||||
final Map<String, Object> pathParams = new HashMap<String, Object>();
|
||||
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
final MultiValueMap<String, String> cookieParams = new LinkedMultiValueMap<String, String>();
|
||||
@ -230,6 +235,7 @@ public class FakeApi {
|
||||
// create path and map variables
|
||||
final Map<String, Object> pathParams = new HashMap<String, Object>();
|
||||
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
final MultiValueMap<String, String> cookieParams = new LinkedMultiValueMap<String, String>();
|
||||
@ -271,6 +277,7 @@ public class FakeApi {
|
||||
// create path and map variables
|
||||
final Map<String, Object> pathParams = new HashMap<String, Object>();
|
||||
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
final MultiValueMap<String, String> cookieParams = new LinkedMultiValueMap<String, String>();
|
||||
@ -309,6 +316,7 @@ public class FakeApi {
|
||||
// create path and map variables
|
||||
final Map<String, Object> pathParams = new HashMap<String, Object>();
|
||||
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
final MultiValueMap<String, String> cookieParams = new LinkedMultiValueMap<String, String>();
|
||||
@ -375,6 +383,7 @@ public class FakeApi {
|
||||
// create path and map variables
|
||||
final Map<String, Object> pathParams = new HashMap<String, Object>();
|
||||
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
final MultiValueMap<String, String> cookieParams = new LinkedMultiValueMap<String, String>();
|
||||
@ -442,6 +451,7 @@ public class FakeApi {
|
||||
// create path and map variables
|
||||
final Map<String, Object> pathParams = new HashMap<String, Object>();
|
||||
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
final MultiValueMap<String, String> cookieParams = new LinkedMultiValueMap<String, String>();
|
||||
@ -507,6 +517,7 @@ public class FakeApi {
|
||||
// create path and map variables
|
||||
final Map<String, Object> pathParams = new HashMap<String, Object>();
|
||||
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
final MultiValueMap<String, String> cookieParams = new LinkedMultiValueMap<String, String>();
|
||||
@ -550,6 +561,7 @@ public class FakeApi {
|
||||
// create path and map variables
|
||||
final Map<String, Object> pathParams = new HashMap<String, Object>();
|
||||
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
final MultiValueMap<String, String> cookieParams = new LinkedMultiValueMap<String, String>();
|
||||
@ -591,6 +603,7 @@ public class FakeApi {
|
||||
// create path and map variables
|
||||
final Map<String, Object> pathParams = new HashMap<String, Object>();
|
||||
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
final MultiValueMap<String, String> cookieParams = new LinkedMultiValueMap<String, String>();
|
||||
@ -655,6 +668,7 @@ public class FakeApi {
|
||||
// create path and map variables
|
||||
final Map<String, Object> pathParams = new HashMap<String, Object>();
|
||||
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
final MultiValueMap<String, String> cookieParams = new LinkedMultiValueMap<String, String>();
|
||||
|
@ -64,6 +64,7 @@ public class FakeClassnameTags123Api {
|
||||
// create path and map variables
|
||||
final Map<String, Object> pathParams = new HashMap<String, Object>();
|
||||
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
final MultiValueMap<String, String> cookieParams = new LinkedMultiValueMap<String, String>();
|
||||
|
@ -66,6 +66,7 @@ public class PetApi {
|
||||
// create path and map variables
|
||||
final Map<String, Object> pathParams = new HashMap<String, Object>();
|
||||
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
final MultiValueMap<String, String> cookieParams = new LinkedMultiValueMap<String, String>();
|
||||
@ -104,6 +105,7 @@ public class PetApi {
|
||||
final Map<String, Object> pathParams = new HashMap<String, Object>();
|
||||
pathParams.put("petId", petId);
|
||||
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
final MultiValueMap<String, String> cookieParams = new LinkedMultiValueMap<String, String>();
|
||||
@ -142,6 +144,7 @@ public class PetApi {
|
||||
// create path and map variables
|
||||
final Map<String, Object> pathParams = new HashMap<String, Object>();
|
||||
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
final MultiValueMap<String, String> cookieParams = new LinkedMultiValueMap<String, String>();
|
||||
@ -181,6 +184,7 @@ public class PetApi {
|
||||
// create path and map variables
|
||||
final Map<String, Object> pathParams = new HashMap<String, Object>();
|
||||
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
final MultiValueMap<String, String> cookieParams = new LinkedMultiValueMap<String, String>();
|
||||
@ -222,6 +226,7 @@ public class PetApi {
|
||||
final Map<String, Object> pathParams = new HashMap<String, Object>();
|
||||
pathParams.put("petId", petId);
|
||||
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
final MultiValueMap<String, String> cookieParams = new LinkedMultiValueMap<String, String>();
|
||||
@ -260,6 +265,7 @@ public class PetApi {
|
||||
// create path and map variables
|
||||
final Map<String, Object> pathParams = new HashMap<String, Object>();
|
||||
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
final MultiValueMap<String, String> cookieParams = new LinkedMultiValueMap<String, String>();
|
||||
@ -298,6 +304,7 @@ public class PetApi {
|
||||
final Map<String, Object> pathParams = new HashMap<String, Object>();
|
||||
pathParams.put("petId", petId);
|
||||
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
final MultiValueMap<String, String> cookieParams = new LinkedMultiValueMap<String, String>();
|
||||
@ -342,6 +349,7 @@ public class PetApi {
|
||||
final Map<String, Object> pathParams = new HashMap<String, Object>();
|
||||
pathParams.put("petId", petId);
|
||||
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
final MultiValueMap<String, String> cookieParams = new LinkedMultiValueMap<String, String>();
|
||||
@ -393,6 +401,7 @@ public class PetApi {
|
||||
final Map<String, Object> pathParams = new HashMap<String, Object>();
|
||||
pathParams.put("petId", petId);
|
||||
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
final MultiValueMap<String, String> cookieParams = new LinkedMultiValueMap<String, String>();
|
||||
|
@ -65,6 +65,7 @@ public class StoreApi {
|
||||
final Map<String, Object> pathParams = new HashMap<String, Object>();
|
||||
pathParams.put("order_id", orderId);
|
||||
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
final MultiValueMap<String, String> cookieParams = new LinkedMultiValueMap<String, String>();
|
||||
@ -93,6 +94,7 @@ public class StoreApi {
|
||||
// create path and map variables
|
||||
final Map<String, Object> pathParams = new HashMap<String, Object>();
|
||||
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
final MultiValueMap<String, String> cookieParams = new LinkedMultiValueMap<String, String>();
|
||||
@ -132,6 +134,7 @@ public class StoreApi {
|
||||
final Map<String, Object> pathParams = new HashMap<String, Object>();
|
||||
pathParams.put("order_id", orderId);
|
||||
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
final MultiValueMap<String, String> cookieParams = new LinkedMultiValueMap<String, String>();
|
||||
@ -169,6 +172,7 @@ public class StoreApi {
|
||||
// create path and map variables
|
||||
final Map<String, Object> pathParams = new HashMap<String, Object>();
|
||||
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
final MultiValueMap<String, String> cookieParams = new LinkedMultiValueMap<String, String>();
|
||||
|
@ -63,6 +63,7 @@ public class UserApi {
|
||||
// create path and map variables
|
||||
final Map<String, Object> pathParams = new HashMap<String, Object>();
|
||||
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
final MultiValueMap<String, String> cookieParams = new LinkedMultiValueMap<String, String>();
|
||||
@ -96,6 +97,7 @@ public class UserApi {
|
||||
// create path and map variables
|
||||
final Map<String, Object> pathParams = new HashMap<String, Object>();
|
||||
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
final MultiValueMap<String, String> cookieParams = new LinkedMultiValueMap<String, String>();
|
||||
@ -129,6 +131,7 @@ public class UserApi {
|
||||
// create path and map variables
|
||||
final Map<String, Object> pathParams = new HashMap<String, Object>();
|
||||
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
final MultiValueMap<String, String> cookieParams = new LinkedMultiValueMap<String, String>();
|
||||
@ -164,6 +167,7 @@ public class UserApi {
|
||||
final Map<String, Object> pathParams = new HashMap<String, Object>();
|
||||
pathParams.put("username", username);
|
||||
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
final MultiValueMap<String, String> cookieParams = new LinkedMultiValueMap<String, String>();
|
||||
@ -201,6 +205,7 @@ public class UserApi {
|
||||
final Map<String, Object> pathParams = new HashMap<String, Object>();
|
||||
pathParams.put("username", username);
|
||||
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
final MultiValueMap<String, String> cookieParams = new LinkedMultiValueMap<String, String>();
|
||||
@ -244,6 +249,7 @@ public class UserApi {
|
||||
// create path and map variables
|
||||
final Map<String, Object> pathParams = new HashMap<String, Object>();
|
||||
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
final MultiValueMap<String, String> cookieParams = new LinkedMultiValueMap<String, String>();
|
||||
@ -276,6 +282,7 @@ public class UserApi {
|
||||
// create path and map variables
|
||||
final Map<String, Object> pathParams = new HashMap<String, Object>();
|
||||
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
final MultiValueMap<String, String> cookieParams = new LinkedMultiValueMap<String, String>();
|
||||
@ -317,6 +324,7 @@ public class UserApi {
|
||||
final Map<String, Object> pathParams = new HashMap<String, Object>();
|
||||
pathParams.put("username", username);
|
||||
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
final MultiValueMap<String, String> cookieParams = new LinkedMultiValueMap<String, String>();
|
||||
|
Loading…
x
Reference in New Issue
Block a user