enumValues) {
+ this.description = description;
+ this.defaultValue = defaultValue;
+ this.enumValues = enumValues;
+ }
+}
diff --git a/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/api/AuthApi.java b/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/api/AuthApi.java
new file mode 100644
index 00000000000..109f35c294a
--- /dev/null
+++ b/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/api/AuthApi.java
@@ -0,0 +1,125 @@
+package org.openapitools.client.api;
+
+import org.openapitools.client.ApiClient;
+
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+import org.springframework.util.LinkedMultiValueMap;
+import org.springframework.util.MultiValueMap;
+import org.springframework.web.client.RestClientException;
+import org.springframework.web.client.HttpClientErrorException;
+import org.springframework.core.ParameterizedTypeReference;
+import org.springframework.core.io.FileSystemResource;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
+
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
+public class AuthApi {
+ private ApiClient apiClient;
+
+ public AuthApi() {
+ this(new ApiClient());
+ }
+
+ public AuthApi(ApiClient apiClient) {
+ this.apiClient = apiClient;
+ }
+
+ public ApiClient getApiClient() {
+ return apiClient;
+ }
+
+ public void setApiClient(ApiClient apiClient) {
+ this.apiClient = apiClient;
+ }
+
+ /**
+ * To test HTTP basic authentication
+ * To test HTTP basic authentication
+ * 200 - Successful operation
+ * @return String
+ * @throws RestClientException if an error occurs while attempting to invoke the API
+ */
+ public String testAuthHttpBasic() throws RestClientException {
+ return testAuthHttpBasicWithHttpInfo().getBody();
+ }
+
+ /**
+ * To test HTTP basic authentication
+ * To test HTTP basic authentication
+ *
200 - Successful operation
+ * @return ResponseEntity<String>
+ * @throws RestClientException if an error occurs while attempting to invoke the API
+ */
+ public ResponseEntity testAuthHttpBasicWithHttpInfo() throws RestClientException {
+ Object localVarPostBody = null;
+
+
+ final MultiValueMap localVarQueryParams = new LinkedMultiValueMap();
+ final HttpHeaders localVarHeaderParams = new HttpHeaders();
+ final MultiValueMap localVarCookieParams = new LinkedMultiValueMap();
+ final MultiValueMap localVarFormParams = new LinkedMultiValueMap();
+
+ final String[] localVarAccepts = {
+ "text/plain"
+ };
+ final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
+ final String[] localVarContentTypes = { };
+ final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
+
+ String[] localVarAuthNames = new String[] { "http_auth" };
+
+ ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {};
+ return apiClient.invokeAPI("/auth/http/basic", HttpMethod.POST, Collections.emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType);
+ }
+ /**
+ * To test HTTP bearer authentication
+ * To test HTTP bearer authentication
+ * 200 - Successful operation
+ * @return String
+ * @throws RestClientException if an error occurs while attempting to invoke the API
+ */
+ public String testAuthHttpBearer() throws RestClientException {
+ return testAuthHttpBearerWithHttpInfo().getBody();
+ }
+
+ /**
+ * To test HTTP bearer authentication
+ * To test HTTP bearer authentication
+ *
200 - Successful operation
+ * @return ResponseEntity<String>
+ * @throws RestClientException if an error occurs while attempting to invoke the API
+ */
+ public ResponseEntity testAuthHttpBearerWithHttpInfo() throws RestClientException {
+ Object localVarPostBody = null;
+
+
+ final MultiValueMap localVarQueryParams = new LinkedMultiValueMap();
+ final HttpHeaders localVarHeaderParams = new HttpHeaders();
+ final MultiValueMap localVarCookieParams = new LinkedMultiValueMap();
+ final MultiValueMap localVarFormParams = new LinkedMultiValueMap();
+
+ final String[] localVarAccepts = {
+ "text/plain"
+ };
+ final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
+ final String[] localVarContentTypes = { };
+ final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
+
+ String[] localVarAuthNames = new String[] { "http_bearer_auth" };
+
+ ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {};
+ return apiClient.invokeAPI("/auth/http/bearer", HttpMethod.POST, Collections.emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType);
+ }
+}
diff --git a/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/api/BodyApi.java b/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/api/BodyApi.java
new file mode 100644
index 00000000000..65bf836b78c
--- /dev/null
+++ b/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/api/BodyApi.java
@@ -0,0 +1,398 @@
+package org.openapitools.client.api;
+
+import org.openapitools.client.ApiClient;
+
+import java.io.File;
+import org.openapitools.client.model.Pet;
+import org.openapitools.client.model.Tag;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+import org.springframework.util.LinkedMultiValueMap;
+import org.springframework.util.MultiValueMap;
+import org.springframework.web.client.RestClientException;
+import org.springframework.web.client.HttpClientErrorException;
+import org.springframework.core.ParameterizedTypeReference;
+import org.springframework.core.io.FileSystemResource;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
+
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
+public class BodyApi {
+ private ApiClient apiClient;
+
+ public BodyApi() {
+ this(new ApiClient());
+ }
+
+ public BodyApi(ApiClient apiClient) {
+ this.apiClient = apiClient;
+ }
+
+ public ApiClient getApiClient() {
+ return apiClient;
+ }
+
+ public void setApiClient(ApiClient apiClient) {
+ this.apiClient = apiClient;
+ }
+
+ /**
+ * Test binary (gif) response body
+ * Test binary (gif) response body
+ * 200 - Successful operation
+ * @return File
+ * @throws RestClientException if an error occurs while attempting to invoke the API
+ */
+ public File testBinaryGif() throws RestClientException {
+ return testBinaryGifWithHttpInfo().getBody();
+ }
+
+ /**
+ * Test binary (gif) response body
+ * Test binary (gif) response body
+ *
200 - Successful operation
+ * @return ResponseEntity<File>
+ * @throws RestClientException if an error occurs while attempting to invoke the API
+ */
+ public ResponseEntity testBinaryGifWithHttpInfo() throws RestClientException {
+ Object localVarPostBody = null;
+
+
+ final MultiValueMap localVarQueryParams = new LinkedMultiValueMap();
+ final HttpHeaders localVarHeaderParams = new HttpHeaders();
+ final MultiValueMap localVarCookieParams = new LinkedMultiValueMap();
+ final MultiValueMap localVarFormParams = new LinkedMultiValueMap();
+
+ final String[] localVarAccepts = {
+ "image/gif"
+ };
+ final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
+ final String[] localVarContentTypes = { };
+ final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
+
+ String[] localVarAuthNames = new String[] { };
+
+ ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {};
+ return apiClient.invokeAPI("/binary/gif", HttpMethod.POST, Collections.emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType);
+ }
+ /**
+ * Test body parameter(s)
+ * Test body parameter(s)
+ * 200 - Successful operation
+ * @param body (optional)
+ * @return String
+ * @throws RestClientException if an error occurs while attempting to invoke the API
+ */
+ public String testBodyApplicationOctetstreamBinary(File body) throws RestClientException {
+ return testBodyApplicationOctetstreamBinaryWithHttpInfo(body).getBody();
+ }
+
+ /**
+ * Test body parameter(s)
+ * Test body parameter(s)
+ *
200 - Successful operation
+ * @param body (optional)
+ * @return ResponseEntity<String>
+ * @throws RestClientException if an error occurs while attempting to invoke the API
+ */
+ public ResponseEntity testBodyApplicationOctetstreamBinaryWithHttpInfo(File body) throws RestClientException {
+ Object localVarPostBody = body;
+
+
+ final MultiValueMap localVarQueryParams = new LinkedMultiValueMap();
+ final HttpHeaders localVarHeaderParams = new HttpHeaders();
+ final MultiValueMap localVarCookieParams = new LinkedMultiValueMap();
+ final MultiValueMap localVarFormParams = new LinkedMultiValueMap();
+
+ final String[] localVarAccepts = {
+ "text/plain"
+ };
+ final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
+ final String[] localVarContentTypes = {
+ "application/octet-stream"
+ };
+ final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
+
+ String[] localVarAuthNames = new String[] { };
+
+ ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {};
+ return apiClient.invokeAPI("/body/application/octetstream/binary", HttpMethod.POST, Collections.emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType);
+ }
+ /**
+ * Test array of binary in multipart mime
+ * Test array of binary in multipart mime
+ * 200 - Successful operation
+ * @param files (required)
+ * @return String
+ * @throws RestClientException if an error occurs while attempting to invoke the API
+ */
+ public String testBodyMultipartFormdataArrayOfBinary(List files) throws RestClientException {
+ return testBodyMultipartFormdataArrayOfBinaryWithHttpInfo(files).getBody();
+ }
+
+ /**
+ * Test array of binary in multipart mime
+ * Test array of binary in multipart mime
+ * 200 - Successful operation
+ * @param files (required)
+ * @return ResponseEntity<String>
+ * @throws RestClientException if an error occurs while attempting to invoke the API
+ */
+ public ResponseEntity testBodyMultipartFormdataArrayOfBinaryWithHttpInfo(List files) throws RestClientException {
+ Object localVarPostBody = null;
+
+ // verify the required parameter 'files' is set
+ if (files == null) {
+ throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'files' when calling testBodyMultipartFormdataArrayOfBinary");
+ }
+
+
+ final MultiValueMap localVarQueryParams = new LinkedMultiValueMap();
+ final HttpHeaders localVarHeaderParams = new HttpHeaders();
+ final MultiValueMap localVarCookieParams = new LinkedMultiValueMap();
+ final MultiValueMap localVarFormParams = new LinkedMultiValueMap();
+
+ if (files != null)
+ localVarFormParams.addAll("files", files.stream().map(FileSystemResource::new).collect(Collectors.toList()));
+
+ final String[] localVarAccepts = {
+ "text/plain"
+ };
+ final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
+ final String[] localVarContentTypes = {
+ "multipart/form-data"
+ };
+ final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
+
+ String[] localVarAuthNames = new String[] { };
+
+ ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {};
+ return apiClient.invokeAPI("/body/application/octetstream/array_of_binary", HttpMethod.POST, Collections.emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType);
+ }
+ /**
+ * Test body parameter(s)
+ * Test body parameter(s)
+ * 200 - Successful operation
+ * @param pet Pet object that needs to be added to the store (optional)
+ * @return Pet
+ * @throws RestClientException if an error occurs while attempting to invoke the API
+ */
+ public Pet testEchoBodyAllOfPet(Pet pet) throws RestClientException {
+ return testEchoBodyAllOfPetWithHttpInfo(pet).getBody();
+ }
+
+ /**
+ * Test body parameter(s)
+ * Test body parameter(s)
+ *
200 - Successful operation
+ * @param pet Pet object that needs to be added to the store (optional)
+ * @return ResponseEntity<Pet>
+ * @throws RestClientException if an error occurs while attempting to invoke the API
+ */
+ public ResponseEntity testEchoBodyAllOfPetWithHttpInfo(Pet pet) throws RestClientException {
+ Object localVarPostBody = pet;
+
+
+ final MultiValueMap localVarQueryParams = new LinkedMultiValueMap();
+ final HttpHeaders localVarHeaderParams = new HttpHeaders();
+ final MultiValueMap localVarCookieParams = new LinkedMultiValueMap();
+ final MultiValueMap localVarFormParams = new LinkedMultiValueMap();
+
+ final String[] localVarAccepts = {
+ "application/json"
+ };
+ final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
+ final String[] localVarContentTypes = {
+ "application/json"
+ };
+ final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
+
+ String[] localVarAuthNames = new String[] { };
+
+ ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {};
+ return apiClient.invokeAPI("/echo/body/allOf/Pet", HttpMethod.POST, Collections.emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType);
+ }
+ /**
+ * Test free form object
+ * Test free form object
+ * 200 - Successful operation
+ * @param body Free form object (optional)
+ * @return String
+ * @throws RestClientException if an error occurs while attempting to invoke the API
+ */
+ public String testEchoBodyFreeFormObjectResponseString(Object body) throws RestClientException {
+ return testEchoBodyFreeFormObjectResponseStringWithHttpInfo(body).getBody();
+ }
+
+ /**
+ * Test free form object
+ * Test free form object
+ *
200 - Successful operation
+ * @param body Free form object (optional)
+ * @return ResponseEntity<String>
+ * @throws RestClientException if an error occurs while attempting to invoke the API
+ */
+ public ResponseEntity testEchoBodyFreeFormObjectResponseStringWithHttpInfo(Object body) throws RestClientException {
+ Object localVarPostBody = body;
+
+
+ final MultiValueMap localVarQueryParams = new LinkedMultiValueMap();
+ final HttpHeaders localVarHeaderParams = new HttpHeaders();
+ final MultiValueMap localVarCookieParams = new LinkedMultiValueMap();
+ final MultiValueMap localVarFormParams = new LinkedMultiValueMap();
+
+ final String[] localVarAccepts = {
+ "text/plain"
+ };
+ final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
+ final String[] localVarContentTypes = {
+ "application/json"
+ };
+ final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
+
+ String[] localVarAuthNames = new String[] { };
+
+ ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {};
+ return apiClient.invokeAPI("/echo/body/FreeFormObject/response_string", HttpMethod.POST, Collections.emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType);
+ }
+ /**
+ * Test body parameter(s)
+ * Test body parameter(s)
+ * 200 - Successful operation
+ * @param pet Pet object that needs to be added to the store (optional)
+ * @return Pet
+ * @throws RestClientException if an error occurs while attempting to invoke the API
+ */
+ public Pet testEchoBodyPet(Pet pet) throws RestClientException {
+ return testEchoBodyPetWithHttpInfo(pet).getBody();
+ }
+
+ /**
+ * Test body parameter(s)
+ * Test body parameter(s)
+ *
200 - Successful operation
+ * @param pet Pet object that needs to be added to the store (optional)
+ * @return ResponseEntity<Pet>
+ * @throws RestClientException if an error occurs while attempting to invoke the API
+ */
+ public ResponseEntity testEchoBodyPetWithHttpInfo(Pet pet) throws RestClientException {
+ Object localVarPostBody = pet;
+
+
+ final MultiValueMap localVarQueryParams = new LinkedMultiValueMap();
+ final HttpHeaders localVarHeaderParams = new HttpHeaders();
+ final MultiValueMap localVarCookieParams = new LinkedMultiValueMap();
+ final MultiValueMap localVarFormParams = new LinkedMultiValueMap();
+
+ final String[] localVarAccepts = {
+ "application/json"
+ };
+ final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
+ final String[] localVarContentTypes = {
+ "application/json"
+ };
+ final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
+
+ String[] localVarAuthNames = new String[] { };
+
+ ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {};
+ return apiClient.invokeAPI("/echo/body/Pet", HttpMethod.POST, Collections.emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType);
+ }
+ /**
+ * Test empty response body
+ * Test empty response body
+ * 200 - Successful operation
+ * @param pet Pet object that needs to be added to the store (optional)
+ * @return String
+ * @throws RestClientException if an error occurs while attempting to invoke the API
+ */
+ public String testEchoBodyPetResponseString(Pet pet) throws RestClientException {
+ return testEchoBodyPetResponseStringWithHttpInfo(pet).getBody();
+ }
+
+ /**
+ * Test empty response body
+ * Test empty response body
+ *
200 - Successful operation
+ * @param pet Pet object that needs to be added to the store (optional)
+ * @return ResponseEntity<String>
+ * @throws RestClientException if an error occurs while attempting to invoke the API
+ */
+ public ResponseEntity testEchoBodyPetResponseStringWithHttpInfo(Pet pet) throws RestClientException {
+ Object localVarPostBody = pet;
+
+
+ final MultiValueMap localVarQueryParams = new LinkedMultiValueMap();
+ final HttpHeaders localVarHeaderParams = new HttpHeaders();
+ final MultiValueMap localVarCookieParams = new LinkedMultiValueMap();
+ final MultiValueMap localVarFormParams = new LinkedMultiValueMap();
+
+ final String[] localVarAccepts = {
+ "text/plain"
+ };
+ final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
+ final String[] localVarContentTypes = {
+ "application/json"
+ };
+ final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
+
+ String[] localVarAuthNames = new String[] { };
+
+ ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {};
+ return apiClient.invokeAPI("/echo/body/Pet/response_string", HttpMethod.POST, Collections.emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType);
+ }
+ /**
+ * Test empty json (request body)
+ * Test empty json (request body)
+ * 200 - Successful operation
+ * @param tag Tag object (optional)
+ * @return String
+ * @throws RestClientException if an error occurs while attempting to invoke the API
+ */
+ public String testEchoBodyTagResponseString(Tag tag) throws RestClientException {
+ return testEchoBodyTagResponseStringWithHttpInfo(tag).getBody();
+ }
+
+ /**
+ * Test empty json (request body)
+ * Test empty json (request body)
+ *
200 - Successful operation
+ * @param tag Tag object (optional)
+ * @return ResponseEntity<String>
+ * @throws RestClientException if an error occurs while attempting to invoke the API
+ */
+ public ResponseEntity testEchoBodyTagResponseStringWithHttpInfo(Tag tag) throws RestClientException {
+ Object localVarPostBody = tag;
+
+
+ final MultiValueMap localVarQueryParams = new LinkedMultiValueMap();
+ final HttpHeaders localVarHeaderParams = new HttpHeaders();
+ final MultiValueMap localVarCookieParams = new LinkedMultiValueMap();
+ final MultiValueMap localVarFormParams = new LinkedMultiValueMap();
+
+ final String[] localVarAccepts = {
+ "text/plain"
+ };
+ final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
+ final String[] localVarContentTypes = {
+ "application/json"
+ };
+ final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
+
+ String[] localVarAuthNames = new String[] { };
+
+ ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {};
+ return apiClient.invokeAPI("/echo/body/Tag/response_string", HttpMethod.POST, Collections.emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType);
+ }
+}
diff --git a/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/api/FormApi.java b/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/api/FormApi.java
new file mode 100644
index 00000000000..9befcecfbaf
--- /dev/null
+++ b/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/api/FormApi.java
@@ -0,0 +1,167 @@
+package org.openapitools.client.api;
+
+import org.openapitools.client.ApiClient;
+
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+import org.springframework.util.LinkedMultiValueMap;
+import org.springframework.util.MultiValueMap;
+import org.springframework.web.client.RestClientException;
+import org.springframework.web.client.HttpClientErrorException;
+import org.springframework.core.ParameterizedTypeReference;
+import org.springframework.core.io.FileSystemResource;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
+
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
+public class FormApi {
+ private ApiClient apiClient;
+
+ public FormApi() {
+ this(new ApiClient());
+ }
+
+ public FormApi(ApiClient apiClient) {
+ this.apiClient = apiClient;
+ }
+
+ public ApiClient getApiClient() {
+ return apiClient;
+ }
+
+ public void setApiClient(ApiClient apiClient) {
+ this.apiClient = apiClient;
+ }
+
+ /**
+ * Test form parameter(s)
+ * Test form parameter(s)
+ * 200 - Successful operation
+ * @param integerForm (optional)
+ * @param booleanForm (optional)
+ * @param stringForm (optional)
+ * @return String
+ * @throws RestClientException if an error occurs while attempting to invoke the API
+ */
+ public String testFormIntegerBooleanString(Integer integerForm, Boolean booleanForm, String stringForm) throws RestClientException {
+ return testFormIntegerBooleanStringWithHttpInfo(integerForm, booleanForm, stringForm).getBody();
+ }
+
+ /**
+ * Test form parameter(s)
+ * Test form parameter(s)
+ *
200 - Successful operation
+ * @param integerForm (optional)
+ * @param booleanForm (optional)
+ * @param stringForm (optional)
+ * @return ResponseEntity<String>
+ * @throws RestClientException if an error occurs while attempting to invoke the API
+ */
+ public ResponseEntity testFormIntegerBooleanStringWithHttpInfo(Integer integerForm, Boolean booleanForm, String stringForm) throws RestClientException {
+ Object localVarPostBody = null;
+
+
+ final MultiValueMap localVarQueryParams = new LinkedMultiValueMap();
+ final HttpHeaders localVarHeaderParams = new HttpHeaders();
+ final MultiValueMap localVarCookieParams = new LinkedMultiValueMap();
+ final MultiValueMap localVarFormParams = new LinkedMultiValueMap();
+
+ if (integerForm != null)
+ localVarFormParams.add("integer_form", integerForm);
+ if (booleanForm != null)
+ localVarFormParams.add("boolean_form", booleanForm);
+ if (stringForm != null)
+ localVarFormParams.add("string_form", stringForm);
+
+ final String[] localVarAccepts = {
+ "text/plain"
+ };
+ final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
+ final String[] localVarContentTypes = {
+ "application/x-www-form-urlencoded"
+ };
+ final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
+
+ String[] localVarAuthNames = new String[] { };
+
+ ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {};
+ return apiClient.invokeAPI("/form/integer/boolean/string", HttpMethod.POST, Collections.emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType);
+ }
+ /**
+ * Test form parameter(s) for oneOf schema
+ * Test form parameter(s) for oneOf schema
+ * 200 - Successful operation
+ * @param form1 (optional)
+ * @param form2 (optional)
+ * @param form3 (optional)
+ * @param form4 (optional)
+ * @param id (optional)
+ * @param name (optional)
+ * @return String
+ * @throws RestClientException if an error occurs while attempting to invoke the API
+ */
+ public String testFormOneof(String form1, Integer form2, String form3, Boolean form4, Long id, String name) throws RestClientException {
+ return testFormOneofWithHttpInfo(form1, form2, form3, form4, id, name).getBody();
+ }
+
+ /**
+ * Test form parameter(s) for oneOf schema
+ * Test form parameter(s) for oneOf schema
+ *
200 - Successful operation
+ * @param form1 (optional)
+ * @param form2 (optional)
+ * @param form3 (optional)
+ * @param form4 (optional)
+ * @param id (optional)
+ * @param name (optional)
+ * @return ResponseEntity<String>
+ * @throws RestClientException if an error occurs while attempting to invoke the API
+ */
+ public ResponseEntity testFormOneofWithHttpInfo(String form1, Integer form2, String form3, Boolean form4, Long id, String name) throws RestClientException {
+ Object localVarPostBody = null;
+
+
+ final MultiValueMap localVarQueryParams = new LinkedMultiValueMap();
+ final HttpHeaders localVarHeaderParams = new HttpHeaders();
+ final MultiValueMap localVarCookieParams = new LinkedMultiValueMap();
+ final MultiValueMap localVarFormParams = new LinkedMultiValueMap();
+
+ if (form1 != null)
+ localVarFormParams.add("form1", form1);
+ if (form2 != null)
+ localVarFormParams.add("form2", form2);
+ if (form3 != null)
+ localVarFormParams.add("form3", form3);
+ if (form4 != null)
+ localVarFormParams.add("form4", form4);
+ if (id != null)
+ localVarFormParams.add("id", id);
+ if (name != null)
+ localVarFormParams.add("name", name);
+
+ final String[] localVarAccepts = {
+ "text/plain"
+ };
+ final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
+ final String[] localVarContentTypes = {
+ "application/x-www-form-urlencoded"
+ };
+ final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
+
+ String[] localVarAuthNames = new String[] { };
+
+ ParameterizedTypeReference localReturnType = new ParameterizedTypeReference() {};
+ return apiClient.invokeAPI("/form/oneof", HttpMethod.POST, Collections.emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType);
+ }
+}
diff --git a/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/api/HeaderApi.java b/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/api/HeaderApi.java
new file mode 100644
index 00000000000..121f8875a72
--- /dev/null
+++ b/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/api/HeaderApi.java
@@ -0,0 +1,108 @@
+package org.openapitools.client.api;
+
+import org.openapitools.client.ApiClient;
+
+import org.openapitools.client.model.StringEnumRef;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+import org.springframework.util.LinkedMultiValueMap;
+import org.springframework.util.MultiValueMap;
+import org.springframework.web.client.RestClientException;
+import org.springframework.web.client.HttpClientErrorException;
+import org.springframework.core.ParameterizedTypeReference;
+import org.springframework.core.io.FileSystemResource;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
+
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
+public class HeaderApi {
+ private ApiClient apiClient;
+
+ public HeaderApi() {
+ this(new ApiClient());
+ }
+
+ public HeaderApi(ApiClient apiClient) {
+ this.apiClient = apiClient;
+ }
+
+ public ApiClient getApiClient() {
+ return apiClient;
+ }
+
+ public void setApiClient(ApiClient apiClient) {
+ this.apiClient = apiClient;
+ }
+
+ /**
+ * Test header parameter(s)
+ * Test header parameter(s)
+ * 200 - Successful operation
+ * @param integerHeader (optional)
+ * @param booleanHeader (optional)
+ * @param stringHeader (optional)
+ * @param enumNonrefStringHeader (optional)
+ * @param enumRefStringHeader (optional)
+ * @return String
+ * @throws RestClientException if an error occurs while attempting to invoke the API
+ */
+ public String testHeaderIntegerBooleanStringEnums(Integer integerHeader, Boolean booleanHeader, String stringHeader, String enumNonrefStringHeader, StringEnumRef enumRefStringHeader) throws RestClientException {
+ return testHeaderIntegerBooleanStringEnumsWithHttpInfo(integerHeader, booleanHeader, stringHeader, enumNonrefStringHeader, enumRefStringHeader).getBody();
+ }
+
+ /**
+ * Test header parameter(s)
+ * Test header parameter(s)
+ *
200 - Successful operation
+ * @param integerHeader (optional)
+ * @param booleanHeader (optional)
+ * @param stringHeader (optional)
+ * @param enumNonrefStringHeader (optional)
+ * @param enumRefStringHeader (optional)
+ * @return ResponseEntity<String>
+ * @throws RestClientException if an error occurs while attempting to invoke the API
+ */
+ public ResponseEntity testHeaderIntegerBooleanStringEnumsWithHttpInfo(Integer integerHeader, Boolean booleanHeader, String stringHeader, String enumNonrefStringHeader, StringEnumRef enumRefStringHeader) throws RestClientException {
+ Object localVarPostBody = null;
+
+
+ final MultiValueMap localVarQueryParams = new LinkedMultiValueMap();
+ final HttpHeaders localVarHeaderParams = new HttpHeaders();
+ final MultiValueMap localVarCookieParams = new LinkedMultiValueMap();
+ final MultiValueMap localVarFormParams = new LinkedMultiValueMap