Expand path templates via resttemplate's uriTemplateHandler (#3500)

* Expand path templates via resttemplate's uriTemplateHandler

* fix tests and compilation on lower jdk version

* fix typo

* re-generate samples
This commit is contained in:
unintended 2019-08-06 13:56:43 +03:00 committed by Esteban Gehring
parent 3538c08a8b
commit b8295afa27
16 changed files with 116 additions and 73 deletions

View File

@ -555,6 +555,16 @@ public class ApiClient {
return isForm ? formParams : obj;
}
/**
* Expand path template with variables
* @param pathTemplate path template with placeholders
* @param variables variables to replace
* @return path with placeholders replaced by variables
*/
public String expandPath(String pathTemplate, Map<String, Object> variables) {
return restTemplate.getUriTemplateHandler().expand(pathTemplate, variables).toString();
}
/**
* Invoke API by sending HTTP request with the given options.
*

View File

@ -6,6 +6,7 @@ import {{invokerPackage}}.ApiClient;
{{/imports}}
{{^fullJavaUtil}}import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
@ -72,7 +73,7 @@ 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 = UriComponentsBuilder.fromPath("{{{path}}}"){{#hasPathParams}}.buildAndExpand(uriVariables){{/hasPathParams}}{{^hasPathParams}}.build(){{/hasPathParams}}.toUriString();
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();

View File

@ -543,6 +543,16 @@ public class ApiClient {
return isForm ? formParams : obj;
}
/**
* Expand path template with variables
* @param pathTemplate path template with placeholders
* @param variables variables to replace
* @return path with placeholders replaced by variables
*/
public String expandPath(String pathTemplate, Map<String, Object> variables) {
return restTemplate.getUriTemplateHandler().expand(pathTemplate, variables).toString();
}
/**
* Invoke API by sending HTTP request with the given options.
*

View File

@ -5,6 +5,7 @@ import org.openapitools.client.ApiClient;
import org.openapitools.client.model.Client;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
@ -62,7 +63,7 @@ public class AnotherFakeApi {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling call123testSpecialTags");
}
String path = UriComponentsBuilder.fromPath("/another-fake/dummy").build().toUriString();
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();

View File

@ -13,6 +13,7 @@ import org.openapitools.client.model.User;
import org.openapitools.client.model.XmlItem;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
@ -69,7 +70,7 @@ public class FakeApi {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'xmlItem' when calling createXmlItem");
}
String path = UriComponentsBuilder.fromPath("/fake/create_xml_item").build().toUriString();
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();
@ -98,7 +99,7 @@ public class FakeApi {
public Boolean fakeOuterBooleanSerialize(Boolean body) throws RestClientException {
Object postBody = body;
String path = UriComponentsBuilder.fromPath("/fake/outer/boolean").build().toUriString();
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();
@ -127,7 +128,7 @@ public class FakeApi {
public OuterComposite fakeOuterCompositeSerialize(OuterComposite body) throws RestClientException {
Object postBody = body;
String path = UriComponentsBuilder.fromPath("/fake/outer/composite").build().toUriString();
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();
@ -156,7 +157,7 @@ public class FakeApi {
public BigDecimal fakeOuterNumberSerialize(BigDecimal body) throws RestClientException {
Object postBody = body;
String path = UriComponentsBuilder.fromPath("/fake/outer/number").build().toUriString();
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();
@ -185,7 +186,7 @@ public class FakeApi {
public String fakeOuterStringSerialize(String body) throws RestClientException {
Object postBody = body;
String path = UriComponentsBuilder.fromPath("/fake/outer/string").build().toUriString();
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();
@ -218,7 +219,7 @@ public class FakeApi {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling testBodyWithFileSchema");
}
String path = UriComponentsBuilder.fromPath("/fake/body-with-file-schema").build().toUriString();
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();
@ -257,7 +258,7 @@ public class FakeApi {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling testBodyWithQueryParams");
}
String path = UriComponentsBuilder.fromPath("/fake/body-with-query-params").build().toUriString();
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();
@ -293,7 +294,7 @@ public class FakeApi {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling testClientModel");
}
String path = UriComponentsBuilder.fromPath("/fake").build().toUriString();
String path = apiClient.expandPath("/fake", Collections.<String, Object>emptyMap());
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
final HttpHeaders headerParams = new HttpHeaders();
@ -357,7 +358,7 @@ public class FakeApi {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter '_byte' when calling testEndpointParameters");
}
String path = UriComponentsBuilder.fromPath("/fake").build().toUriString();
String path = apiClient.expandPath("/fake", Collections.<String, Object>emptyMap());
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
final HttpHeaders headerParams = new HttpHeaders();
@ -422,7 +423,7 @@ public class FakeApi {
public void testEnumParameters(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 = UriComponentsBuilder.fromPath("/fake").build().toUriString();
String path = apiClient.expandPath("/fake", Collections.<String, Object>emptyMap());
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
final HttpHeaders headerParams = new HttpHeaders();
@ -485,7 +486,7 @@ public class FakeApi {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'requiredInt64Group' when calling testGroupParameters");
}
String path = UriComponentsBuilder.fromPath("/fake").build().toUriString();
String path = apiClient.expandPath("/fake", Collections.<String, Object>emptyMap());
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
final HttpHeaders headerParams = new HttpHeaders();
@ -526,7 +527,7 @@ public class FakeApi {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'param' when calling testInlineAdditionalProperties");
}
String path = UriComponentsBuilder.fromPath("/fake/inline-additionalProperties").build().toUriString();
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();
@ -565,7 +566,7 @@ public class FakeApi {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'param2' when calling testJsonFormData");
}
String path = UriComponentsBuilder.fromPath("/fake/jsonFormData").build().toUriString();
String path = apiClient.expandPath("/fake/jsonFormData", Collections.<String, Object>emptyMap());
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
final HttpHeaders headerParams = new HttpHeaders();

View File

@ -5,6 +5,7 @@ import org.openapitools.client.ApiClient;
import org.openapitools.client.model.Client;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
@ -62,7 +63,7 @@ public class FakeClassnameTags123Api {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling testClassname");
}
String path = UriComponentsBuilder.fromPath("/fake_classname_test").build().toUriString();
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();

View File

@ -7,6 +7,7 @@ import org.openapitools.client.model.ModelApiResponse;
import org.openapitools.client.model.Pet;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
@ -64,7 +65,7 @@ public class PetApi {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling addPet");
}
String path = UriComponentsBuilder.fromPath("/pet").build().toUriString();
String path = apiClient.expandPath("/pet", Collections.<String, Object>emptyMap());
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
final HttpHeaders headerParams = new HttpHeaders();
@ -102,7 +103,7 @@ public class PetApi {
// create path and map variables
final Map<String, Object> uriVariables = new HashMap<String, Object>();
uriVariables.put("petId", petId);
String path = UriComponentsBuilder.fromPath("/pet/{petId}").buildAndExpand(uriVariables).toUriString();
String path = apiClient.expandPath("/pet/{petId}", uriVariables);
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
final HttpHeaders headerParams = new HttpHeaders();
@ -138,7 +139,7 @@ public class PetApi {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'status' when calling findPetsByStatus");
}
String path = UriComponentsBuilder.fromPath("/pet/findByStatus").build().toUriString();
String path = apiClient.expandPath("/pet/findByStatus", Collections.<String, Object>emptyMap());
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
final HttpHeaders headerParams = new HttpHeaders();
@ -175,7 +176,7 @@ public class PetApi {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'tags' when calling findPetsByTags");
}
String path = UriComponentsBuilder.fromPath("/pet/findByTags").build().toUriString();
String path = apiClient.expandPath("/pet/findByTags", Collections.<String, Object>emptyMap());
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
final HttpHeaders headerParams = new HttpHeaders();
@ -216,7 +217,7 @@ public class PetApi {
// create path and map variables
final Map<String, Object> uriVariables = new HashMap<String, Object>();
uriVariables.put("petId", petId);
String path = UriComponentsBuilder.fromPath("/pet/{petId}").buildAndExpand(uriVariables).toUriString();
String path = apiClient.expandPath("/pet/{petId}", uriVariables);
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
final HttpHeaders headerParams = new HttpHeaders();
@ -252,7 +253,7 @@ public class PetApi {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling updatePet");
}
String path = UriComponentsBuilder.fromPath("/pet").build().toUriString();
String path = apiClient.expandPath("/pet", Collections.<String, Object>emptyMap());
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
final HttpHeaders headerParams = new HttpHeaders();
@ -290,7 +291,7 @@ public class PetApi {
// create path and map variables
final Map<String, Object> uriVariables = new HashMap<String, Object>();
uriVariables.put("petId", petId);
String path = UriComponentsBuilder.fromPath("/pet/{petId}").buildAndExpand(uriVariables).toUriString();
String path = apiClient.expandPath("/pet/{petId}", uriVariables);
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
final HttpHeaders headerParams = new HttpHeaders();
@ -334,7 +335,7 @@ public class PetApi {
// create path and map variables
final Map<String, Object> uriVariables = new HashMap<String, Object>();
uriVariables.put("petId", petId);
String path = UriComponentsBuilder.fromPath("/pet/{petId}/uploadImage").buildAndExpand(uriVariables).toUriString();
String path = apiClient.expandPath("/pet/{petId}/uploadImage", uriVariables);
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
final HttpHeaders headerParams = new HttpHeaders();
@ -385,7 +386,7 @@ public class PetApi {
// create path and map variables
final Map<String, Object> uriVariables = new HashMap<String, Object>();
uriVariables.put("petId", petId);
String path = UriComponentsBuilder.fromPath("/fake/{petId}/uploadImageWithRequiredFile").buildAndExpand(uriVariables).toUriString();
String path = apiClient.expandPath("/fake/{petId}/uploadImageWithRequiredFile", uriVariables);
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
final HttpHeaders headerParams = new HttpHeaders();

View File

@ -5,6 +5,7 @@ import org.openapitools.client.ApiClient;
import org.openapitools.client.model.Order;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
@ -65,7 +66,7 @@ public class StoreApi {
// create path and map variables
final Map<String, Object> uriVariables = new HashMap<String, Object>();
uriVariables.put("order_id", orderId);
String path = UriComponentsBuilder.fromPath("/store/order/{order_id}").buildAndExpand(uriVariables).toUriString();
String path = apiClient.expandPath("/store/order/{order_id}", uriVariables);
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
final HttpHeaders headerParams = new HttpHeaders();
@ -91,7 +92,7 @@ public class StoreApi {
public Map<String, Integer> getInventory() throws RestClientException {
Object postBody = null;
String path = UriComponentsBuilder.fromPath("/store/inventory").build().toUriString();
String path = apiClient.expandPath("/store/inventory", Collections.<String, Object>emptyMap());
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
final HttpHeaders headerParams = new HttpHeaders();
@ -130,7 +131,7 @@ public class StoreApi {
// create path and map variables
final Map<String, Object> uriVariables = new HashMap<String, Object>();
uriVariables.put("order_id", orderId);
String path = UriComponentsBuilder.fromPath("/store/order/{order_id}").buildAndExpand(uriVariables).toUriString();
String path = apiClient.expandPath("/store/order/{order_id}", uriVariables);
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
final HttpHeaders headerParams = new HttpHeaders();
@ -165,7 +166,7 @@ public class StoreApi {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling placeOrder");
}
String path = UriComponentsBuilder.fromPath("/store/order").build().toUriString();
String path = apiClient.expandPath("/store/order", Collections.<String, Object>emptyMap());
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
final HttpHeaders headerParams = new HttpHeaders();

View File

@ -5,6 +5,7 @@ import org.openapitools.client.ApiClient;
import org.openapitools.client.model.User;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
@ -61,7 +62,7 @@ public class UserApi {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling createUser");
}
String path = UriComponentsBuilder.fromPath("/user").build().toUriString();
String path = apiClient.expandPath("/user", Collections.<String, Object>emptyMap());
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
final HttpHeaders headerParams = new HttpHeaders();
@ -92,7 +93,7 @@ public class UserApi {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling createUsersWithArrayInput");
}
String path = UriComponentsBuilder.fromPath("/user/createWithArray").build().toUriString();
String path = apiClient.expandPath("/user/createWithArray", Collections.<String, Object>emptyMap());
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
final HttpHeaders headerParams = new HttpHeaders();
@ -123,7 +124,7 @@ public class UserApi {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling createUsersWithListInput");
}
String path = UriComponentsBuilder.fromPath("/user/createWithList").build().toUriString();
String path = apiClient.expandPath("/user/createWithList", Collections.<String, Object>emptyMap());
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
final HttpHeaders headerParams = new HttpHeaders();
@ -158,7 +159,7 @@ public class UserApi {
// create path and map variables
final Map<String, Object> uriVariables = new HashMap<String, Object>();
uriVariables.put("username", username);
String path = UriComponentsBuilder.fromPath("/user/{username}").buildAndExpand(uriVariables).toUriString();
String path = apiClient.expandPath("/user/{username}", uriVariables);
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
final HttpHeaders headerParams = new HttpHeaders();
@ -195,7 +196,7 @@ public class UserApi {
// create path and map variables
final Map<String, Object> uriVariables = new HashMap<String, Object>();
uriVariables.put("username", username);
String path = UriComponentsBuilder.fromPath("/user/{username}").buildAndExpand(uriVariables).toUriString();
String path = apiClient.expandPath("/user/{username}", uriVariables);
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
final HttpHeaders headerParams = new HttpHeaders();
@ -236,7 +237,7 @@ public class UserApi {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'password' when calling loginUser");
}
String path = UriComponentsBuilder.fromPath("/user/login").build().toUriString();
String path = apiClient.expandPath("/user/login", Collections.<String, Object>emptyMap());
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
final HttpHeaders headerParams = new HttpHeaders();
@ -266,7 +267,7 @@ public class UserApi {
public void logoutUser() throws RestClientException {
Object postBody = null;
String path = UriComponentsBuilder.fromPath("/user/logout").build().toUriString();
String path = apiClient.expandPath("/user/logout", Collections.<String, Object>emptyMap());
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
final HttpHeaders headerParams = new HttpHeaders();
@ -307,7 +308,7 @@ public class UserApi {
// create path and map variables
final Map<String, Object> uriVariables = new HashMap<String, Object>();
uriVariables.put("username", username);
String path = UriComponentsBuilder.fromPath("/user/{username}").buildAndExpand(uriVariables).toUriString();
String path = apiClient.expandPath("/user/{username}", uriVariables);
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
final HttpHeaders headerParams = new HttpHeaders();

View File

@ -538,6 +538,16 @@ public class ApiClient {
return isForm ? formParams : obj;
}
/**
* Expand path template with variables
* @param pathTemplate path template with placeholders
* @param variables variables to replace
* @return path with placeholders replaced by variables
*/
public String expandPath(String pathTemplate, Map<String, Object> variables) {
return restTemplate.getUriTemplateHandler().expand(pathTemplate, variables).toString();
}
/**
* Invoke API by sending HTTP request with the given options.
*

View File

@ -5,6 +5,7 @@ import org.openapitools.client.ApiClient;
import org.openapitools.client.model.Client;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
@ -62,7 +63,7 @@ public class AnotherFakeApi {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling call123testSpecialTags");
}
String path = UriComponentsBuilder.fromPath("/another-fake/dummy").build().toUriString();
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();

View File

@ -13,6 +13,7 @@ import org.openapitools.client.model.User;
import org.openapitools.client.model.XmlItem;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
@ -69,7 +70,7 @@ public class FakeApi {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'xmlItem' when calling createXmlItem");
}
String path = UriComponentsBuilder.fromPath("/fake/create_xml_item").build().toUriString();
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();
@ -98,7 +99,7 @@ public class FakeApi {
public Boolean fakeOuterBooleanSerialize(Boolean body) throws RestClientException {
Object postBody = body;
String path = UriComponentsBuilder.fromPath("/fake/outer/boolean").build().toUriString();
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();
@ -127,7 +128,7 @@ public class FakeApi {
public OuterComposite fakeOuterCompositeSerialize(OuterComposite body) throws RestClientException {
Object postBody = body;
String path = UriComponentsBuilder.fromPath("/fake/outer/composite").build().toUriString();
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();
@ -156,7 +157,7 @@ public class FakeApi {
public BigDecimal fakeOuterNumberSerialize(BigDecimal body) throws RestClientException {
Object postBody = body;
String path = UriComponentsBuilder.fromPath("/fake/outer/number").build().toUriString();
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();
@ -185,7 +186,7 @@ public class FakeApi {
public String fakeOuterStringSerialize(String body) throws RestClientException {
Object postBody = body;
String path = UriComponentsBuilder.fromPath("/fake/outer/string").build().toUriString();
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();
@ -218,7 +219,7 @@ public class FakeApi {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling testBodyWithFileSchema");
}
String path = UriComponentsBuilder.fromPath("/fake/body-with-file-schema").build().toUriString();
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();
@ -257,7 +258,7 @@ public class FakeApi {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling testBodyWithQueryParams");
}
String path = UriComponentsBuilder.fromPath("/fake/body-with-query-params").build().toUriString();
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();
@ -293,7 +294,7 @@ public class FakeApi {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling testClientModel");
}
String path = UriComponentsBuilder.fromPath("/fake").build().toUriString();
String path = apiClient.expandPath("/fake", Collections.<String, Object>emptyMap());
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
final HttpHeaders headerParams = new HttpHeaders();
@ -357,7 +358,7 @@ public class FakeApi {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter '_byte' when calling testEndpointParameters");
}
String path = UriComponentsBuilder.fromPath("/fake").build().toUriString();
String path = apiClient.expandPath("/fake", Collections.<String, Object>emptyMap());
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
final HttpHeaders headerParams = new HttpHeaders();
@ -422,7 +423,7 @@ public class FakeApi {
public void testEnumParameters(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 = UriComponentsBuilder.fromPath("/fake").build().toUriString();
String path = apiClient.expandPath("/fake", Collections.<String, Object>emptyMap());
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
final HttpHeaders headerParams = new HttpHeaders();
@ -485,7 +486,7 @@ public class FakeApi {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'requiredInt64Group' when calling testGroupParameters");
}
String path = UriComponentsBuilder.fromPath("/fake").build().toUriString();
String path = apiClient.expandPath("/fake", Collections.<String, Object>emptyMap());
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
final HttpHeaders headerParams = new HttpHeaders();
@ -526,7 +527,7 @@ public class FakeApi {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'param' when calling testInlineAdditionalProperties");
}
String path = UriComponentsBuilder.fromPath("/fake/inline-additionalProperties").build().toUriString();
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();
@ -565,7 +566,7 @@ public class FakeApi {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'param2' when calling testJsonFormData");
}
String path = UriComponentsBuilder.fromPath("/fake/jsonFormData").build().toUriString();
String path = apiClient.expandPath("/fake/jsonFormData", Collections.<String, Object>emptyMap());
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
final HttpHeaders headerParams = new HttpHeaders();

View File

@ -5,6 +5,7 @@ import org.openapitools.client.ApiClient;
import org.openapitools.client.model.Client;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
@ -62,7 +63,7 @@ public class FakeClassnameTags123Api {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling testClassname");
}
String path = UriComponentsBuilder.fromPath("/fake_classname_test").build().toUriString();
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();

View File

@ -7,6 +7,7 @@ import org.openapitools.client.model.ModelApiResponse;
import org.openapitools.client.model.Pet;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
@ -64,7 +65,7 @@ public class PetApi {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling addPet");
}
String path = UriComponentsBuilder.fromPath("/pet").build().toUriString();
String path = apiClient.expandPath("/pet", Collections.<String, Object>emptyMap());
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
final HttpHeaders headerParams = new HttpHeaders();
@ -102,7 +103,7 @@ public class PetApi {
// create path and map variables
final Map<String, Object> uriVariables = new HashMap<String, Object>();
uriVariables.put("petId", petId);
String path = UriComponentsBuilder.fromPath("/pet/{petId}").buildAndExpand(uriVariables).toUriString();
String path = apiClient.expandPath("/pet/{petId}", uriVariables);
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
final HttpHeaders headerParams = new HttpHeaders();
@ -138,7 +139,7 @@ public class PetApi {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'status' when calling findPetsByStatus");
}
String path = UriComponentsBuilder.fromPath("/pet/findByStatus").build().toUriString();
String path = apiClient.expandPath("/pet/findByStatus", Collections.<String, Object>emptyMap());
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
final HttpHeaders headerParams = new HttpHeaders();
@ -175,7 +176,7 @@ public class PetApi {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'tags' when calling findPetsByTags");
}
String path = UriComponentsBuilder.fromPath("/pet/findByTags").build().toUriString();
String path = apiClient.expandPath("/pet/findByTags", Collections.<String, Object>emptyMap());
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
final HttpHeaders headerParams = new HttpHeaders();
@ -216,7 +217,7 @@ public class PetApi {
// create path and map variables
final Map<String, Object> uriVariables = new HashMap<String, Object>();
uriVariables.put("petId", petId);
String path = UriComponentsBuilder.fromPath("/pet/{petId}").buildAndExpand(uriVariables).toUriString();
String path = apiClient.expandPath("/pet/{petId}", uriVariables);
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
final HttpHeaders headerParams = new HttpHeaders();
@ -252,7 +253,7 @@ public class PetApi {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling updatePet");
}
String path = UriComponentsBuilder.fromPath("/pet").build().toUriString();
String path = apiClient.expandPath("/pet", Collections.<String, Object>emptyMap());
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
final HttpHeaders headerParams = new HttpHeaders();
@ -290,7 +291,7 @@ public class PetApi {
// create path and map variables
final Map<String, Object> uriVariables = new HashMap<String, Object>();
uriVariables.put("petId", petId);
String path = UriComponentsBuilder.fromPath("/pet/{petId}").buildAndExpand(uriVariables).toUriString();
String path = apiClient.expandPath("/pet/{petId}", uriVariables);
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
final HttpHeaders headerParams = new HttpHeaders();
@ -334,7 +335,7 @@ public class PetApi {
// create path and map variables
final Map<String, Object> uriVariables = new HashMap<String, Object>();
uriVariables.put("petId", petId);
String path = UriComponentsBuilder.fromPath("/pet/{petId}/uploadImage").buildAndExpand(uriVariables).toUriString();
String path = apiClient.expandPath("/pet/{petId}/uploadImage", uriVariables);
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
final HttpHeaders headerParams = new HttpHeaders();
@ -385,7 +386,7 @@ public class PetApi {
// create path and map variables
final Map<String, Object> uriVariables = new HashMap<String, Object>();
uriVariables.put("petId", petId);
String path = UriComponentsBuilder.fromPath("/fake/{petId}/uploadImageWithRequiredFile").buildAndExpand(uriVariables).toUriString();
String path = apiClient.expandPath("/fake/{petId}/uploadImageWithRequiredFile", uriVariables);
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
final HttpHeaders headerParams = new HttpHeaders();

View File

@ -5,6 +5,7 @@ import org.openapitools.client.ApiClient;
import org.openapitools.client.model.Order;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
@ -65,7 +66,7 @@ public class StoreApi {
// create path and map variables
final Map<String, Object> uriVariables = new HashMap<String, Object>();
uriVariables.put("order_id", orderId);
String path = UriComponentsBuilder.fromPath("/store/order/{order_id}").buildAndExpand(uriVariables).toUriString();
String path = apiClient.expandPath("/store/order/{order_id}", uriVariables);
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
final HttpHeaders headerParams = new HttpHeaders();
@ -91,7 +92,7 @@ public class StoreApi {
public Map<String, Integer> getInventory() throws RestClientException {
Object postBody = null;
String path = UriComponentsBuilder.fromPath("/store/inventory").build().toUriString();
String path = apiClient.expandPath("/store/inventory", Collections.<String, Object>emptyMap());
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
final HttpHeaders headerParams = new HttpHeaders();
@ -130,7 +131,7 @@ public class StoreApi {
// create path and map variables
final Map<String, Object> uriVariables = new HashMap<String, Object>();
uriVariables.put("order_id", orderId);
String path = UriComponentsBuilder.fromPath("/store/order/{order_id}").buildAndExpand(uriVariables).toUriString();
String path = apiClient.expandPath("/store/order/{order_id}", uriVariables);
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
final HttpHeaders headerParams = new HttpHeaders();
@ -165,7 +166,7 @@ public class StoreApi {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling placeOrder");
}
String path = UriComponentsBuilder.fromPath("/store/order").build().toUriString();
String path = apiClient.expandPath("/store/order", Collections.<String, Object>emptyMap());
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
final HttpHeaders headerParams = new HttpHeaders();

View File

@ -5,6 +5,7 @@ import org.openapitools.client.ApiClient;
import org.openapitools.client.model.User;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
@ -61,7 +62,7 @@ public class UserApi {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling createUser");
}
String path = UriComponentsBuilder.fromPath("/user").build().toUriString();
String path = apiClient.expandPath("/user", Collections.<String, Object>emptyMap());
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
final HttpHeaders headerParams = new HttpHeaders();
@ -92,7 +93,7 @@ public class UserApi {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling createUsersWithArrayInput");
}
String path = UriComponentsBuilder.fromPath("/user/createWithArray").build().toUriString();
String path = apiClient.expandPath("/user/createWithArray", Collections.<String, Object>emptyMap());
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
final HttpHeaders headerParams = new HttpHeaders();
@ -123,7 +124,7 @@ public class UserApi {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling createUsersWithListInput");
}
String path = UriComponentsBuilder.fromPath("/user/createWithList").build().toUriString();
String path = apiClient.expandPath("/user/createWithList", Collections.<String, Object>emptyMap());
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
final HttpHeaders headerParams = new HttpHeaders();
@ -158,7 +159,7 @@ public class UserApi {
// create path and map variables
final Map<String, Object> uriVariables = new HashMap<String, Object>();
uriVariables.put("username", username);
String path = UriComponentsBuilder.fromPath("/user/{username}").buildAndExpand(uriVariables).toUriString();
String path = apiClient.expandPath("/user/{username}", uriVariables);
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
final HttpHeaders headerParams = new HttpHeaders();
@ -195,7 +196,7 @@ public class UserApi {
// create path and map variables
final Map<String, Object> uriVariables = new HashMap<String, Object>();
uriVariables.put("username", username);
String path = UriComponentsBuilder.fromPath("/user/{username}").buildAndExpand(uriVariables).toUriString();
String path = apiClient.expandPath("/user/{username}", uriVariables);
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
final HttpHeaders headerParams = new HttpHeaders();
@ -236,7 +237,7 @@ public class UserApi {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'password' when calling loginUser");
}
String path = UriComponentsBuilder.fromPath("/user/login").build().toUriString();
String path = apiClient.expandPath("/user/login", Collections.<String, Object>emptyMap());
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
final HttpHeaders headerParams = new HttpHeaders();
@ -266,7 +267,7 @@ public class UserApi {
public void logoutUser() throws RestClientException {
Object postBody = null;
String path = UriComponentsBuilder.fromPath("/user/logout").build().toUriString();
String path = apiClient.expandPath("/user/logout", Collections.<String, Object>emptyMap());
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
final HttpHeaders headerParams = new HttpHeaders();
@ -307,7 +308,7 @@ public class UserApi {
// create path and map variables
final Map<String, Object> uriVariables = new HashMap<String, Object>();
uriVariables.put("username", username);
String path = UriComponentsBuilder.fromPath("/user/{username}").buildAndExpand(uriVariables).toUriString();
String path = apiClient.expandPath("/user/{username}", uriVariables);
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
final HttpHeaders headerParams = new HttpHeaders();