mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-11 05:52:48 +00:00
[Java][RestTemplate][WebClient] Templatized query params for metrics and evicts oom (#9871)
* [Java][RestTemplate] Templatized query params for metrics and evicts oom * [Java][WebClient] Templatized query params for metrics and evicts oom * [Java][RestTemplate] Templatized query params for metrics and evicts oom * Update samples * [Java] Add javadoc * [Java] Update samples
This commit is contained in:
committed by
GitHub
parent
352ff98dff
commit
e568376a01
@@ -27,6 +27,7 @@ import org.springframework.http.converter.json.MappingJackson2HttpMessageConvert
|
||||
import org.springframework.http.converter.xml.MappingJackson2XmlHttpMessageConverter;
|
||||
{{/withXml}}
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.util.LinkedMultiValueMap;
|
||||
import org.springframework.util.MultiValueMap;
|
||||
import org.springframework.util.StringUtils;
|
||||
@@ -596,12 +597,46 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
|
||||
return restTemplate.getUriTemplateHandler().expand(pathTemplate, variables).toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Include queryParams in uriParams taking into account the paramName
|
||||
* @param queryParam The query parameters
|
||||
* @param uriParams The path parameters
|
||||
* return templatized query string
|
||||
*/
|
||||
private String generateQueryUri(MultiValueMap<String, String> queryParams, Map<String, Object> uriParams) {
|
||||
StringBuilder queryBuilder = new StringBuilder();
|
||||
queryParams.forEach((name, values) -> {
|
||||
if (CollectionUtils.isEmpty(values)) {
|
||||
if (queryBuilder.length() != 0) {
|
||||
queryBuilder.append('&');
|
||||
}
|
||||
queryBuilder.append(name);
|
||||
} else {
|
||||
int valueItemCounter = 0;
|
||||
for (Object value : values) {
|
||||
if (queryBuilder.length() != 0) {
|
||||
queryBuilder.append('&');
|
||||
}
|
||||
queryBuilder.append(name);
|
||||
if (value != null) {
|
||||
String templatizedKey = name + valueItemCounter++;
|
||||
uriParams.put(templatizedKey, value.toString());
|
||||
queryBuilder.append('=').append("{").append(templatizedKey).append("}");
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
return queryBuilder.toString();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Invoke API by sending HTTP request with the given options.
|
||||
*
|
||||
* @param <T> the return type to use
|
||||
* @param path The sub-path of the HTTP URL
|
||||
* @param method The request method
|
||||
* @param pathParams The path parameters
|
||||
* @param queryParams The query parameters
|
||||
* @param body The request body object
|
||||
* @param headerParams The header parameters
|
||||
@@ -613,25 +648,22 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
|
||||
* @param returnType The return type into which to deserialize the response
|
||||
* @return ResponseEntity<T> The response of the chosen type
|
||||
*/
|
||||
public <T> ResponseEntity<T> invokeAPI(String path, HttpMethod method, MultiValueMap<String, String> queryParams, Object body, HttpHeaders headerParams, MultiValueMap<String, String> cookieParams, MultiValueMap<String, Object> formParams, List<MediaType> accept, MediaType contentType, String[] authNames, ParameterizedTypeReference<T> returnType) throws RestClientException {
|
||||
public <T> ResponseEntity<T> invokeAPI(String path, HttpMethod method, Map<String, Object> pathParams, MultiValueMap<String, String> queryParams, Object body, HttpHeaders headerParams, MultiValueMap<String, String> cookieParams, MultiValueMap<String, Object> formParams, List<MediaType> accept, MediaType contentType, String[] authNames, ParameterizedTypeReference<T> returnType) throws RestClientException {
|
||||
updateParamsForAuth(authNames, queryParams, headerParams, cookieParams);
|
||||
|
||||
final UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(basePath).path(path);
|
||||
if (queryParams != null) {
|
||||
//encode the query parameters in case they contain unsafe characters
|
||||
for (List<String> values : queryParams.values()) {
|
||||
if (values != null) {
|
||||
for (int i = 0; i < values.size(); i++) {
|
||||
try {
|
||||
values.set(i, URLEncoder.encode(values.get(i), "utf8"));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
Map<String,Object> uriParams = new HashMap();
|
||||
uriParams.putAll(pathParams);
|
||||
|
||||
String finalUri = path;
|
||||
|
||||
if (queryParams != null && !queryParams.isEmpty()) {
|
||||
//Include queryParams in uriParams taking into account the paramName
|
||||
String queryUri = generateQueryUri(queryParams, uriParams);
|
||||
//Append to finalUri the templatized query string like "?param1={param1Value}&.......
|
||||
finalUri += "?" + queryUri;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
builder.queryParams(queryParams);
|
||||
}
|
||||
String expandedPath = this.expandPath(finalUri,uriParams);
|
||||
final UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(basePath).path(expandedPath);
|
||||
|
||||
URI uri;
|
||||
try {
|
||||
@@ -815,3 +847,4 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -116,7 +116,6 @@ public class {{classname}} {
|
||||
// create path and map variables
|
||||
final Map<String, Object> uriVariables = new HashMap<String, Object>();{{#pathParams}}
|
||||
uriVariables.put("{{baseName}}", {{#collectionFormat}}apiClient.collectionPathParameterToString(ApiClient.CollectionFormat.valueOf("{{{collectionFormat}}}".toUpperCase()), {{{paramName}}}){{/collectionFormat}}{{^collectionFormat}}{{{paramName}}}{{/collectionFormat}});{{/pathParams}}{{/hasPathParams}}
|
||||
String path = apiClient.expandPath("{{{path}}}", {{#hasPathParams}}uriVariables{{/hasPathParams}}{{^hasPathParams}}Collections.<String, Object>emptyMap(){{/hasPathParams}});
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
@@ -150,7 +149,7 @@ public class {{classname}} {
|
||||
String[] authNames = new String[] { {{#authMethods}}"{{name}}"{{^-last}}, {{/-last}}{{/authMethods}} };
|
||||
|
||||
{{#returnType}}ParameterizedTypeReference<{{{returnType}}}> returnType = new ParameterizedTypeReference<{{{returnType}}}>() {};{{/returnType}}{{^returnType}}ParameterizedTypeReference<Void> returnType = new ParameterizedTypeReference<Void>() {};{{/returnType}}
|
||||
return apiClient.invokeAPI(path, HttpMethod.{{httpMethod}}, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
return apiClient.invokeAPI("{{{path}}}", HttpMethod.{{httpMethod}}, {{#hasPathParams}}uriVariables{{/hasPathParams}}{{^hasPathParams}}Collections.<String, Object>emptyMap(){{/hasPathParams}}, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
}
|
||||
{{/operation}}
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ import org.springframework.http.client.ClientHttpRequestInterceptor;
|
||||
import org.springframework.http.client.ClientHttpResponse;
|
||||
import org.springframework.http.codec.json.Jackson2JsonDecoder;
|
||||
import org.springframework.http.codec.json.Jackson2JsonEncoder;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.util.LinkedMultiValueMap;
|
||||
import org.springframework.util.MultiValueMap;
|
||||
import org.springframework.util.StringUtils;
|
||||
@@ -610,16 +611,60 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
|
||||
return requestBuilder.retrieve();
|
||||
}
|
||||
|
||||
private WebClient.RequestBodySpec prepareRequest(String path, HttpMethod method, Map<String, Object> pathParams, MultiValueMap<String, String> queryParams, Object body, HttpHeaders headerParams, MultiValueMap<String, String> cookieParams, MultiValueMap<String, Object> formParams, List<MediaType> accept, MediaType contentType, String[] authNames) {
|
||||
/**
|
||||
* Include queryParams in uriParams taking into account the paramName
|
||||
* @param queryParam The query parameters
|
||||
* @param uriParams The path parameters
|
||||
* return templatized query string
|
||||
*/
|
||||
private String generateQueryUri(MultiValueMap<String, String> queryParams, Map<String, Object> uriParams) {
|
||||
StringBuilder queryBuilder = new StringBuilder();
|
||||
queryParams.forEach((name, values) -> {
|
||||
if (CollectionUtils.isEmpty(values)) {
|
||||
if (queryBuilder.length() != 0) {
|
||||
queryBuilder.append('&');
|
||||
}
|
||||
queryBuilder.append(name);
|
||||
} else {
|
||||
int valueItemCounter = 0;
|
||||
for (Object value : values) {
|
||||
if (queryBuilder.length() != 0) {
|
||||
queryBuilder.append('&');
|
||||
}
|
||||
queryBuilder.append(name);
|
||||
if (value != null) {
|
||||
String templatizedKey = name + valueItemCounter++;
|
||||
uriParams.put(templatizedKey, value.toString());
|
||||
queryBuilder.append('=').append("{").append(templatizedKey).append("}");
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
return queryBuilder.toString();
|
||||
}
|
||||
|
||||
private WebClient.RequestBodySpec prepareRequest(String path, HttpMethod method, Map<String, Object> pathParams,
|
||||
MultiValueMap<String, String> queryParams, Object body, HttpHeaders headerParams,
|
||||
MultiValueMap<String, String> cookieParams, MultiValueMap<String, Object> formParams, List<MediaType> accept,
|
||||
MediaType contentType, String[] authNames) {
|
||||
updateParamsForAuth(authNames, queryParams, headerParams, cookieParams);
|
||||
|
||||
final UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(basePath).path(path);
|
||||
if (queryParams != null) {
|
||||
builder.queryParams(queryParams);
|
||||
|
||||
String finalUri = builder.build(false).toUriString();
|
||||
Map<String, Object> uriParams = new HashMap();
|
||||
uriParams.putAll(pathParams);
|
||||
|
||||
if (queryParams != null && !queryParams.isEmpty()) {
|
||||
//Include queryParams in uriParams taking into account the paramName
|
||||
String queryUri = generateQueryUri(queryParams, uriParams);
|
||||
//Append to finalUri the templatized query string like "?param1={param1Value}&.......
|
||||
finalUri += "?" + queryUri;
|
||||
}
|
||||
|
||||
final WebClient.RequestBodySpec requestBuilder = webClient.method(method).uri(builder.build(false).toUriString(), pathParams);
|
||||
if(accept != null) {
|
||||
final WebClient.RequestBodySpec requestBuilder = webClient.method(method).uri(finalUri, uriParams);
|
||||
|
||||
if (accept != null) {
|
||||
requestBuilder.accept(accept.toArray(new MediaType[accept.size()]));
|
||||
}
|
||||
if(contentType != null) {
|
||||
|
||||
@@ -23,6 +23,7 @@ import org.springframework.http.converter.HttpMessageConverter;
|
||||
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
|
||||
import org.springframework.http.converter.xml.MappingJackson2XmlHttpMessageConverter;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.util.LinkedMultiValueMap;
|
||||
import org.springframework.util.MultiValueMap;
|
||||
import org.springframework.util.StringUtils;
|
||||
@@ -553,12 +554,46 @@ public class ApiClient extends JavaTimeFormatter {
|
||||
return restTemplate.getUriTemplateHandler().expand(pathTemplate, variables).toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Include queryParams in uriParams taking into account the paramName
|
||||
* @param queryParam The query parameters
|
||||
* @param uriParams The path parameters
|
||||
* return templatized query string
|
||||
*/
|
||||
private String generateQueryUri(MultiValueMap<String, String> queryParams, Map<String, Object> uriParams) {
|
||||
StringBuilder queryBuilder = new StringBuilder();
|
||||
queryParams.forEach((name, values) -> {
|
||||
if (CollectionUtils.isEmpty(values)) {
|
||||
if (queryBuilder.length() != 0) {
|
||||
queryBuilder.append('&');
|
||||
}
|
||||
queryBuilder.append(name);
|
||||
} else {
|
||||
int valueItemCounter = 0;
|
||||
for (Object value : values) {
|
||||
if (queryBuilder.length() != 0) {
|
||||
queryBuilder.append('&');
|
||||
}
|
||||
queryBuilder.append(name);
|
||||
if (value != null) {
|
||||
String templatizedKey = name + valueItemCounter++;
|
||||
uriParams.put(templatizedKey, value.toString());
|
||||
queryBuilder.append('=').append("{").append(templatizedKey).append("}");
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
return queryBuilder.toString();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Invoke API by sending HTTP request with the given options.
|
||||
*
|
||||
* @param <T> the return type to use
|
||||
* @param path The sub-path of the HTTP URL
|
||||
* @param method The request method
|
||||
* @param pathParams The path parameters
|
||||
* @param queryParams The query parameters
|
||||
* @param body The request body object
|
||||
* @param headerParams The header parameters
|
||||
@@ -570,25 +605,22 @@ public class ApiClient extends JavaTimeFormatter {
|
||||
* @param returnType The return type into which to deserialize the response
|
||||
* @return ResponseEntity<T> The response of the chosen type
|
||||
*/
|
||||
public <T> ResponseEntity<T> invokeAPI(String path, HttpMethod method, MultiValueMap<String, String> queryParams, Object body, HttpHeaders headerParams, MultiValueMap<String, String> cookieParams, MultiValueMap<String, Object> formParams, List<MediaType> accept, MediaType contentType, String[] authNames, ParameterizedTypeReference<T> returnType) throws RestClientException {
|
||||
public <T> ResponseEntity<T> invokeAPI(String path, HttpMethod method, Map<String, Object> pathParams, MultiValueMap<String, String> queryParams, Object body, HttpHeaders headerParams, MultiValueMap<String, String> cookieParams, MultiValueMap<String, Object> formParams, List<MediaType> accept, MediaType contentType, String[] authNames, ParameterizedTypeReference<T> returnType) throws RestClientException {
|
||||
updateParamsForAuth(authNames, queryParams, headerParams, cookieParams);
|
||||
|
||||
final UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(basePath).path(path);
|
||||
if (queryParams != null) {
|
||||
//encode the query parameters in case they contain unsafe characters
|
||||
for (List<String> values : queryParams.values()) {
|
||||
if (values != null) {
|
||||
for (int i = 0; i < values.size(); i++) {
|
||||
try {
|
||||
values.set(i, URLEncoder.encode(values.get(i), "utf8"));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
Map<String,Object> uriParams = new HashMap();
|
||||
uriParams.putAll(pathParams);
|
||||
|
||||
String finalUri = path;
|
||||
|
||||
if (queryParams != null && !queryParams.isEmpty()) {
|
||||
//Include queryParams in uriParams taking into account the paramName
|
||||
String queryUri = generateQueryUri(queryParams, uriParams);
|
||||
//Append to finalUri the templatized query string like "?param1={param1Value}&.......
|
||||
finalUri += "?" + queryUri;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
builder.queryParams(queryParams);
|
||||
}
|
||||
String expandedPath = this.expandPath(finalUri,uriParams);
|
||||
final UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(basePath).path(expandedPath);
|
||||
|
||||
URI uri;
|
||||
try {
|
||||
@@ -766,3 +798,4 @@ public class ApiClient extends JavaTimeFormatter {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -75,7 +75,6 @@ public class AnotherFakeApi {
|
||||
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling call123testSpecialTags");
|
||||
}
|
||||
|
||||
String path = apiClient.expandPath("/another-fake/dummy", Collections.<String, Object>emptyMap());
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
@@ -94,6 +93,6 @@ public class AnotherFakeApi {
|
||||
String[] authNames = new String[] { };
|
||||
|
||||
ParameterizedTypeReference<Client> returnType = new ParameterizedTypeReference<Client>() {};
|
||||
return apiClient.invokeAPI(path, HttpMethod.PATCH, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
return apiClient.invokeAPI("/another-fake/dummy", HttpMethod.PATCH, Collections.<String, Object>emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,7 +82,6 @@ public class FakeApi {
|
||||
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'xmlItem' when calling createXmlItem");
|
||||
}
|
||||
|
||||
String path = apiClient.expandPath("/fake/create_xml_item", Collections.<String, Object>emptyMap());
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
@@ -99,7 +98,7 @@ public class FakeApi {
|
||||
String[] authNames = new String[] { };
|
||||
|
||||
ParameterizedTypeReference<Void> returnType = new ParameterizedTypeReference<Void>() {};
|
||||
return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
return apiClient.invokeAPI("/fake/create_xml_item", HttpMethod.POST, Collections.<String, Object>emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
}
|
||||
/**
|
||||
*
|
||||
@@ -124,7 +123,6 @@ public class FakeApi {
|
||||
public ResponseEntity<Boolean> fakeOuterBooleanSerializeWithHttpInfo(Boolean body) throws RestClientException {
|
||||
Object postBody = body;
|
||||
|
||||
String path = apiClient.expandPath("/fake/outer/boolean", Collections.<String, Object>emptyMap());
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
@@ -141,7 +139,7 @@ public class FakeApi {
|
||||
String[] authNames = new String[] { };
|
||||
|
||||
ParameterizedTypeReference<Boolean> returnType = new ParameterizedTypeReference<Boolean>() {};
|
||||
return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
return apiClient.invokeAPI("/fake/outer/boolean", HttpMethod.POST, Collections.<String, Object>emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
}
|
||||
/**
|
||||
*
|
||||
@@ -166,7 +164,6 @@ public class FakeApi {
|
||||
public ResponseEntity<OuterComposite> fakeOuterCompositeSerializeWithHttpInfo(OuterComposite body) throws RestClientException {
|
||||
Object postBody = body;
|
||||
|
||||
String path = apiClient.expandPath("/fake/outer/composite", Collections.<String, Object>emptyMap());
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
@@ -183,7 +180,7 @@ public class FakeApi {
|
||||
String[] authNames = new String[] { };
|
||||
|
||||
ParameterizedTypeReference<OuterComposite> returnType = new ParameterizedTypeReference<OuterComposite>() {};
|
||||
return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
return apiClient.invokeAPI("/fake/outer/composite", HttpMethod.POST, Collections.<String, Object>emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
}
|
||||
/**
|
||||
*
|
||||
@@ -208,7 +205,6 @@ public class FakeApi {
|
||||
public ResponseEntity<BigDecimal> fakeOuterNumberSerializeWithHttpInfo(BigDecimal body) throws RestClientException {
|
||||
Object postBody = body;
|
||||
|
||||
String path = apiClient.expandPath("/fake/outer/number", Collections.<String, Object>emptyMap());
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
@@ -225,7 +221,7 @@ public class FakeApi {
|
||||
String[] authNames = new String[] { };
|
||||
|
||||
ParameterizedTypeReference<BigDecimal> returnType = new ParameterizedTypeReference<BigDecimal>() {};
|
||||
return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
return apiClient.invokeAPI("/fake/outer/number", HttpMethod.POST, Collections.<String, Object>emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
}
|
||||
/**
|
||||
*
|
||||
@@ -250,7 +246,6 @@ public class FakeApi {
|
||||
public ResponseEntity<String> fakeOuterStringSerializeWithHttpInfo(String body) throws RestClientException {
|
||||
Object postBody = body;
|
||||
|
||||
String path = apiClient.expandPath("/fake/outer/string", Collections.<String, Object>emptyMap());
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
@@ -267,7 +262,7 @@ public class FakeApi {
|
||||
String[] authNames = new String[] { };
|
||||
|
||||
ParameterizedTypeReference<String> returnType = new ParameterizedTypeReference<String>() {};
|
||||
return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
return apiClient.invokeAPI("/fake/outer/string", HttpMethod.POST, Collections.<String, Object>emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
}
|
||||
/**
|
||||
*
|
||||
@@ -296,7 +291,6 @@ public class FakeApi {
|
||||
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling testBodyWithFileSchema");
|
||||
}
|
||||
|
||||
String path = apiClient.expandPath("/fake/body-with-file-schema", Collections.<String, Object>emptyMap());
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
@@ -313,7 +307,7 @@ public class FakeApi {
|
||||
String[] authNames = new String[] { };
|
||||
|
||||
ParameterizedTypeReference<Void> returnType = new ParameterizedTypeReference<Void>() {};
|
||||
return apiClient.invokeAPI(path, HttpMethod.PUT, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
return apiClient.invokeAPI("/fake/body-with-file-schema", HttpMethod.PUT, Collections.<String, Object>emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
}
|
||||
/**
|
||||
*
|
||||
@@ -349,7 +343,6 @@ public class FakeApi {
|
||||
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling testBodyWithQueryParams");
|
||||
}
|
||||
|
||||
String path = apiClient.expandPath("/fake/body-with-query-params", Collections.<String, Object>emptyMap());
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
@@ -368,7 +361,7 @@ public class FakeApi {
|
||||
String[] authNames = new String[] { };
|
||||
|
||||
ParameterizedTypeReference<Void> returnType = new ParameterizedTypeReference<Void>() {};
|
||||
return apiClient.invokeAPI(path, HttpMethod.PUT, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
return apiClient.invokeAPI("/fake/body-with-query-params", HttpMethod.PUT, Collections.<String, Object>emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
}
|
||||
/**
|
||||
* To test \"client\" model
|
||||
@@ -398,7 +391,6 @@ public class FakeApi {
|
||||
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling testClientModel");
|
||||
}
|
||||
|
||||
String path = apiClient.expandPath("/fake", Collections.<String, Object>emptyMap());
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
@@ -417,7 +409,7 @@ public class FakeApi {
|
||||
String[] authNames = new String[] { };
|
||||
|
||||
ParameterizedTypeReference<Client> returnType = new ParameterizedTypeReference<Client>() {};
|
||||
return apiClient.invokeAPI(path, HttpMethod.PATCH, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
return apiClient.invokeAPI("/fake", HttpMethod.PATCH, Collections.<String, Object>emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
}
|
||||
/**
|
||||
* Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
@@ -489,7 +481,6 @@ public class FakeApi {
|
||||
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter '_byte' when calling testEndpointParameters");
|
||||
}
|
||||
|
||||
String path = apiClient.expandPath("/fake", Collections.<String, Object>emptyMap());
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
@@ -535,7 +526,7 @@ public class FakeApi {
|
||||
String[] authNames = new String[] { "http_basic_test" };
|
||||
|
||||
ParameterizedTypeReference<Void> returnType = new ParameterizedTypeReference<Void>() {};
|
||||
return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
return apiClient.invokeAPI("/fake", HttpMethod.POST, Collections.<String, Object>emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
}
|
||||
/**
|
||||
* To test enum parameters
|
||||
@@ -575,7 +566,6 @@ public class FakeApi {
|
||||
public ResponseEntity<Void> testEnumParametersWithHttpInfo(List<String> enumHeaderStringArray, String enumHeaderString, List<String> enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List<String> enumFormStringArray, String enumFormString) throws RestClientException {
|
||||
Object postBody = null;
|
||||
|
||||
String path = apiClient.expandPath("/fake", Collections.<String, Object>emptyMap());
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
@@ -607,7 +597,7 @@ public class FakeApi {
|
||||
String[] authNames = new String[] { };
|
||||
|
||||
ParameterizedTypeReference<Void> returnType = new ParameterizedTypeReference<Void>() {};
|
||||
return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
return apiClient.invokeAPI("/fake", HttpMethod.GET, Collections.<String, Object>emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
}
|
||||
/**
|
||||
* Fake endpoint to test group parameters (optional)
|
||||
@@ -656,7 +646,6 @@ public class FakeApi {
|
||||
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'requiredInt64Group' when calling testGroupParameters");
|
||||
}
|
||||
|
||||
String path = apiClient.expandPath("/fake", Collections.<String, Object>emptyMap());
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
@@ -681,7 +670,7 @@ public class FakeApi {
|
||||
String[] authNames = new String[] { };
|
||||
|
||||
ParameterizedTypeReference<Void> returnType = new ParameterizedTypeReference<Void>() {};
|
||||
return apiClient.invokeAPI(path, HttpMethod.DELETE, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
return apiClient.invokeAPI("/fake", HttpMethod.DELETE, Collections.<String, Object>emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
}
|
||||
/**
|
||||
* test inline additionalProperties
|
||||
@@ -710,7 +699,6 @@ public class FakeApi {
|
||||
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'param' when calling testInlineAdditionalProperties");
|
||||
}
|
||||
|
||||
String path = apiClient.expandPath("/fake/inline-additionalProperties", Collections.<String, Object>emptyMap());
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
@@ -727,7 +715,7 @@ public class FakeApi {
|
||||
String[] authNames = new String[] { };
|
||||
|
||||
ParameterizedTypeReference<Void> returnType = new ParameterizedTypeReference<Void>() {};
|
||||
return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
return apiClient.invokeAPI("/fake/inline-additionalProperties", HttpMethod.POST, Collections.<String, Object>emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
}
|
||||
/**
|
||||
* test json serialization of form data
|
||||
@@ -763,7 +751,6 @@ public class FakeApi {
|
||||
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'param2' when calling testJsonFormData");
|
||||
}
|
||||
|
||||
String path = apiClient.expandPath("/fake/jsonFormData", Collections.<String, Object>emptyMap());
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
@@ -785,7 +772,7 @@ public class FakeApi {
|
||||
String[] authNames = new String[] { };
|
||||
|
||||
ParameterizedTypeReference<Void> returnType = new ParameterizedTypeReference<Void>() {};
|
||||
return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
return apiClient.invokeAPI("/fake/jsonFormData", HttpMethod.GET, Collections.<String, Object>emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
}
|
||||
/**
|
||||
*
|
||||
@@ -842,7 +829,6 @@ public class FakeApi {
|
||||
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'context' when calling testQueryParameterCollectionFormat");
|
||||
}
|
||||
|
||||
String path = apiClient.expandPath("/fake/test-query-paramters", Collections.<String, Object>emptyMap());
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
@@ -863,6 +849,6 @@ public class FakeApi {
|
||||
String[] authNames = new String[] { };
|
||||
|
||||
ParameterizedTypeReference<Void> returnType = new ParameterizedTypeReference<Void>() {};
|
||||
return apiClient.invokeAPI(path, HttpMethod.PUT, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
return apiClient.invokeAPI("/fake/test-query-paramters", HttpMethod.PUT, Collections.<String, Object>emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,7 +75,6 @@ public class FakeClassnameTags123Api {
|
||||
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling testClassname");
|
||||
}
|
||||
|
||||
String path = apiClient.expandPath("/fake_classname_test", Collections.<String, Object>emptyMap());
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
@@ -94,6 +93,6 @@ public class FakeClassnameTags123Api {
|
||||
String[] authNames = new String[] { "api_key_query" };
|
||||
|
||||
ParameterizedTypeReference<Client> returnType = new ParameterizedTypeReference<Client>() {};
|
||||
return apiClient.invokeAPI(path, HttpMethod.PATCH, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
return apiClient.invokeAPI("/fake_classname_test", HttpMethod.PATCH, Collections.<String, Object>emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,7 +79,6 @@ public class PetApi {
|
||||
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling addPet");
|
||||
}
|
||||
|
||||
String path = apiClient.expandPath("/pet", Collections.<String, Object>emptyMap());
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
@@ -96,7 +95,7 @@ public class PetApi {
|
||||
String[] authNames = new String[] { "petstore_auth" };
|
||||
|
||||
ParameterizedTypeReference<Void> returnType = new ParameterizedTypeReference<Void>() {};
|
||||
return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
return apiClient.invokeAPI("/pet", HttpMethod.POST, Collections.<String, Object>emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
}
|
||||
/**
|
||||
* Deletes a pet
|
||||
@@ -132,7 +131,6 @@ public class PetApi {
|
||||
// create path and map variables
|
||||
final Map<String, Object> uriVariables = new HashMap<String, Object>();
|
||||
uriVariables.put("petId", petId);
|
||||
String path = apiClient.expandPath("/pet/{petId}", uriVariables);
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
@@ -150,7 +148,7 @@ public class PetApi {
|
||||
String[] authNames = new String[] { "petstore_auth" };
|
||||
|
||||
ParameterizedTypeReference<Void> returnType = new ParameterizedTypeReference<Void>() {};
|
||||
return apiClient.invokeAPI(path, HttpMethod.DELETE, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
return apiClient.invokeAPI("/pet/{petId}", HttpMethod.DELETE, uriVariables, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
}
|
||||
/**
|
||||
* Finds Pets by status
|
||||
@@ -182,7 +180,6 @@ public class PetApi {
|
||||
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'status' when calling findPetsByStatus");
|
||||
}
|
||||
|
||||
String path = apiClient.expandPath("/pet/findByStatus", Collections.<String, Object>emptyMap());
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
@@ -201,7 +198,7 @@ public class PetApi {
|
||||
String[] authNames = new String[] { "petstore_auth" };
|
||||
|
||||
ParameterizedTypeReference<List<Pet>> returnType = new ParameterizedTypeReference<List<Pet>>() {};
|
||||
return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
return apiClient.invokeAPI("/pet/findByStatus", HttpMethod.GET, Collections.<String, Object>emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
}
|
||||
/**
|
||||
* Finds Pets by tags
|
||||
@@ -237,7 +234,6 @@ public class PetApi {
|
||||
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'tags' when calling findPetsByTags");
|
||||
}
|
||||
|
||||
String path = apiClient.expandPath("/pet/findByTags", Collections.<String, Object>emptyMap());
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
@@ -256,7 +252,7 @@ public class PetApi {
|
||||
String[] authNames = new String[] { "petstore_auth" };
|
||||
|
||||
ParameterizedTypeReference<Set<Pet>> returnType = new ParameterizedTypeReference<Set<Pet>>() {};
|
||||
return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
return apiClient.invokeAPI("/pet/findByTags", HttpMethod.GET, Collections.<String, Object>emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
}
|
||||
/**
|
||||
* Find pet by ID
|
||||
@@ -293,7 +289,6 @@ public class PetApi {
|
||||
// create path and map variables
|
||||
final Map<String, Object> uriVariables = new HashMap<String, Object>();
|
||||
uriVariables.put("petId", petId);
|
||||
String path = apiClient.expandPath("/pet/{petId}", uriVariables);
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
@@ -310,7 +305,7 @@ public class PetApi {
|
||||
String[] authNames = new String[] { "api_key" };
|
||||
|
||||
ParameterizedTypeReference<Pet> returnType = new ParameterizedTypeReference<Pet>() {};
|
||||
return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
return apiClient.invokeAPI("/pet/{petId}", HttpMethod.GET, uriVariables, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
}
|
||||
/**
|
||||
* Update an existing pet
|
||||
@@ -345,7 +340,6 @@ public class PetApi {
|
||||
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling updatePet");
|
||||
}
|
||||
|
||||
String path = apiClient.expandPath("/pet", Collections.<String, Object>emptyMap());
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
@@ -362,7 +356,7 @@ public class PetApi {
|
||||
String[] authNames = new String[] { "petstore_auth" };
|
||||
|
||||
ParameterizedTypeReference<Void> returnType = new ParameterizedTypeReference<Void>() {};
|
||||
return apiClient.invokeAPI(path, HttpMethod.PUT, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
return apiClient.invokeAPI("/pet", HttpMethod.PUT, Collections.<String, Object>emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
}
|
||||
/**
|
||||
* Updates a pet in the store with form data
|
||||
@@ -398,7 +392,6 @@ public class PetApi {
|
||||
// create path and map variables
|
||||
final Map<String, Object> uriVariables = new HashMap<String, Object>();
|
||||
uriVariables.put("petId", petId);
|
||||
String path = apiClient.expandPath("/pet/{petId}", uriVariables);
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
@@ -420,7 +413,7 @@ public class PetApi {
|
||||
String[] authNames = new String[] { "petstore_auth" };
|
||||
|
||||
ParameterizedTypeReference<Void> returnType = new ParameterizedTypeReference<Void>() {};
|
||||
return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
return apiClient.invokeAPI("/pet/{petId}", HttpMethod.POST, uriVariables, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
}
|
||||
/**
|
||||
* uploads an image
|
||||
@@ -457,7 +450,6 @@ public class PetApi {
|
||||
// create path and map variables
|
||||
final Map<String, Object> uriVariables = new HashMap<String, Object>();
|
||||
uriVariables.put("petId", petId);
|
||||
String path = apiClient.expandPath("/pet/{petId}/uploadImage", uriVariables);
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
@@ -481,7 +473,7 @@ public class PetApi {
|
||||
String[] authNames = new String[] { "petstore_auth" };
|
||||
|
||||
ParameterizedTypeReference<ModelApiResponse> returnType = new ParameterizedTypeReference<ModelApiResponse>() {};
|
||||
return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
return apiClient.invokeAPI("/pet/{petId}/uploadImage", HttpMethod.POST, uriVariables, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
}
|
||||
/**
|
||||
* uploads an image (required)
|
||||
@@ -523,7 +515,6 @@ public class PetApi {
|
||||
// create path and map variables
|
||||
final Map<String, Object> uriVariables = new HashMap<String, Object>();
|
||||
uriVariables.put("petId", petId);
|
||||
String path = apiClient.expandPath("/fake/{petId}/uploadImageWithRequiredFile", uriVariables);
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
@@ -547,6 +538,6 @@ public class PetApi {
|
||||
String[] authNames = new String[] { "petstore_auth" };
|
||||
|
||||
ParameterizedTypeReference<ModelApiResponse> returnType = new ParameterizedTypeReference<ModelApiResponse>() {};
|
||||
return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
return apiClient.invokeAPI("/fake/{petId}/uploadImageWithRequiredFile", HttpMethod.POST, uriVariables, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,7 +79,6 @@ public class StoreApi {
|
||||
// create path and map variables
|
||||
final Map<String, Object> uriVariables = new HashMap<String, Object>();
|
||||
uriVariables.put("order_id", orderId);
|
||||
String path = apiClient.expandPath("/store/order/{order_id}", uriVariables);
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
@@ -94,7 +93,7 @@ public class StoreApi {
|
||||
String[] authNames = new String[] { };
|
||||
|
||||
ParameterizedTypeReference<Void> returnType = new ParameterizedTypeReference<Void>() {};
|
||||
return apiClient.invokeAPI(path, HttpMethod.DELETE, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
return apiClient.invokeAPI("/store/order/{order_id}", HttpMethod.DELETE, uriVariables, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
}
|
||||
/**
|
||||
* Returns pet inventories by status
|
||||
@@ -117,7 +116,6 @@ public class StoreApi {
|
||||
public ResponseEntity<Map<String, Integer>> getInventoryWithHttpInfo() throws RestClientException {
|
||||
Object postBody = null;
|
||||
|
||||
String path = apiClient.expandPath("/store/inventory", Collections.<String, Object>emptyMap());
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
@@ -134,7 +132,7 @@ public class StoreApi {
|
||||
String[] authNames = new String[] { "api_key" };
|
||||
|
||||
ParameterizedTypeReference<Map<String, Integer>> returnType = new ParameterizedTypeReference<Map<String, Integer>>() {};
|
||||
return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
return apiClient.invokeAPI("/store/inventory", HttpMethod.GET, Collections.<String, Object>emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
}
|
||||
/**
|
||||
* Find purchase order by ID
|
||||
@@ -171,7 +169,6 @@ public class StoreApi {
|
||||
// create path and map variables
|
||||
final Map<String, Object> uriVariables = new HashMap<String, Object>();
|
||||
uriVariables.put("order_id", orderId);
|
||||
String path = apiClient.expandPath("/store/order/{order_id}", uriVariables);
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
@@ -188,7 +185,7 @@ public class StoreApi {
|
||||
String[] authNames = new String[] { };
|
||||
|
||||
ParameterizedTypeReference<Order> returnType = new ParameterizedTypeReference<Order>() {};
|
||||
return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
return apiClient.invokeAPI("/store/order/{order_id}", HttpMethod.GET, uriVariables, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
}
|
||||
/**
|
||||
* Place an order for a pet
|
||||
@@ -220,7 +217,6 @@ public class StoreApi {
|
||||
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling placeOrder");
|
||||
}
|
||||
|
||||
String path = apiClient.expandPath("/store/order", Collections.<String, Object>emptyMap());
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
@@ -237,6 +233,6 @@ public class StoreApi {
|
||||
String[] authNames = new String[] { };
|
||||
|
||||
ParameterizedTypeReference<Order> returnType = new ParameterizedTypeReference<Order>() {};
|
||||
return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
return apiClient.invokeAPI("/store/order", HttpMethod.POST, Collections.<String, Object>emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,7 +74,6 @@ public class UserApi {
|
||||
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling createUser");
|
||||
}
|
||||
|
||||
String path = apiClient.expandPath("/user", Collections.<String, Object>emptyMap());
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
@@ -89,7 +88,7 @@ public class UserApi {
|
||||
String[] authNames = new String[] { };
|
||||
|
||||
ParameterizedTypeReference<Void> returnType = new ParameterizedTypeReference<Void>() {};
|
||||
return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
return apiClient.invokeAPI("/user", HttpMethod.POST, Collections.<String, Object>emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
}
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
@@ -118,7 +117,6 @@ public class UserApi {
|
||||
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling createUsersWithArrayInput");
|
||||
}
|
||||
|
||||
String path = apiClient.expandPath("/user/createWithArray", Collections.<String, Object>emptyMap());
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
@@ -133,7 +131,7 @@ public class UserApi {
|
||||
String[] authNames = new String[] { };
|
||||
|
||||
ParameterizedTypeReference<Void> returnType = new ParameterizedTypeReference<Void>() {};
|
||||
return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
return apiClient.invokeAPI("/user/createWithArray", HttpMethod.POST, Collections.<String, Object>emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
}
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
@@ -162,7 +160,6 @@ public class UserApi {
|
||||
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling createUsersWithListInput");
|
||||
}
|
||||
|
||||
String path = apiClient.expandPath("/user/createWithList", Collections.<String, Object>emptyMap());
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
@@ -177,7 +174,7 @@ public class UserApi {
|
||||
String[] authNames = new String[] { };
|
||||
|
||||
ParameterizedTypeReference<Void> returnType = new ParameterizedTypeReference<Void>() {};
|
||||
return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
return apiClient.invokeAPI("/user/createWithList", HttpMethod.POST, Collections.<String, Object>emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
}
|
||||
/**
|
||||
* Delete user
|
||||
@@ -211,7 +208,6 @@ public class UserApi {
|
||||
// create path and map variables
|
||||
final Map<String, Object> uriVariables = new HashMap<String, Object>();
|
||||
uriVariables.put("username", username);
|
||||
String path = apiClient.expandPath("/user/{username}", uriVariables);
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
@@ -226,7 +222,7 @@ public class UserApi {
|
||||
String[] authNames = new String[] { };
|
||||
|
||||
ParameterizedTypeReference<Void> returnType = new ParameterizedTypeReference<Void>() {};
|
||||
return apiClient.invokeAPI(path, HttpMethod.DELETE, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
return apiClient.invokeAPI("/user/{username}", HttpMethod.DELETE, uriVariables, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
}
|
||||
/**
|
||||
* Get user by user name
|
||||
@@ -263,7 +259,6 @@ public class UserApi {
|
||||
// create path and map variables
|
||||
final Map<String, Object> uriVariables = new HashMap<String, Object>();
|
||||
uriVariables.put("username", username);
|
||||
String path = apiClient.expandPath("/user/{username}", uriVariables);
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
@@ -280,7 +275,7 @@ public class UserApi {
|
||||
String[] authNames = new String[] { };
|
||||
|
||||
ParameterizedTypeReference<User> returnType = new ParameterizedTypeReference<User>() {};
|
||||
return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
return apiClient.invokeAPI("/user/{username}", HttpMethod.GET, uriVariables, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
}
|
||||
/**
|
||||
* Logs user into the system
|
||||
@@ -319,7 +314,6 @@ public class UserApi {
|
||||
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'password' when calling loginUser");
|
||||
}
|
||||
|
||||
String path = apiClient.expandPath("/user/login", Collections.<String, Object>emptyMap());
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
@@ -339,7 +333,7 @@ public class UserApi {
|
||||
String[] authNames = new String[] { };
|
||||
|
||||
ParameterizedTypeReference<String> returnType = new ParameterizedTypeReference<String>() {};
|
||||
return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
return apiClient.invokeAPI("/user/login", HttpMethod.GET, Collections.<String, Object>emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
}
|
||||
/**
|
||||
* Logs out current logged in user session
|
||||
@@ -361,7 +355,6 @@ public class UserApi {
|
||||
public ResponseEntity<Void> logoutUserWithHttpInfo() throws RestClientException {
|
||||
Object postBody = null;
|
||||
|
||||
String path = apiClient.expandPath("/user/logout", Collections.<String, Object>emptyMap());
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
@@ -376,7 +369,7 @@ public class UserApi {
|
||||
String[] authNames = new String[] { };
|
||||
|
||||
ParameterizedTypeReference<Void> returnType = new ParameterizedTypeReference<Void>() {};
|
||||
return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
return apiClient.invokeAPI("/user/logout", HttpMethod.GET, Collections.<String, Object>emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
}
|
||||
/**
|
||||
* Updated user
|
||||
@@ -417,7 +410,6 @@ public class UserApi {
|
||||
// create path and map variables
|
||||
final Map<String, Object> uriVariables = new HashMap<String, Object>();
|
||||
uriVariables.put("username", username);
|
||||
String path = apiClient.expandPath("/user/{username}", uriVariables);
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
@@ -432,6 +424,6 @@ public class UserApi {
|
||||
String[] authNames = new String[] { };
|
||||
|
||||
ParameterizedTypeReference<Void> returnType = new ParameterizedTypeReference<Void>() {};
|
||||
return apiClient.invokeAPI(path, HttpMethod.PUT, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
return apiClient.invokeAPI("/user/{username}", HttpMethod.PUT, uriVariables, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ import org.springframework.http.client.ClientHttpRequestExecution;
|
||||
import org.springframework.http.client.ClientHttpRequestInterceptor;
|
||||
import org.springframework.http.client.ClientHttpResponse;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.util.LinkedMultiValueMap;
|
||||
import org.springframework.util.MultiValueMap;
|
||||
import org.springframework.util.StringUtils;
|
||||
@@ -548,12 +549,46 @@ public class ApiClient extends JavaTimeFormatter {
|
||||
return restTemplate.getUriTemplateHandler().expand(pathTemplate, variables).toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Include queryParams in uriParams taking into account the paramName
|
||||
* @param queryParam The query parameters
|
||||
* @param uriParams The path parameters
|
||||
* return templatized query string
|
||||
*/
|
||||
private String generateQueryUri(MultiValueMap<String, String> queryParams, Map<String, Object> uriParams) {
|
||||
StringBuilder queryBuilder = new StringBuilder();
|
||||
queryParams.forEach((name, values) -> {
|
||||
if (CollectionUtils.isEmpty(values)) {
|
||||
if (queryBuilder.length() != 0) {
|
||||
queryBuilder.append('&');
|
||||
}
|
||||
queryBuilder.append(name);
|
||||
} else {
|
||||
int valueItemCounter = 0;
|
||||
for (Object value : values) {
|
||||
if (queryBuilder.length() != 0) {
|
||||
queryBuilder.append('&');
|
||||
}
|
||||
queryBuilder.append(name);
|
||||
if (value != null) {
|
||||
String templatizedKey = name + valueItemCounter++;
|
||||
uriParams.put(templatizedKey, value.toString());
|
||||
queryBuilder.append('=').append("{").append(templatizedKey).append("}");
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
return queryBuilder.toString();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Invoke API by sending HTTP request with the given options.
|
||||
*
|
||||
* @param <T> the return type to use
|
||||
* @param path The sub-path of the HTTP URL
|
||||
* @param method The request method
|
||||
* @param pathParams The path parameters
|
||||
* @param queryParams The query parameters
|
||||
* @param body The request body object
|
||||
* @param headerParams The header parameters
|
||||
@@ -565,25 +600,22 @@ public class ApiClient extends JavaTimeFormatter {
|
||||
* @param returnType The return type into which to deserialize the response
|
||||
* @return ResponseEntity<T> The response of the chosen type
|
||||
*/
|
||||
public <T> ResponseEntity<T> invokeAPI(String path, HttpMethod method, MultiValueMap<String, String> queryParams, Object body, HttpHeaders headerParams, MultiValueMap<String, String> cookieParams, MultiValueMap<String, Object> formParams, List<MediaType> accept, MediaType contentType, String[] authNames, ParameterizedTypeReference<T> returnType) throws RestClientException {
|
||||
public <T> ResponseEntity<T> invokeAPI(String path, HttpMethod method, Map<String, Object> pathParams, MultiValueMap<String, String> queryParams, Object body, HttpHeaders headerParams, MultiValueMap<String, String> cookieParams, MultiValueMap<String, Object> formParams, List<MediaType> accept, MediaType contentType, String[] authNames, ParameterizedTypeReference<T> returnType) throws RestClientException {
|
||||
updateParamsForAuth(authNames, queryParams, headerParams, cookieParams);
|
||||
|
||||
final UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(basePath).path(path);
|
||||
if (queryParams != null) {
|
||||
//encode the query parameters in case they contain unsafe characters
|
||||
for (List<String> values : queryParams.values()) {
|
||||
if (values != null) {
|
||||
for (int i = 0; i < values.size(); i++) {
|
||||
try {
|
||||
values.set(i, URLEncoder.encode(values.get(i), "utf8"));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
Map<String,Object> uriParams = new HashMap();
|
||||
uriParams.putAll(pathParams);
|
||||
|
||||
String finalUri = path;
|
||||
|
||||
if (queryParams != null && !queryParams.isEmpty()) {
|
||||
//Include queryParams in uriParams taking into account the paramName
|
||||
String queryUri = generateQueryUri(queryParams, uriParams);
|
||||
//Append to finalUri the templatized query string like "?param1={param1Value}&.......
|
||||
finalUri += "?" + queryUri;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
builder.queryParams(queryParams);
|
||||
}
|
||||
String expandedPath = this.expandPath(finalUri,uriParams);
|
||||
final UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(basePath).path(expandedPath);
|
||||
|
||||
URI uri;
|
||||
try {
|
||||
@@ -753,3 +785,4 @@ public class ApiClient extends JavaTimeFormatter {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -75,7 +75,6 @@ public class AnotherFakeApi {
|
||||
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling call123testSpecialTags");
|
||||
}
|
||||
|
||||
String path = apiClient.expandPath("/another-fake/dummy", Collections.<String, Object>emptyMap());
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
@@ -94,6 +93,6 @@ public class AnotherFakeApi {
|
||||
String[] authNames = new String[] { };
|
||||
|
||||
ParameterizedTypeReference<Client> returnType = new ParameterizedTypeReference<Client>() {};
|
||||
return apiClient.invokeAPI(path, HttpMethod.PATCH, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
return apiClient.invokeAPI("/another-fake/dummy", HttpMethod.PATCH, Collections.<String, Object>emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,7 +82,6 @@ public class FakeApi {
|
||||
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'xmlItem' when calling createXmlItem");
|
||||
}
|
||||
|
||||
String path = apiClient.expandPath("/fake/create_xml_item", Collections.<String, Object>emptyMap());
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
@@ -99,7 +98,7 @@ public class FakeApi {
|
||||
String[] authNames = new String[] { };
|
||||
|
||||
ParameterizedTypeReference<Void> returnType = new ParameterizedTypeReference<Void>() {};
|
||||
return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
return apiClient.invokeAPI("/fake/create_xml_item", HttpMethod.POST, Collections.<String, Object>emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
}
|
||||
/**
|
||||
*
|
||||
@@ -124,7 +123,6 @@ public class FakeApi {
|
||||
public ResponseEntity<Boolean> fakeOuterBooleanSerializeWithHttpInfo(Boolean body) throws RestClientException {
|
||||
Object postBody = body;
|
||||
|
||||
String path = apiClient.expandPath("/fake/outer/boolean", Collections.<String, Object>emptyMap());
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
@@ -141,7 +139,7 @@ public class FakeApi {
|
||||
String[] authNames = new String[] { };
|
||||
|
||||
ParameterizedTypeReference<Boolean> returnType = new ParameterizedTypeReference<Boolean>() {};
|
||||
return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
return apiClient.invokeAPI("/fake/outer/boolean", HttpMethod.POST, Collections.<String, Object>emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
}
|
||||
/**
|
||||
*
|
||||
@@ -166,7 +164,6 @@ public class FakeApi {
|
||||
public ResponseEntity<OuterComposite> fakeOuterCompositeSerializeWithHttpInfo(OuterComposite body) throws RestClientException {
|
||||
Object postBody = body;
|
||||
|
||||
String path = apiClient.expandPath("/fake/outer/composite", Collections.<String, Object>emptyMap());
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
@@ -183,7 +180,7 @@ public class FakeApi {
|
||||
String[] authNames = new String[] { };
|
||||
|
||||
ParameterizedTypeReference<OuterComposite> returnType = new ParameterizedTypeReference<OuterComposite>() {};
|
||||
return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
return apiClient.invokeAPI("/fake/outer/composite", HttpMethod.POST, Collections.<String, Object>emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
}
|
||||
/**
|
||||
*
|
||||
@@ -208,7 +205,6 @@ public class FakeApi {
|
||||
public ResponseEntity<BigDecimal> fakeOuterNumberSerializeWithHttpInfo(BigDecimal body) throws RestClientException {
|
||||
Object postBody = body;
|
||||
|
||||
String path = apiClient.expandPath("/fake/outer/number", Collections.<String, Object>emptyMap());
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
@@ -225,7 +221,7 @@ public class FakeApi {
|
||||
String[] authNames = new String[] { };
|
||||
|
||||
ParameterizedTypeReference<BigDecimal> returnType = new ParameterizedTypeReference<BigDecimal>() {};
|
||||
return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
return apiClient.invokeAPI("/fake/outer/number", HttpMethod.POST, Collections.<String, Object>emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
}
|
||||
/**
|
||||
*
|
||||
@@ -250,7 +246,6 @@ public class FakeApi {
|
||||
public ResponseEntity<String> fakeOuterStringSerializeWithHttpInfo(String body) throws RestClientException {
|
||||
Object postBody = body;
|
||||
|
||||
String path = apiClient.expandPath("/fake/outer/string", Collections.<String, Object>emptyMap());
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
@@ -267,7 +262,7 @@ public class FakeApi {
|
||||
String[] authNames = new String[] { };
|
||||
|
||||
ParameterizedTypeReference<String> returnType = new ParameterizedTypeReference<String>() {};
|
||||
return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
return apiClient.invokeAPI("/fake/outer/string", HttpMethod.POST, Collections.<String, Object>emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
}
|
||||
/**
|
||||
*
|
||||
@@ -296,7 +291,6 @@ public class FakeApi {
|
||||
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling testBodyWithFileSchema");
|
||||
}
|
||||
|
||||
String path = apiClient.expandPath("/fake/body-with-file-schema", Collections.<String, Object>emptyMap());
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
@@ -313,7 +307,7 @@ public class FakeApi {
|
||||
String[] authNames = new String[] { };
|
||||
|
||||
ParameterizedTypeReference<Void> returnType = new ParameterizedTypeReference<Void>() {};
|
||||
return apiClient.invokeAPI(path, HttpMethod.PUT, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
return apiClient.invokeAPI("/fake/body-with-file-schema", HttpMethod.PUT, Collections.<String, Object>emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
}
|
||||
/**
|
||||
*
|
||||
@@ -349,7 +343,6 @@ public class FakeApi {
|
||||
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling testBodyWithQueryParams");
|
||||
}
|
||||
|
||||
String path = apiClient.expandPath("/fake/body-with-query-params", Collections.<String, Object>emptyMap());
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
@@ -368,7 +361,7 @@ public class FakeApi {
|
||||
String[] authNames = new String[] { };
|
||||
|
||||
ParameterizedTypeReference<Void> returnType = new ParameterizedTypeReference<Void>() {};
|
||||
return apiClient.invokeAPI(path, HttpMethod.PUT, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
return apiClient.invokeAPI("/fake/body-with-query-params", HttpMethod.PUT, Collections.<String, Object>emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
}
|
||||
/**
|
||||
* To test \"client\" model
|
||||
@@ -398,7 +391,6 @@ public class FakeApi {
|
||||
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling testClientModel");
|
||||
}
|
||||
|
||||
String path = apiClient.expandPath("/fake", Collections.<String, Object>emptyMap());
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
@@ -417,7 +409,7 @@ public class FakeApi {
|
||||
String[] authNames = new String[] { };
|
||||
|
||||
ParameterizedTypeReference<Client> returnType = new ParameterizedTypeReference<Client>() {};
|
||||
return apiClient.invokeAPI(path, HttpMethod.PATCH, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
return apiClient.invokeAPI("/fake", HttpMethod.PATCH, Collections.<String, Object>emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
}
|
||||
/**
|
||||
* Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
@@ -489,7 +481,6 @@ public class FakeApi {
|
||||
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter '_byte' when calling testEndpointParameters");
|
||||
}
|
||||
|
||||
String path = apiClient.expandPath("/fake", Collections.<String, Object>emptyMap());
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
@@ -535,7 +526,7 @@ public class FakeApi {
|
||||
String[] authNames = new String[] { "http_basic_test" };
|
||||
|
||||
ParameterizedTypeReference<Void> returnType = new ParameterizedTypeReference<Void>() {};
|
||||
return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
return apiClient.invokeAPI("/fake", HttpMethod.POST, Collections.<String, Object>emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
}
|
||||
/**
|
||||
* To test enum parameters
|
||||
@@ -575,7 +566,6 @@ public class FakeApi {
|
||||
public ResponseEntity<Void> testEnumParametersWithHttpInfo(List<String> enumHeaderStringArray, String enumHeaderString, List<String> enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List<String> enumFormStringArray, String enumFormString) throws RestClientException {
|
||||
Object postBody = null;
|
||||
|
||||
String path = apiClient.expandPath("/fake", Collections.<String, Object>emptyMap());
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
@@ -607,7 +597,7 @@ public class FakeApi {
|
||||
String[] authNames = new String[] { };
|
||||
|
||||
ParameterizedTypeReference<Void> returnType = new ParameterizedTypeReference<Void>() {};
|
||||
return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
return apiClient.invokeAPI("/fake", HttpMethod.GET, Collections.<String, Object>emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
}
|
||||
/**
|
||||
* Fake endpoint to test group parameters (optional)
|
||||
@@ -656,7 +646,6 @@ public class FakeApi {
|
||||
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'requiredInt64Group' when calling testGroupParameters");
|
||||
}
|
||||
|
||||
String path = apiClient.expandPath("/fake", Collections.<String, Object>emptyMap());
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
@@ -681,7 +670,7 @@ public class FakeApi {
|
||||
String[] authNames = new String[] { };
|
||||
|
||||
ParameterizedTypeReference<Void> returnType = new ParameterizedTypeReference<Void>() {};
|
||||
return apiClient.invokeAPI(path, HttpMethod.DELETE, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
return apiClient.invokeAPI("/fake", HttpMethod.DELETE, Collections.<String, Object>emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
}
|
||||
/**
|
||||
* test inline additionalProperties
|
||||
@@ -710,7 +699,6 @@ public class FakeApi {
|
||||
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'param' when calling testInlineAdditionalProperties");
|
||||
}
|
||||
|
||||
String path = apiClient.expandPath("/fake/inline-additionalProperties", Collections.<String, Object>emptyMap());
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
@@ -727,7 +715,7 @@ public class FakeApi {
|
||||
String[] authNames = new String[] { };
|
||||
|
||||
ParameterizedTypeReference<Void> returnType = new ParameterizedTypeReference<Void>() {};
|
||||
return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
return apiClient.invokeAPI("/fake/inline-additionalProperties", HttpMethod.POST, Collections.<String, Object>emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
}
|
||||
/**
|
||||
* test json serialization of form data
|
||||
@@ -763,7 +751,6 @@ public class FakeApi {
|
||||
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'param2' when calling testJsonFormData");
|
||||
}
|
||||
|
||||
String path = apiClient.expandPath("/fake/jsonFormData", Collections.<String, Object>emptyMap());
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
@@ -785,7 +772,7 @@ public class FakeApi {
|
||||
String[] authNames = new String[] { };
|
||||
|
||||
ParameterizedTypeReference<Void> returnType = new ParameterizedTypeReference<Void>() {};
|
||||
return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
return apiClient.invokeAPI("/fake/jsonFormData", HttpMethod.GET, Collections.<String, Object>emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
}
|
||||
/**
|
||||
*
|
||||
@@ -842,7 +829,6 @@ public class FakeApi {
|
||||
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'context' when calling testQueryParameterCollectionFormat");
|
||||
}
|
||||
|
||||
String path = apiClient.expandPath("/fake/test-query-paramters", Collections.<String, Object>emptyMap());
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
@@ -863,6 +849,6 @@ public class FakeApi {
|
||||
String[] authNames = new String[] { };
|
||||
|
||||
ParameterizedTypeReference<Void> returnType = new ParameterizedTypeReference<Void>() {};
|
||||
return apiClient.invokeAPI(path, HttpMethod.PUT, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
return apiClient.invokeAPI("/fake/test-query-paramters", HttpMethod.PUT, Collections.<String, Object>emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,7 +75,6 @@ public class FakeClassnameTags123Api {
|
||||
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling testClassname");
|
||||
}
|
||||
|
||||
String path = apiClient.expandPath("/fake_classname_test", Collections.<String, Object>emptyMap());
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
@@ -94,6 +93,6 @@ public class FakeClassnameTags123Api {
|
||||
String[] authNames = new String[] { "api_key_query" };
|
||||
|
||||
ParameterizedTypeReference<Client> returnType = new ParameterizedTypeReference<Client>() {};
|
||||
return apiClient.invokeAPI(path, HttpMethod.PATCH, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
return apiClient.invokeAPI("/fake_classname_test", HttpMethod.PATCH, Collections.<String, Object>emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,7 +79,6 @@ public class PetApi {
|
||||
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling addPet");
|
||||
}
|
||||
|
||||
String path = apiClient.expandPath("/pet", Collections.<String, Object>emptyMap());
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
@@ -96,7 +95,7 @@ public class PetApi {
|
||||
String[] authNames = new String[] { "petstore_auth" };
|
||||
|
||||
ParameterizedTypeReference<Void> returnType = new ParameterizedTypeReference<Void>() {};
|
||||
return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
return apiClient.invokeAPI("/pet", HttpMethod.POST, Collections.<String, Object>emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
}
|
||||
/**
|
||||
* Deletes a pet
|
||||
@@ -132,7 +131,6 @@ public class PetApi {
|
||||
// create path and map variables
|
||||
final Map<String, Object> uriVariables = new HashMap<String, Object>();
|
||||
uriVariables.put("petId", petId);
|
||||
String path = apiClient.expandPath("/pet/{petId}", uriVariables);
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
@@ -150,7 +148,7 @@ public class PetApi {
|
||||
String[] authNames = new String[] { "petstore_auth" };
|
||||
|
||||
ParameterizedTypeReference<Void> returnType = new ParameterizedTypeReference<Void>() {};
|
||||
return apiClient.invokeAPI(path, HttpMethod.DELETE, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
return apiClient.invokeAPI("/pet/{petId}", HttpMethod.DELETE, uriVariables, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
}
|
||||
/**
|
||||
* Finds Pets by status
|
||||
@@ -182,7 +180,6 @@ public class PetApi {
|
||||
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'status' when calling findPetsByStatus");
|
||||
}
|
||||
|
||||
String path = apiClient.expandPath("/pet/findByStatus", Collections.<String, Object>emptyMap());
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
@@ -201,7 +198,7 @@ public class PetApi {
|
||||
String[] authNames = new String[] { "petstore_auth" };
|
||||
|
||||
ParameterizedTypeReference<List<Pet>> returnType = new ParameterizedTypeReference<List<Pet>>() {};
|
||||
return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
return apiClient.invokeAPI("/pet/findByStatus", HttpMethod.GET, Collections.<String, Object>emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
}
|
||||
/**
|
||||
* Finds Pets by tags
|
||||
@@ -237,7 +234,6 @@ public class PetApi {
|
||||
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'tags' when calling findPetsByTags");
|
||||
}
|
||||
|
||||
String path = apiClient.expandPath("/pet/findByTags", Collections.<String, Object>emptyMap());
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
@@ -256,7 +252,7 @@ public class PetApi {
|
||||
String[] authNames = new String[] { "petstore_auth" };
|
||||
|
||||
ParameterizedTypeReference<Set<Pet>> returnType = new ParameterizedTypeReference<Set<Pet>>() {};
|
||||
return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
return apiClient.invokeAPI("/pet/findByTags", HttpMethod.GET, Collections.<String, Object>emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
}
|
||||
/**
|
||||
* Find pet by ID
|
||||
@@ -293,7 +289,6 @@ public class PetApi {
|
||||
// create path and map variables
|
||||
final Map<String, Object> uriVariables = new HashMap<String, Object>();
|
||||
uriVariables.put("petId", petId);
|
||||
String path = apiClient.expandPath("/pet/{petId}", uriVariables);
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
@@ -310,7 +305,7 @@ public class PetApi {
|
||||
String[] authNames = new String[] { "api_key" };
|
||||
|
||||
ParameterizedTypeReference<Pet> returnType = new ParameterizedTypeReference<Pet>() {};
|
||||
return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
return apiClient.invokeAPI("/pet/{petId}", HttpMethod.GET, uriVariables, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
}
|
||||
/**
|
||||
* Update an existing pet
|
||||
@@ -345,7 +340,6 @@ public class PetApi {
|
||||
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling updatePet");
|
||||
}
|
||||
|
||||
String path = apiClient.expandPath("/pet", Collections.<String, Object>emptyMap());
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
@@ -362,7 +356,7 @@ public class PetApi {
|
||||
String[] authNames = new String[] { "petstore_auth" };
|
||||
|
||||
ParameterizedTypeReference<Void> returnType = new ParameterizedTypeReference<Void>() {};
|
||||
return apiClient.invokeAPI(path, HttpMethod.PUT, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
return apiClient.invokeAPI("/pet", HttpMethod.PUT, Collections.<String, Object>emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
}
|
||||
/**
|
||||
* Updates a pet in the store with form data
|
||||
@@ -398,7 +392,6 @@ public class PetApi {
|
||||
// create path and map variables
|
||||
final Map<String, Object> uriVariables = new HashMap<String, Object>();
|
||||
uriVariables.put("petId", petId);
|
||||
String path = apiClient.expandPath("/pet/{petId}", uriVariables);
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
@@ -420,7 +413,7 @@ public class PetApi {
|
||||
String[] authNames = new String[] { "petstore_auth" };
|
||||
|
||||
ParameterizedTypeReference<Void> returnType = new ParameterizedTypeReference<Void>() {};
|
||||
return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
return apiClient.invokeAPI("/pet/{petId}", HttpMethod.POST, uriVariables, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
}
|
||||
/**
|
||||
* uploads an image
|
||||
@@ -457,7 +450,6 @@ public class PetApi {
|
||||
// create path and map variables
|
||||
final Map<String, Object> uriVariables = new HashMap<String, Object>();
|
||||
uriVariables.put("petId", petId);
|
||||
String path = apiClient.expandPath("/pet/{petId}/uploadImage", uriVariables);
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
@@ -481,7 +473,7 @@ public class PetApi {
|
||||
String[] authNames = new String[] { "petstore_auth" };
|
||||
|
||||
ParameterizedTypeReference<ModelApiResponse> returnType = new ParameterizedTypeReference<ModelApiResponse>() {};
|
||||
return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
return apiClient.invokeAPI("/pet/{petId}/uploadImage", HttpMethod.POST, uriVariables, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
}
|
||||
/**
|
||||
* uploads an image (required)
|
||||
@@ -523,7 +515,6 @@ public class PetApi {
|
||||
// create path and map variables
|
||||
final Map<String, Object> uriVariables = new HashMap<String, Object>();
|
||||
uriVariables.put("petId", petId);
|
||||
String path = apiClient.expandPath("/fake/{petId}/uploadImageWithRequiredFile", uriVariables);
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
@@ -547,6 +538,6 @@ public class PetApi {
|
||||
String[] authNames = new String[] { "petstore_auth" };
|
||||
|
||||
ParameterizedTypeReference<ModelApiResponse> returnType = new ParameterizedTypeReference<ModelApiResponse>() {};
|
||||
return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
return apiClient.invokeAPI("/fake/{petId}/uploadImageWithRequiredFile", HttpMethod.POST, uriVariables, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,7 +79,6 @@ public class StoreApi {
|
||||
// create path and map variables
|
||||
final Map<String, Object> uriVariables = new HashMap<String, Object>();
|
||||
uriVariables.put("order_id", orderId);
|
||||
String path = apiClient.expandPath("/store/order/{order_id}", uriVariables);
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
@@ -94,7 +93,7 @@ public class StoreApi {
|
||||
String[] authNames = new String[] { };
|
||||
|
||||
ParameterizedTypeReference<Void> returnType = new ParameterizedTypeReference<Void>() {};
|
||||
return apiClient.invokeAPI(path, HttpMethod.DELETE, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
return apiClient.invokeAPI("/store/order/{order_id}", HttpMethod.DELETE, uriVariables, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
}
|
||||
/**
|
||||
* Returns pet inventories by status
|
||||
@@ -117,7 +116,6 @@ public class StoreApi {
|
||||
public ResponseEntity<Map<String, Integer>> getInventoryWithHttpInfo() throws RestClientException {
|
||||
Object postBody = null;
|
||||
|
||||
String path = apiClient.expandPath("/store/inventory", Collections.<String, Object>emptyMap());
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
@@ -134,7 +132,7 @@ public class StoreApi {
|
||||
String[] authNames = new String[] { "api_key" };
|
||||
|
||||
ParameterizedTypeReference<Map<String, Integer>> returnType = new ParameterizedTypeReference<Map<String, Integer>>() {};
|
||||
return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
return apiClient.invokeAPI("/store/inventory", HttpMethod.GET, Collections.<String, Object>emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
}
|
||||
/**
|
||||
* Find purchase order by ID
|
||||
@@ -171,7 +169,6 @@ public class StoreApi {
|
||||
// create path and map variables
|
||||
final Map<String, Object> uriVariables = new HashMap<String, Object>();
|
||||
uriVariables.put("order_id", orderId);
|
||||
String path = apiClient.expandPath("/store/order/{order_id}", uriVariables);
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
@@ -188,7 +185,7 @@ public class StoreApi {
|
||||
String[] authNames = new String[] { };
|
||||
|
||||
ParameterizedTypeReference<Order> returnType = new ParameterizedTypeReference<Order>() {};
|
||||
return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
return apiClient.invokeAPI("/store/order/{order_id}", HttpMethod.GET, uriVariables, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
}
|
||||
/**
|
||||
* Place an order for a pet
|
||||
@@ -220,7 +217,6 @@ public class StoreApi {
|
||||
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling placeOrder");
|
||||
}
|
||||
|
||||
String path = apiClient.expandPath("/store/order", Collections.<String, Object>emptyMap());
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
@@ -237,6 +233,6 @@ public class StoreApi {
|
||||
String[] authNames = new String[] { };
|
||||
|
||||
ParameterizedTypeReference<Order> returnType = new ParameterizedTypeReference<Order>() {};
|
||||
return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
return apiClient.invokeAPI("/store/order", HttpMethod.POST, Collections.<String, Object>emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,7 +74,6 @@ public class UserApi {
|
||||
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling createUser");
|
||||
}
|
||||
|
||||
String path = apiClient.expandPath("/user", Collections.<String, Object>emptyMap());
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
@@ -89,7 +88,7 @@ public class UserApi {
|
||||
String[] authNames = new String[] { };
|
||||
|
||||
ParameterizedTypeReference<Void> returnType = new ParameterizedTypeReference<Void>() {};
|
||||
return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
return apiClient.invokeAPI("/user", HttpMethod.POST, Collections.<String, Object>emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
}
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
@@ -118,7 +117,6 @@ public class UserApi {
|
||||
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling createUsersWithArrayInput");
|
||||
}
|
||||
|
||||
String path = apiClient.expandPath("/user/createWithArray", Collections.<String, Object>emptyMap());
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
@@ -133,7 +131,7 @@ public class UserApi {
|
||||
String[] authNames = new String[] { };
|
||||
|
||||
ParameterizedTypeReference<Void> returnType = new ParameterizedTypeReference<Void>() {};
|
||||
return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
return apiClient.invokeAPI("/user/createWithArray", HttpMethod.POST, Collections.<String, Object>emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
}
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
@@ -162,7 +160,6 @@ public class UserApi {
|
||||
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling createUsersWithListInput");
|
||||
}
|
||||
|
||||
String path = apiClient.expandPath("/user/createWithList", Collections.<String, Object>emptyMap());
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
@@ -177,7 +174,7 @@ public class UserApi {
|
||||
String[] authNames = new String[] { };
|
||||
|
||||
ParameterizedTypeReference<Void> returnType = new ParameterizedTypeReference<Void>() {};
|
||||
return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
return apiClient.invokeAPI("/user/createWithList", HttpMethod.POST, Collections.<String, Object>emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
}
|
||||
/**
|
||||
* Delete user
|
||||
@@ -211,7 +208,6 @@ public class UserApi {
|
||||
// create path and map variables
|
||||
final Map<String, Object> uriVariables = new HashMap<String, Object>();
|
||||
uriVariables.put("username", username);
|
||||
String path = apiClient.expandPath("/user/{username}", uriVariables);
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
@@ -226,7 +222,7 @@ public class UserApi {
|
||||
String[] authNames = new String[] { };
|
||||
|
||||
ParameterizedTypeReference<Void> returnType = new ParameterizedTypeReference<Void>() {};
|
||||
return apiClient.invokeAPI(path, HttpMethod.DELETE, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
return apiClient.invokeAPI("/user/{username}", HttpMethod.DELETE, uriVariables, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
}
|
||||
/**
|
||||
* Get user by user name
|
||||
@@ -263,7 +259,6 @@ public class UserApi {
|
||||
// create path and map variables
|
||||
final Map<String, Object> uriVariables = new HashMap<String, Object>();
|
||||
uriVariables.put("username", username);
|
||||
String path = apiClient.expandPath("/user/{username}", uriVariables);
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
@@ -280,7 +275,7 @@ public class UserApi {
|
||||
String[] authNames = new String[] { };
|
||||
|
||||
ParameterizedTypeReference<User> returnType = new ParameterizedTypeReference<User>() {};
|
||||
return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
return apiClient.invokeAPI("/user/{username}", HttpMethod.GET, uriVariables, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
}
|
||||
/**
|
||||
* Logs user into the system
|
||||
@@ -319,7 +314,6 @@ public class UserApi {
|
||||
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'password' when calling loginUser");
|
||||
}
|
||||
|
||||
String path = apiClient.expandPath("/user/login", Collections.<String, Object>emptyMap());
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
@@ -339,7 +333,7 @@ public class UserApi {
|
||||
String[] authNames = new String[] { };
|
||||
|
||||
ParameterizedTypeReference<String> returnType = new ParameterizedTypeReference<String>() {};
|
||||
return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
return apiClient.invokeAPI("/user/login", HttpMethod.GET, Collections.<String, Object>emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
}
|
||||
/**
|
||||
* Logs out current logged in user session
|
||||
@@ -361,7 +355,6 @@ public class UserApi {
|
||||
public ResponseEntity<Void> logoutUserWithHttpInfo() throws RestClientException {
|
||||
Object postBody = null;
|
||||
|
||||
String path = apiClient.expandPath("/user/logout", Collections.<String, Object>emptyMap());
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
@@ -376,7 +369,7 @@ public class UserApi {
|
||||
String[] authNames = new String[] { };
|
||||
|
||||
ParameterizedTypeReference<Void> returnType = new ParameterizedTypeReference<Void>() {};
|
||||
return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
return apiClient.invokeAPI("/user/logout", HttpMethod.GET, Collections.<String, Object>emptyMap(), queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
}
|
||||
/**
|
||||
* Updated user
|
||||
@@ -417,7 +410,6 @@ public class UserApi {
|
||||
// create path and map variables
|
||||
final Map<String, Object> uriVariables = new HashMap<String, Object>();
|
||||
uriVariables.put("username", username);
|
||||
String path = apiClient.expandPath("/user/{username}", uriVariables);
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
@@ -432,6 +424,6 @@ public class UserApi {
|
||||
String[] authNames = new String[] { };
|
||||
|
||||
ParameterizedTypeReference<Void> returnType = new ParameterizedTypeReference<Void>() {};
|
||||
return apiClient.invokeAPI(path, HttpMethod.PUT, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
return apiClient.invokeAPI("/user/{username}", HttpMethod.PUT, uriVariables, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, authNames, returnType);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ import org.springframework.http.client.ClientHttpRequestInterceptor;
|
||||
import org.springframework.http.client.ClientHttpResponse;
|
||||
import org.springframework.http.codec.json.Jackson2JsonDecoder;
|
||||
import org.springframework.http.codec.json.Jackson2JsonEncoder;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.util.LinkedMultiValueMap;
|
||||
import org.springframework.util.MultiValueMap;
|
||||
import org.springframework.util.StringUtils;
|
||||
@@ -597,16 +598,60 @@ public class ApiClient extends JavaTimeFormatter {
|
||||
return requestBuilder.retrieve();
|
||||
}
|
||||
|
||||
private WebClient.RequestBodySpec prepareRequest(String path, HttpMethod method, Map<String, Object> pathParams, MultiValueMap<String, String> queryParams, Object body, HttpHeaders headerParams, MultiValueMap<String, String> cookieParams, MultiValueMap<String, Object> formParams, List<MediaType> accept, MediaType contentType, String[] authNames) {
|
||||
/**
|
||||
* Include queryParams in uriParams taking into account the paramName
|
||||
* @param queryParam The query parameters
|
||||
* @param uriParams The path parameters
|
||||
* return templatized query string
|
||||
*/
|
||||
private String generateQueryUri(MultiValueMap<String, String> queryParams, Map<String, Object> uriParams) {
|
||||
StringBuilder queryBuilder = new StringBuilder();
|
||||
queryParams.forEach((name, values) -> {
|
||||
if (CollectionUtils.isEmpty(values)) {
|
||||
if (queryBuilder.length() != 0) {
|
||||
queryBuilder.append('&');
|
||||
}
|
||||
queryBuilder.append(name);
|
||||
} else {
|
||||
int valueItemCounter = 0;
|
||||
for (Object value : values) {
|
||||
if (queryBuilder.length() != 0) {
|
||||
queryBuilder.append('&');
|
||||
}
|
||||
queryBuilder.append(name);
|
||||
if (value != null) {
|
||||
String templatizedKey = name + valueItemCounter++;
|
||||
uriParams.put(templatizedKey, value.toString());
|
||||
queryBuilder.append('=').append("{").append(templatizedKey).append("}");
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
return queryBuilder.toString();
|
||||
}
|
||||
|
||||
private WebClient.RequestBodySpec prepareRequest(String path, HttpMethod method, Map<String, Object> pathParams,
|
||||
MultiValueMap<String, String> queryParams, Object body, HttpHeaders headerParams,
|
||||
MultiValueMap<String, String> cookieParams, MultiValueMap<String, Object> formParams, List<MediaType> accept,
|
||||
MediaType contentType, String[] authNames) {
|
||||
updateParamsForAuth(authNames, queryParams, headerParams, cookieParams);
|
||||
|
||||
final UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(basePath).path(path);
|
||||
if (queryParams != null) {
|
||||
builder.queryParams(queryParams);
|
||||
|
||||
String finalUri = builder.build(false).toUriString();
|
||||
Map<String, Object> uriParams = new HashMap();
|
||||
uriParams.putAll(pathParams);
|
||||
|
||||
if (queryParams != null && !queryParams.isEmpty()) {
|
||||
//Include queryParams in uriParams taking into account the paramName
|
||||
String queryUri = generateQueryUri(queryParams, uriParams);
|
||||
//Append to finalUri the templatized query string like "?param1={param1Value}&.......
|
||||
finalUri += "?" + queryUri;
|
||||
}
|
||||
|
||||
final WebClient.RequestBodySpec requestBuilder = webClient.method(method).uri(builder.build(false).toUriString(), pathParams);
|
||||
if(accept != null) {
|
||||
final WebClient.RequestBodySpec requestBuilder = webClient.method(method).uri(finalUri, uriParams);
|
||||
|
||||
if (accept != null) {
|
||||
requestBuilder.accept(accept.toArray(new MediaType[accept.size()]));
|
||||
}
|
||||
if(contentType != null) {
|
||||
|
||||
Reference in New Issue
Block a user