diff --git a/.github/workflows/samples-java-client-echo-api-jdk11.yaml b/.github/workflows/samples-java-client-echo-api-jdk11.yaml
index b165d677d5c..12813b63500 100644
--- a/.github/workflows/samples-java-client-echo-api-jdk11.yaml
+++ b/.github/workflows/samples-java-client-echo-api-jdk11.yaml
@@ -18,6 +18,7 @@ jobs:
# clients
- samples/client/echo_api/java/apache-httpclient
- samples/client/echo_api/java/native
+ - samples/client/echo_api/java/feign-gson
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
diff --git a/bin/configs/java-feign-gson-echo-api.yaml b/bin/configs/java-feign-gson-echo-api.yaml
new file mode 100644
index 00000000000..d765eb41c02
--- /dev/null
+++ b/bin/configs/java-feign-gson-echo-api.yaml
@@ -0,0 +1,9 @@
+generatorName: java
+outputDir: samples/client/echo_api/java/feign-gson
+library: feign
+inputSpec: modules/openapi-generator/src/test/resources/3_0/echo_api.yaml
+templateDir: modules/openapi-generator/src/main/resources/Java
+additionalProperties:
+ serializationLibrary: gson
+ artifactId: echo-api-feign-json
+ hideGenerationTimestamp: "true"
diff --git a/docs/generators/java.md b/docs/generators/java.md
index 43a723d2ed5..89cc2f2c33e 100644
--- a/docs/generators/java.md
+++ b/docs/generators/java.md
@@ -56,7 +56,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|implicitHeadersRegex|Skip header parameters that matches given regex in the generated API methods using @ApiImplicitParams annotation. Note: this parameter is ignored when implicitHeaders=true| |null|
|invokerPackage|root package for generated code| |org.openapitools.client|
|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
|true|
-|library|library template (sub-template) to use|
**jersey1**
HTTP client: Jersey client 1.19.x. JSON processing: Jackson 2.9.x. Enable gzip request encoding using '-DuseGzipFeature=true'. IMPORTANT NOTE: jersey 1.x is no longer actively maintained so please upgrade to 'jersey3' or other HTTP libraries instead.
**jersey2**
HTTP client: Jersey client 2.25.1. JSON processing: Jackson 2.9.x
**jersey3**
HTTP client: Jersey client 3.x. JSON processing: Jackson 2.x
**feign**
HTTP client: OpenFeign 10.x. JSON processing: Jackson 2.9.x.
**okhttp-gson**
[DEFAULT] HTTP client: OkHttp 3.x. JSON processing: Gson 2.8.x. Enable Parcelable models on Android using '-DparcelableModel=true'. Enable gzip request encoding using '-DuseGzipFeature=true'.
**retrofit2**
HTTP client: OkHttp 3.x. JSON processing: Gson 2.x (Retrofit 2.3.0). Enable the RxJava adapter using '-DuseRxJava[2/3]=true'. (RxJava 1.x or 2.x or 3.x)
**resttemplate**
HTTP client: Spring RestTemplate 4.x. JSON processing: Jackson 2.9.x
**webclient**
HTTP client: Spring WebClient 5.x. JSON processing: Jackson 2.9.x
**resteasy**
HTTP client: Resteasy client 3.x. JSON processing: Jackson 2.9.x
**vertx**
HTTP client: VertX client 3.x. JSON processing: Jackson 2.9.x
**google-api-client**
HTTP client: Google API client 1.x. JSON processing: Jackson 2.9.x
**rest-assured**
HTTP client: rest-assured : 4.x. JSON processing: Gson 2.x or Jackson 2.10.x. Only for Java 8
**native**
HTTP client: Java native HttpClient. JSON processing: Jackson 2.9.x. Only for Java11+
|okhttp-gson|
+|library|library template (sub-template) to use|
**jersey1**
HTTP client: Jersey client 1.19.x. JSON processing: Jackson 2.9.x. Enable gzip request encoding using '-DuseGzipFeature=true'. IMPORTANT NOTE: jersey 1.x is no longer actively maintained so please upgrade to 'jersey3' or other HTTP libraries instead.
**jersey2**
HTTP client: Jersey client 2.25.1. JSON processing: Jackson 2.9.x
**jersey3**
HTTP client: Jersey client 3.x. JSON processing: Jackson 2.x
**feign**
HTTP client: OpenFeign 10.x. JSON processing: Jackson 2.9.x. or Gson 2.x
**okhttp-gson**
[DEFAULT] HTTP client: OkHttp 3.x. JSON processing: Gson 2.8.x. Enable Parcelable models on Android using '-DparcelableModel=true'. Enable gzip request encoding using '-DuseGzipFeature=true'.
**retrofit2**
HTTP client: OkHttp 3.x. JSON processing: Gson 2.x (Retrofit 2.3.0). Enable the RxJava adapter using '-DuseRxJava[2/3]=true'. (RxJava 1.x or 2.x or 3.x)
**resttemplate**
HTTP client: Spring RestTemplate 4.x. JSON processing: Jackson 2.9.x
**webclient**
HTTP client: Spring WebClient 5.x. JSON processing: Jackson 2.9.x
**resteasy**
HTTP client: Resteasy client 3.x. JSON processing: Jackson 2.9.x
**vertx**
HTTP client: VertX client 3.x. JSON processing: Jackson 2.9.x
**google-api-client**
HTTP client: Google API client 1.x. JSON processing: Jackson 2.9.x
**rest-assured**
HTTP client: rest-assured : 4.x. JSON processing: Gson 2.x or Jackson 2.10.x. Only for Java 8
**native**
HTTP client: Java native HttpClient. JSON processing: Jackson 2.9.x. Only for Java11+
Encodes a collection of query parameters according to the Swagger
+ * collection format.
+ *
+ *
Of the various collection formats defined by Swagger ("csv", "tsv",
+ * etc), Feign only natively supports "multi". This utility generates the
+ * other format types so it will be properly processed by Feign.
+ *
+ *
Note, as part of reformatting, it URL encodes the parameters as
+ * well.
+ * @param parameters The collection object to be formatted. This object will
+ * not be changed.
+ * @param collectionFormat The Swagger collection format (eg, "csv", "tsv",
+ * "pipes"). See the
+ *
+ * OpenAPI Spec for more details.
+ * @return An object that will be correctly formatted by Feign.
+ */
+ public static Object encodeCollection(Collection> parameters,
+ String collectionFormat) {
+ if (parameters == null) {
+ return parameters;
+ }
+ List stringValues = new ArrayList<>(parameters.size());
+ for (Object parameter : parameters) {
+ // ignore null values (same behavior as Feign)
+ if (parameter != null) {
+ stringValues.add(encode(parameter));
+ }
+ }
+ // Feign natively handles single-element lists and the "multi" format.
+ if (stringValues.size() < 2 || "multi".equals(collectionFormat)) {
+ return stringValues;
+ }
+ // Otherwise return a formatted String
+ String[] stringArray = stringValues.toArray(new String[0]);
+ switch (collectionFormat) {
+ case "csv":
+ default:
+ return StringUtil.join(stringArray, ",");
+ case "ssv":
+ return StringUtil.join(stringArray, " ");
+ case "tsv":
+ return StringUtil.join(stringArray, "\t");
+ case "pipes":
+ return StringUtil.join(stringArray, "|");
+ }
+ }
+
+ /**
+ * URL encode a single query parameter.
+ * @param parameter The query parameter to encode. This object will not be
+ * changed.
+ * @return The URL encoded string representation of the parameter. If the
+ * parameter is null, returns null.
+ */
+ public static String encode(Object parameter) {
+ if (parameter == null) {
+ return null;
+ }
+ try {
+ return URLEncoder.encode(parameter.toString(), "UTF-8").replaceAll("\\+", "%20");
+ } catch (UnsupportedEncodingException e) {
+ // Should never happen, UTF-8 is always supported
+ throw new RuntimeException(e);
+ }
+ }
+}
diff --git a/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/ServerConfiguration.java b/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/ServerConfiguration.java
new file mode 100644
index 00000000000..59edc528a44
--- /dev/null
+++ b/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/ServerConfiguration.java
@@ -0,0 +1,58 @@
+package org.openapitools.client;
+
+import java.util.Map;
+
+/**
+ * Representing a Server configuration.
+ */
+public class ServerConfiguration {
+ public String URL;
+ public String description;
+ public Map variables;
+
+ /**
+ * @param URL A URL to the target host.
+ * @param description A description of the host designated by the URL.
+ * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template.
+ */
+ public ServerConfiguration(String URL, String description, Map variables) {
+ this.URL = URL;
+ this.description = description;
+ this.variables = variables;
+ }
+
+ /**
+ * Format URL template using given variables.
+ *
+ * @param variables A map between a variable name and its value.
+ * @return Formatted URL.
+ */
+ public String URL(Map variables) {
+ String url = this.URL;
+
+ // go through variables and replace placeholders
+ for (Map.Entry variable: this.variables.entrySet()) {
+ String name = variable.getKey();
+ ServerVariable serverVariable = variable.getValue();
+ String value = serverVariable.defaultValue;
+
+ if (variables != null && variables.containsKey(name)) {
+ value = variables.get(name);
+ if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) {
+ throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + ".");
+ }
+ }
+ url = url.replace("{" + name + "}", value);
+ }
+ return url;
+ }
+
+ /**
+ * Format URL template using default server variables.
+ *
+ * @return Formatted URL.
+ */
+ public String URL() {
+ return URL(null);
+ }
+}
diff --git a/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/ServerVariable.java b/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/ServerVariable.java
new file mode 100644
index 00000000000..c2f13e21666
--- /dev/null
+++ b/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/ServerVariable.java
@@ -0,0 +1,23 @@
+package org.openapitools.client;
+
+import java.util.HashSet;
+
+/**
+ * Representing a Server Variable for server URL template substitution.
+ */
+public class ServerVariable {
+ public String description;
+ public String defaultValue;
+ public HashSet enumValues = null;
+
+ /**
+ * @param description A description for the server variable.
+ * @param defaultValue The default value to use for substitution.
+ * @param enumValues An enumeration of string values to be used if the substitution options are from a limited set.
+ */
+ public ServerVariable(String description, String defaultValue, HashSet enumValues) {
+ this.description = description;
+ this.defaultValue = defaultValue;
+ this.enumValues = enumValues;
+ }
+}
diff --git a/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/StringUtil.java b/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/StringUtil.java
new file mode 100644
index 00000000000..d6c3fc8a968
--- /dev/null
+++ b/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/StringUtil.java
@@ -0,0 +1,83 @@
+/*
+ * Echo Server API
+ * Echo Server API
+ *
+ * The version of the OpenAPI document: 0.1.0
+ * Contact: team@openapitools.org
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+package org.openapitools.client;
+
+import java.util.Collection;
+import java.util.Iterator;
+
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
+public class StringUtil {
+ /**
+ * Check if the given array contains the given value (with case-insensitive comparison).
+ *
+ * @param array The array
+ * @param value The value to search
+ * @return true if the array contains the value
+ */
+ public static boolean containsIgnoreCase(String[] array, String value) {
+ for (String str : array) {
+ if (value == null && str == null) {
+ return true;
+ }
+ if (value != null && value.equalsIgnoreCase(str)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Join an array of strings with the given separator.
+ *
+ * Note: This might be replaced by utility method from commons-lang or guava someday
+ * if one of those libraries is added as dependency.
+ *
+ *
+ * @param array The array of strings
+ * @param separator The separator
+ * @return the resulting string
+ */
+ public static String join(String[] array, String separator) {
+ int len = array.length;
+ if (len == 0) {
+ return "";
+ }
+
+ StringBuilder out = new StringBuilder();
+ out.append(array[0]);
+ for (int i = 1; i < len; i++) {
+ out.append(separator).append(array[i]);
+ }
+ return out.toString();
+ }
+
+ /**
+ * Join a list of strings with the given separator.
+ *
+ * @param list The list of strings
+ * @param separator The separator
+ * @return the resulting string
+ */
+ public static String join(Collection list, String separator) {
+ Iterator iterator = list.iterator();
+ StringBuilder out = new StringBuilder();
+ if (iterator.hasNext()) {
+ out.append(iterator.next());
+ }
+ while (iterator.hasNext()) {
+ out.append(separator).append(iterator.next());
+ }
+ return out.toString();
+ }
+}
diff --git a/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/api/BodyApi.java b/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/api/BodyApi.java
new file mode 100644
index 00000000000..c9750387366
--- /dev/null
+++ b/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/api/BodyApi.java
@@ -0,0 +1,47 @@
+package org.openapitools.client.api;
+
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.EncodingUtils;
+import org.openapitools.client.model.ApiResponse;
+
+import org.openapitools.client.model.Pet;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import feign.*;
+
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
+public interface BodyApi extends ApiClient.Api {
+
+
+ /**
+ * Test body parameter(s)
+ * Test body parameter(s)
+ * @param pet Pet object that needs to be added to the store (optional)
+ * @return Pet
+ */
+ @RequestLine("POST /echo/body/Pet")
+ @Headers({
+ "Content-Type: application/json",
+ "Accept: application/json",
+ })
+ Pet testEchoBodyPet(Pet pet);
+
+ /**
+ * Test body parameter(s)
+ * Similar to testEchoBodyPet but it also returns the http response headers .
+ * Test body parameter(s)
+ * @param pet Pet object that needs to be added to the store (optional)
+ * @return A ApiResponse that wraps the response boyd and the http headers.
+ */
+ @RequestLine("POST /echo/body/Pet")
+ @Headers({
+ "Content-Type: application/json",
+ "Accept: application/json",
+ })
+ ApiResponse testEchoBodyPetWithHttpInfo(Pet pet);
+
+
+}
diff --git a/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/api/PathApi.java b/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/api/PathApi.java
new file mode 100644
index 00000000000..94d6038547c
--- /dev/null
+++ b/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/api/PathApi.java
@@ -0,0 +1,46 @@
+package org.openapitools.client.api;
+
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.EncodingUtils;
+import org.openapitools.client.model.ApiResponse;
+
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import feign.*;
+
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
+public interface PathApi extends ApiClient.Api {
+
+
+ /**
+ * Test path parameter(s)
+ * Test path parameter(s)
+ * @param pathString (required)
+ * @param pathInteger (required)
+ * @return String
+ */
+ @RequestLine("GET /path/string/{pathString}/integer/{pathInteger}")
+ @Headers({
+ "Accept: text/plain",
+ })
+ String testsPathStringPathStringIntegerPathInteger(@Param("pathString") String pathString, @Param("pathInteger") Integer pathInteger);
+
+ /**
+ * Test path parameter(s)
+ * Similar to testsPathStringPathStringIntegerPathInteger but it also returns the http response headers .
+ * Test path parameter(s)
+ * @param pathString (required)
+ * @param pathInteger (required)
+ * @return A ApiResponse that wraps the response boyd and the http headers.
+ */
+ @RequestLine("GET /path/string/{pathString}/integer/{pathInteger}")
+ @Headers({
+ "Accept: text/plain",
+ })
+ ApiResponse testsPathStringPathStringIntegerPathIntegerWithHttpInfo(@Param("pathString") String pathString, @Param("pathInteger") Integer pathInteger);
+
+
+}
diff --git a/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/api/QueryApi.java b/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/api/QueryApi.java
new file mode 100644
index 00000000000..c4daf6833bb
--- /dev/null
+++ b/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/api/QueryApi.java
@@ -0,0 +1,266 @@
+package org.openapitools.client.api;
+
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.EncodingUtils;
+import org.openapitools.client.model.ApiResponse;
+
+import org.openapitools.client.model.Pet;
+import org.openapitools.client.model.TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import feign.*;
+
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
+public interface QueryApi extends ApiClient.Api {
+
+
+ /**
+ * Test query parameter(s)
+ * Test query parameter(s)
+ * @param integerQuery (optional)
+ * @param booleanQuery (optional)
+ * @param stringQuery (optional)
+ * @return String
+ */
+ @RequestLine("GET /query/integer/boolean/string?integer_query={integerQuery}&boolean_query={booleanQuery}&string_query={stringQuery}")
+ @Headers({
+ "Accept: text/plain",
+ })
+ String testQueryIntegerBooleanString(@Param("integerQuery") Integer integerQuery, @Param("booleanQuery") Boolean booleanQuery, @Param("stringQuery") String stringQuery);
+
+ /**
+ * Test query parameter(s)
+ * Similar to testQueryIntegerBooleanString but it also returns the http response headers .
+ * Test query parameter(s)
+ * @param integerQuery (optional)
+ * @param booleanQuery (optional)
+ * @param stringQuery (optional)
+ * @return A ApiResponse that wraps the response boyd and the http headers.
+ */
+ @RequestLine("GET /query/integer/boolean/string?integer_query={integerQuery}&boolean_query={booleanQuery}&string_query={stringQuery}")
+ @Headers({
+ "Accept: text/plain",
+ })
+ ApiResponse testQueryIntegerBooleanStringWithHttpInfo(@Param("integerQuery") Integer integerQuery, @Param("booleanQuery") Boolean booleanQuery, @Param("stringQuery") String stringQuery);
+
+
+ /**
+ * Test query parameter(s)
+ * Test query parameter(s)
+ * Note, this is equivalent to the other testQueryIntegerBooleanString method,
+ * but with the query parameters collected into a single Map parameter. This
+ * is convenient for services with optional query parameters, especially when
+ * used with the {@link TestQueryIntegerBooleanStringQueryParams} class that allows for
+ * building up this map in a fluent style.
+ * @param queryParams Map of query parameters as name-value pairs
+ *
The following elements may be specified in the query map:
+ *
+ *
integerQuery - (optional)
+ *
booleanQuery - (optional)
+ *
stringQuery - (optional)
+ *
+ * @return String
+ */
+ @RequestLine("GET /query/integer/boolean/string?integer_query={integerQuery}&boolean_query={booleanQuery}&string_query={stringQuery}")
+ @Headers({
+ "Accept: text/plain",
+ })
+ String testQueryIntegerBooleanString(@QueryMap(encoded=true) Map queryParams);
+
+ /**
+ * Test query parameter(s)
+ * Test query parameter(s)
+ * Note, this is equivalent to the other testQueryIntegerBooleanString that receives the query parameters as a map,
+ * but this one also exposes the Http response headers
+ * @param queryParams Map of query parameters as name-value pairs
+ *
The following elements may be specified in the query map:
+ *
+ *
integerQuery - (optional)
+ *
booleanQuery - (optional)
+ *
stringQuery - (optional)
+ *
+ * @return String
+ */
+ @RequestLine("GET /query/integer/boolean/string?integer_query={integerQuery}&boolean_query={booleanQuery}&string_query={stringQuery}")
+ @Headers({
+ "Accept: text/plain",
+ })
+ ApiResponse testQueryIntegerBooleanStringWithHttpInfo(@QueryMap(encoded=true) Map queryParams);
+
+
+ /**
+ * A convenience class for generating query parameters for the
+ * testQueryIntegerBooleanString method in a fluent style.
+ */
+ public static class TestQueryIntegerBooleanStringQueryParams extends HashMap {
+ public TestQueryIntegerBooleanStringQueryParams integerQuery(final Integer value) {
+ put("integer_query", EncodingUtils.encode(value));
+ return this;
+ }
+ public TestQueryIntegerBooleanStringQueryParams booleanQuery(final Boolean value) {
+ put("boolean_query", EncodingUtils.encode(value));
+ return this;
+ }
+ public TestQueryIntegerBooleanStringQueryParams stringQuery(final String value) {
+ put("string_query", EncodingUtils.encode(value));
+ return this;
+ }
+ }
+
+ /**
+ * Test query parameter(s)
+ * Test query parameter(s)
+ * @param queryObject (optional)
+ * @return String
+ */
+ @RequestLine("GET /query/style_form/explode_true/array_string?query_object={queryObject}")
+ @Headers({
+ "Accept: text/plain",
+ })
+ String testQueryStyleFormExplodeTrueArrayString(@Param("queryObject") TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter queryObject);
+
+ /**
+ * Test query parameter(s)
+ * Similar to testQueryStyleFormExplodeTrueArrayString but it also returns the http response headers .
+ * Test query parameter(s)
+ * @param queryObject (optional)
+ * @return A ApiResponse that wraps the response boyd and the http headers.
+ */
+ @RequestLine("GET /query/style_form/explode_true/array_string?query_object={queryObject}")
+ @Headers({
+ "Accept: text/plain",
+ })
+ ApiResponse testQueryStyleFormExplodeTrueArrayStringWithHttpInfo(@Param("queryObject") TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter queryObject);
+
+
+ /**
+ * Test query parameter(s)
+ * Test query parameter(s)
+ * Note, this is equivalent to the other testQueryStyleFormExplodeTrueArrayString method,
+ * but with the query parameters collected into a single Map parameter. This
+ * is convenient for services with optional query parameters, especially when
+ * used with the {@link TestQueryStyleFormExplodeTrueArrayStringQueryParams} class that allows for
+ * building up this map in a fluent style.
+ * @param queryParams Map of query parameters as name-value pairs
+ *
The following elements may be specified in the query map:
+ *
+ *
queryObject - (optional)
+ *
+ * @return String
+ */
+ @RequestLine("GET /query/style_form/explode_true/array_string?query_object={queryObject}")
+ @Headers({
+ "Accept: text/plain",
+ })
+ String testQueryStyleFormExplodeTrueArrayString(@QueryMap(encoded=true) Map queryParams);
+
+ /**
+ * Test query parameter(s)
+ * Test query parameter(s)
+ * Note, this is equivalent to the other testQueryStyleFormExplodeTrueArrayString that receives the query parameters as a map,
+ * but this one also exposes the Http response headers
+ * @param queryParams Map of query parameters as name-value pairs
+ *
The following elements may be specified in the query map:
+ *
+ *
queryObject - (optional)
+ *
+ * @return String
+ */
+ @RequestLine("GET /query/style_form/explode_true/array_string?query_object={queryObject}")
+ @Headers({
+ "Accept: text/plain",
+ })
+ ApiResponse testQueryStyleFormExplodeTrueArrayStringWithHttpInfo(@QueryMap(encoded=true) Map queryParams);
+
+
+ /**
+ * A convenience class for generating query parameters for the
+ * testQueryStyleFormExplodeTrueArrayString method in a fluent style.
+ */
+ public static class TestQueryStyleFormExplodeTrueArrayStringQueryParams extends HashMap {
+ public TestQueryStyleFormExplodeTrueArrayStringQueryParams queryObject(final TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter value) {
+ put("query_object", EncodingUtils.encode(value));
+ return this;
+ }
+ }
+
+ /**
+ * Test query parameter(s)
+ * Test query parameter(s)
+ * @param queryObject (optional)
+ * @return String
+ */
+ @RequestLine("GET /query/style_form/explode_true/object?query_object={queryObject}")
+ @Headers({
+ "Accept: text/plain",
+ })
+ String testQueryStyleFormExplodeTrueObject(@Param("queryObject") Pet queryObject);
+
+ /**
+ * Test query parameter(s)
+ * Similar to testQueryStyleFormExplodeTrueObject but it also returns the http response headers .
+ * Test query parameter(s)
+ * @param queryObject (optional)
+ * @return A ApiResponse that wraps the response boyd and the http headers.
+ */
+ @RequestLine("GET /query/style_form/explode_true/object?query_object={queryObject}")
+ @Headers({
+ "Accept: text/plain",
+ })
+ ApiResponse testQueryStyleFormExplodeTrueObjectWithHttpInfo(@Param("queryObject") Pet queryObject);
+
+
+ /**
+ * Test query parameter(s)
+ * Test query parameter(s)
+ * Note, this is equivalent to the other testQueryStyleFormExplodeTrueObject method,
+ * but with the query parameters collected into a single Map parameter. This
+ * is convenient for services with optional query parameters, especially when
+ * used with the {@link TestQueryStyleFormExplodeTrueObjectQueryParams} class that allows for
+ * building up this map in a fluent style.
+ * @param queryParams Map of query parameters as name-value pairs
+ *
The following elements may be specified in the query map:
+ *
+ *
queryObject - (optional)
+ *
+ * @return String
+ */
+ @RequestLine("GET /query/style_form/explode_true/object?query_object={queryObject}")
+ @Headers({
+ "Accept: text/plain",
+ })
+ String testQueryStyleFormExplodeTrueObject(@QueryMap(encoded=true) Map queryParams);
+
+ /**
+ * Test query parameter(s)
+ * Test query parameter(s)
+ * Note, this is equivalent to the other testQueryStyleFormExplodeTrueObject that receives the query parameters as a map,
+ * but this one also exposes the Http response headers
+ * @param queryParams Map of query parameters as name-value pairs
+ *
The following elements may be specified in the query map:
+ *
+ *
queryObject - (optional)
+ *
+ * @return String
+ */
+ @RequestLine("GET /query/style_form/explode_true/object?query_object={queryObject}")
+ @Headers({
+ "Accept: text/plain",
+ })
+ ApiResponse testQueryStyleFormExplodeTrueObjectWithHttpInfo(@QueryMap(encoded=true) Map queryParams);
+
+
+ /**
+ * A convenience class for generating query parameters for the
+ * testQueryStyleFormExplodeTrueObject method in a fluent style.
+ */
+ public static class TestQueryStyleFormExplodeTrueObjectQueryParams extends HashMap {
+ public TestQueryStyleFormExplodeTrueObjectQueryParams queryObject(final Pet value) {
+ put("query_object", EncodingUtils.encode(value));
+ return this;
+ }
+ }
+}
diff --git a/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java b/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java
new file mode 100644
index 00000000000..44511e4641c
--- /dev/null
+++ b/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java
@@ -0,0 +1,43 @@
+package org.openapitools.client.auth;
+
+import feign.RequestInterceptor;
+import feign.RequestTemplate;
+
+public class ApiKeyAuth implements RequestInterceptor {
+ private final String location;
+ private final String paramName;
+
+ private String apiKey;
+
+ public ApiKeyAuth(String location, String paramName) {
+ this.location = location;
+ this.paramName = paramName;
+ }
+
+ public String getLocation() {
+ return location;
+ }
+
+ public String getParamName() {
+ return paramName;
+ }
+
+ public String getApiKey() {
+ return apiKey;
+ }
+
+ public void setApiKey(String apiKey) {
+ this.apiKey = apiKey;
+ }
+
+ @Override
+ public void apply(RequestTemplate template) {
+ if ("query".equals(location)) {
+ template.query(paramName, apiKey);
+ } else if ("header".equals(location)) {
+ template.header(paramName, apiKey);
+ } else if ("cookie".equals(location)) {
+ template.header("Cookie", String.format("%s=%s", paramName, apiKey));
+ }
+ }
+}
diff --git a/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/auth/DefaultApi20Impl.java b/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/auth/DefaultApi20Impl.java
new file mode 100644
index 00000000000..80db21111f9
--- /dev/null
+++ b/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/auth/DefaultApi20Impl.java
@@ -0,0 +1,47 @@
+package org.openapitools.client.auth;
+
+import com.github.scribejava.core.builder.api.DefaultApi20;
+import com.github.scribejava.core.extractors.OAuth2AccessTokenJsonExtractor;
+import com.github.scribejava.core.extractors.TokenExtractor;
+import com.github.scribejava.core.model.OAuth2AccessToken;
+import com.github.scribejava.core.oauth2.bearersignature.BearerSignature;
+import com.github.scribejava.core.oauth2.bearersignature.BearerSignatureURIQueryParameter;
+import com.github.scribejava.core.oauth2.clientauthentication.ClientAuthentication;
+import com.github.scribejava.core.oauth2.clientauthentication.RequestBodyAuthenticationScheme;
+
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
+public class DefaultApi20Impl extends DefaultApi20 {
+
+ private final String accessTokenEndpoint;
+ private final String authorizationBaseUrl;
+
+ protected DefaultApi20Impl(String authorizationBaseUrl, String accessTokenEndpoint) {
+ this.authorizationBaseUrl = authorizationBaseUrl;
+ this.accessTokenEndpoint = accessTokenEndpoint;
+ }
+
+ @Override
+ public String getAccessTokenEndpoint() {
+ return accessTokenEndpoint;
+ }
+
+ @Override
+ protected String getAuthorizationBaseUrl() {
+ return authorizationBaseUrl;
+ }
+
+ @Override
+ public BearerSignature getBearerSignature() {
+ return BearerSignatureURIQueryParameter.instance();
+ }
+
+ @Override
+ public ClientAuthentication getClientAuthentication() {
+ return RequestBodyAuthenticationScheme.instance();
+ }
+
+ @Override
+ public TokenExtractor getAccessTokenExtractor() {
+ return OAuth2AccessTokenJsonExtractor.instance();
+ }
+}
\ No newline at end of file
diff --git a/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java
new file mode 100644
index 00000000000..9fc0358f10c
--- /dev/null
+++ b/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java
@@ -0,0 +1,41 @@
+package org.openapitools.client.auth;
+
+import feign.RequestInterceptor;
+import feign.RequestTemplate;
+import feign.auth.BasicAuthRequestInterceptor;
+
+/**
+ * An interceptor that adds the request header needed to use HTTP basic authentication.
+ */
+public class HttpBasicAuth implements RequestInterceptor {
+
+ private String username;
+ private String password;
+
+ public String getUsername() {
+ return username;
+ }
+
+ public void setUsername(String username) {
+ this.username = username;
+ }
+
+ public String getPassword() {
+ return password;
+ }
+
+ public void setPassword(String password) {
+ this.password = password;
+ }
+
+ public void setCredentials(String username, String password) {
+ this.username = username;
+ this.password = password;
+ }
+
+ @Override
+ public void apply(RequestTemplate template) {
+ RequestInterceptor requestInterceptor = new BasicAuthRequestInterceptor(username, password);
+ requestInterceptor.apply(template);
+ }
+}
diff --git a/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java b/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java
new file mode 100644
index 00000000000..d4c9cbe6361
--- /dev/null
+++ b/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java
@@ -0,0 +1,43 @@
+package org.openapitools.client.auth;
+
+import feign.RequestInterceptor;
+import feign.RequestTemplate;
+
+/**
+ * An interceptor that adds the request header needed to use HTTP bearer authentication.
+ */
+public class HttpBearerAuth implements RequestInterceptor {
+ private final String scheme;
+ private String bearerToken;
+
+ public HttpBearerAuth(String scheme) {
+ this.scheme = scheme;
+ }
+
+ /**
+ * Gets the token, which together with the scheme, will be sent as the value of the Authorization header.
+ */
+ public String getBearerToken() {
+ return bearerToken;
+ }
+
+ /**
+ * Sets the token, which together with the scheme, will be sent as the value of the Authorization header.
+ */
+ public void setBearerToken(String bearerToken) {
+ this.bearerToken = bearerToken;
+ }
+
+ @Override
+ public void apply(RequestTemplate template) {
+ if(bearerToken == null) {
+ return;
+ }
+
+ template.header("Authorization", (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken);
+ }
+
+ private static String upperCaseBearer(String scheme) {
+ return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme;
+ }
+}
diff --git a/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/ApiResponse.java b/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/ApiResponse.java
new file mode 100644
index 00000000000..a0d44e724c5
--- /dev/null
+++ b/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/ApiResponse.java
@@ -0,0 +1,43 @@
+package org.openapitools.client.model;
+
+import java.util.Map;
+import java.util.List;
+
+public class ApiResponse{
+
+ final private int statusCode;
+ final private Map> headers;
+ final private T data;
+
+ /**
+ * @param statusCode The status code of HTTP response
+ * @param headers The headers of HTTP response
+ */
+ public ApiResponse(int statusCode, Map> headers) {
+ this(statusCode, headers, null);
+ }
+
+ /**
+ * @param statusCode The status code of HTTP response
+ * @param headers The headers of HTTP response
+ * @param data The object deserialized from response bod
+ */
+ public ApiResponse(int statusCode, Map> headers, T data) {
+ this.statusCode = statusCode;
+ this.headers = headers;
+ this.data = data;
+ }
+
+ public int getStatusCode() {
+ return statusCode;
+ }
+
+ public Map> getHeaders() {
+ return headers;
+ }
+
+ public T getData() {
+ return data;
+ }
+
+}
\ No newline at end of file
diff --git a/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/Category.java b/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/Category.java
new file mode 100644
index 00000000000..236c8190bb8
--- /dev/null
+++ b/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/Category.java
@@ -0,0 +1,125 @@
+/*
+ * Echo Server API
+ * Echo Server API
+ *
+ * The version of the OpenAPI document: 0.1.0
+ * Contact: team@openapitools.org
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+package org.openapitools.client.model;
+
+import java.util.Objects;
+import java.util.Arrays;
+import com.google.gson.TypeAdapter;
+import com.google.gson.annotations.JsonAdapter;
+import com.google.gson.annotations.SerializedName;
+import com.google.gson.stream.JsonReader;
+import com.google.gson.stream.JsonWriter;
+import java.io.IOException;
+
+/**
+ * Category
+ */
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
+public class Category {
+ public static final String SERIALIZED_NAME_ID = "id";
+ @SerializedName(SERIALIZED_NAME_ID)
+ private Long id;
+
+ public static final String SERIALIZED_NAME_NAME = "name";
+ @SerializedName(SERIALIZED_NAME_NAME)
+ private String name;
+
+ public Category() {
+ }
+
+ public Category id(Long id) {
+
+ this.id = id;
+ return this;
+ }
+
+ /**
+ * Get id
+ * @return id
+ **/
+ @javax.annotation.Nullable
+
+ public Long getId() {
+ return id;
+ }
+
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+
+ public Category name(String name) {
+
+ this.name = name;
+ return this;
+ }
+
+ /**
+ * Get name
+ * @return name
+ **/
+ @javax.annotation.Nullable
+
+ public String getName() {
+ return name;
+ }
+
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ Category category = (Category) o;
+ return Objects.equals(this.id, category.id) &&
+ Objects.equals(this.name, category.name);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(id, name);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class Category {\n");
+ sb.append(" id: ").append(toIndentedString(id)).append("\n");
+ sb.append(" name: ").append(toIndentedString(name)).append("\n");
+ sb.append("}");
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces
+ * (except the first line).
+ */
+ private String toIndentedString(Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+
+}
+
diff --git a/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/Pet.java
new file mode 100644
index 00000000000..0f511d550b7
--- /dev/null
+++ b/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/Pet.java
@@ -0,0 +1,303 @@
+/*
+ * Echo Server API
+ * Echo Server API
+ *
+ * The version of the OpenAPI document: 0.1.0
+ * Contact: team@openapitools.org
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+package org.openapitools.client.model;
+
+import java.util.Objects;
+import java.util.Arrays;
+import com.google.gson.TypeAdapter;
+import com.google.gson.annotations.JsonAdapter;
+import com.google.gson.annotations.SerializedName;
+import com.google.gson.stream.JsonReader;
+import com.google.gson.stream.JsonWriter;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import org.openapitools.client.model.Category;
+import org.openapitools.client.model.Tag;
+
+/**
+ * Pet
+ */
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
+public class Pet {
+ public static final String SERIALIZED_NAME_ID = "id";
+ @SerializedName(SERIALIZED_NAME_ID)
+ private Long id;
+
+ public static final String SERIALIZED_NAME_NAME = "name";
+ @SerializedName(SERIALIZED_NAME_NAME)
+ private String name;
+
+ public static final String SERIALIZED_NAME_CATEGORY = "category";
+ @SerializedName(SERIALIZED_NAME_CATEGORY)
+ private Category category;
+
+ public static final String SERIALIZED_NAME_PHOTO_URLS = "photoUrls";
+ @SerializedName(SERIALIZED_NAME_PHOTO_URLS)
+ private List photoUrls = new ArrayList<>();
+
+ public static final String SERIALIZED_NAME_TAGS = "tags";
+ @SerializedName(SERIALIZED_NAME_TAGS)
+ private List tags = null;
+
+ /**
+ * pet status in the store
+ */
+ @JsonAdapter(StatusEnum.Adapter.class)
+ public enum StatusEnum {
+ AVAILABLE("available"),
+
+ PENDING("pending"),
+
+ SOLD("sold");
+
+ private String value;
+
+ StatusEnum(String value) {
+ this.value = value;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ @Override
+ public String toString() {
+ return String.valueOf(value);
+ }
+
+ public static StatusEnum fromValue(String value) {
+ for (StatusEnum b : StatusEnum.values()) {
+ if (b.value.equals(value)) {
+ return b;
+ }
+ }
+ throw new IllegalArgumentException("Unexpected value '" + value + "'");
+ }
+
+ public static class Adapter extends TypeAdapter {
+ @Override
+ public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException {
+ jsonWriter.value(enumeration.getValue());
+ }
+
+ @Override
+ public StatusEnum read(final JsonReader jsonReader) throws IOException {
+ String value = jsonReader.nextString();
+ return StatusEnum.fromValue(value);
+ }
+ }
+ }
+
+ public static final String SERIALIZED_NAME_STATUS = "status";
+ @SerializedName(SERIALIZED_NAME_STATUS)
+ private StatusEnum status;
+
+ public Pet() {
+ }
+
+ public Pet id(Long id) {
+
+ this.id = id;
+ return this;
+ }
+
+ /**
+ * Get id
+ * @return id
+ **/
+ @javax.annotation.Nullable
+
+ public Long getId() {
+ return id;
+ }
+
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+
+ public Pet name(String name) {
+
+ this.name = name;
+ return this;
+ }
+
+ /**
+ * Get name
+ * @return name
+ **/
+ @javax.annotation.Nonnull
+
+ public String getName() {
+ return name;
+ }
+
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+
+ public Pet category(Category category) {
+
+ this.category = category;
+ return this;
+ }
+
+ /**
+ * Get category
+ * @return category
+ **/
+ @javax.annotation.Nullable
+
+ public Category getCategory() {
+ return category;
+ }
+
+
+ public void setCategory(Category category) {
+ this.category = category;
+ }
+
+
+ public Pet photoUrls(List photoUrls) {
+
+ this.photoUrls = photoUrls;
+ return this;
+ }
+
+ public Pet addPhotoUrlsItem(String photoUrlsItem) {
+ this.photoUrls.add(photoUrlsItem);
+ return this;
+ }
+
+ /**
+ * Get photoUrls
+ * @return photoUrls
+ **/
+ @javax.annotation.Nonnull
+
+ public List getPhotoUrls() {
+ return photoUrls;
+ }
+
+
+ public void setPhotoUrls(List photoUrls) {
+ this.photoUrls = photoUrls;
+ }
+
+
+ public Pet tags(List tags) {
+
+ this.tags = tags;
+ return this;
+ }
+
+ public Pet addTagsItem(Tag tagsItem) {
+ if (this.tags == null) {
+ this.tags = new ArrayList<>();
+ }
+ this.tags.add(tagsItem);
+ return this;
+ }
+
+ /**
+ * Get tags
+ * @return tags
+ **/
+ @javax.annotation.Nullable
+
+ public List getTags() {
+ return tags;
+ }
+
+
+ public void setTags(List tags) {
+ this.tags = tags;
+ }
+
+
+ public Pet status(StatusEnum status) {
+
+ this.status = status;
+ return this;
+ }
+
+ /**
+ * pet status in the store
+ * @return status
+ **/
+ @javax.annotation.Nullable
+
+ public StatusEnum getStatus() {
+ return status;
+ }
+
+
+ public void setStatus(StatusEnum status) {
+ this.status = status;
+ }
+
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ Pet pet = (Pet) o;
+ return Objects.equals(this.id, pet.id) &&
+ Objects.equals(this.name, pet.name) &&
+ Objects.equals(this.category, pet.category) &&
+ Objects.equals(this.photoUrls, pet.photoUrls) &&
+ Objects.equals(this.tags, pet.tags) &&
+ Objects.equals(this.status, pet.status);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(id, name, category, photoUrls, tags, status);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class Pet {\n");
+ sb.append(" id: ").append(toIndentedString(id)).append("\n");
+ sb.append(" name: ").append(toIndentedString(name)).append("\n");
+ sb.append(" category: ").append(toIndentedString(category)).append("\n");
+ sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n");
+ sb.append(" tags: ").append(toIndentedString(tags)).append("\n");
+ sb.append(" status: ").append(toIndentedString(status)).append("\n");
+ sb.append("}");
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces
+ * (except the first line).
+ */
+ private String toIndentedString(Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+
+}
+
diff --git a/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/Tag.java
new file mode 100644
index 00000000000..7bfaa5ea05c
--- /dev/null
+++ b/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/Tag.java
@@ -0,0 +1,125 @@
+/*
+ * Echo Server API
+ * Echo Server API
+ *
+ * The version of the OpenAPI document: 0.1.0
+ * Contact: team@openapitools.org
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+package org.openapitools.client.model;
+
+import java.util.Objects;
+import java.util.Arrays;
+import com.google.gson.TypeAdapter;
+import com.google.gson.annotations.JsonAdapter;
+import com.google.gson.annotations.SerializedName;
+import com.google.gson.stream.JsonReader;
+import com.google.gson.stream.JsonWriter;
+import java.io.IOException;
+
+/**
+ * Tag
+ */
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
+public class Tag {
+ public static final String SERIALIZED_NAME_ID = "id";
+ @SerializedName(SERIALIZED_NAME_ID)
+ private Long id;
+
+ public static final String SERIALIZED_NAME_NAME = "name";
+ @SerializedName(SERIALIZED_NAME_NAME)
+ private String name;
+
+ public Tag() {
+ }
+
+ public Tag id(Long id) {
+
+ this.id = id;
+ return this;
+ }
+
+ /**
+ * Get id
+ * @return id
+ **/
+ @javax.annotation.Nullable
+
+ public Long getId() {
+ return id;
+ }
+
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+
+ public Tag name(String name) {
+
+ this.name = name;
+ return this;
+ }
+
+ /**
+ * Get name
+ * @return name
+ **/
+ @javax.annotation.Nullable
+
+ public String getName() {
+ return name;
+ }
+
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ Tag tag = (Tag) o;
+ return Objects.equals(this.id, tag.id) &&
+ Objects.equals(this.name, tag.name);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(id, name);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class Tag {\n");
+ sb.append(" id: ").append(toIndentedString(id)).append("\n");
+ sb.append(" name: ").append(toIndentedString(name)).append("\n");
+ sb.append("}");
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces
+ * (except the first line).
+ */
+ private String toIndentedString(Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+
+}
+
diff --git a/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.java b/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.java
new file mode 100644
index 00000000000..433e40e1376
--- /dev/null
+++ b/samples/client/echo_api/java/feign-gson/src/main/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.java
@@ -0,0 +1,107 @@
+/*
+ * Echo Server API
+ * Echo Server API
+ *
+ * The version of the OpenAPI document: 0.1.0
+ * Contact: team@openapitools.org
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+package org.openapitools.client.model;
+
+import java.util.Objects;
+import java.util.Arrays;
+import com.google.gson.TypeAdapter;
+import com.google.gson.annotations.JsonAdapter;
+import com.google.gson.annotations.SerializedName;
+import com.google.gson.stream.JsonReader;
+import com.google.gson.stream.JsonWriter;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter
+ */
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
+public class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter {
+ public static final String SERIALIZED_NAME_VALUES = "values";
+ @SerializedName(SERIALIZED_NAME_VALUES)
+ private List values = null;
+
+ public TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter() {
+ }
+
+ public TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter values(List values) {
+
+ this.values = values;
+ return this;
+ }
+
+ public TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter addValuesItem(String valuesItem) {
+ if (this.values == null) {
+ this.values = new ArrayList<>();
+ }
+ this.values.add(valuesItem);
+ return this;
+ }
+
+ /**
+ * Get values
+ * @return values
+ **/
+ @javax.annotation.Nullable
+
+ public List getValues() {
+ return values;
+ }
+
+
+ public void setValues(List values) {
+ this.values = values;
+ }
+
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter testQueryStyleFormExplodeTrueArrayStringQueryObjectParameter = (TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter) o;
+ return Objects.equals(this.values, testQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.values);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(values);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter {\n");
+ sb.append(" values: ").append(toIndentedString(values)).append("\n");
+ sb.append("}");
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces
+ * (except the first line).
+ */
+ private String toIndentedString(Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+
+}
+
diff --git a/samples/client/echo_api/java/feign-gson/src/test/java/org/openapitools/client/api/BodyApiTest.java b/samples/client/echo_api/java/feign-gson/src/test/java/org/openapitools/client/api/BodyApiTest.java
new file mode 100644
index 00000000000..24c71b36076
--- /dev/null
+++ b/samples/client/echo_api/java/feign-gson/src/test/java/org/openapitools/client/api/BodyApiTest.java
@@ -0,0 +1,42 @@
+package org.openapitools.client.api;
+
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.model.Pet;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.BeforeEach;
+
+import java.time.LocalDate;
+import java.time.OffsetDateTime;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * API tests for BodyApi
+ */
+class BodyApiTest {
+
+ private BodyApi api;
+
+ @BeforeEach
+ public void setup() {
+ api = new ApiClient().buildClient(BodyApi.class);
+ }
+
+
+ /**
+ * Test body parameter(s)
+ *
+ * Test body parameter(s)
+ */
+ @Test
+ void testEchoBodyPetTest() {
+ Pet pet = null;
+ // Pet response = api.testEchoBodyPet(pet);
+
+ // TODO: test validations
+ }
+
+
+}
diff --git a/samples/client/echo_api/java/feign-gson/src/test/java/org/openapitools/client/api/PathApiTest.java b/samples/client/echo_api/java/feign-gson/src/test/java/org/openapitools/client/api/PathApiTest.java
new file mode 100644
index 00000000000..8f39b053aa4
--- /dev/null
+++ b/samples/client/echo_api/java/feign-gson/src/test/java/org/openapitools/client/api/PathApiTest.java
@@ -0,0 +1,42 @@
+package org.openapitools.client.api;
+
+import org.openapitools.client.ApiClient;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.BeforeEach;
+
+import java.time.LocalDate;
+import java.time.OffsetDateTime;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * API tests for PathApi
+ */
+class PathApiTest {
+
+ private PathApi api;
+
+ @BeforeEach
+ public void setup() {
+ api = new ApiClient().buildClient(PathApi.class);
+ }
+
+
+ /**
+ * Test path parameter(s)
+ *
+ * Test path parameter(s)
+ */
+ @Test
+ void testsPathStringPathStringIntegerPathIntegerTest() {
+ String pathString = null;
+ Integer pathInteger = null;
+ // String response = api.testsPathStringPathStringIntegerPathInteger(pathString, pathInteger);
+
+ // TODO: test validations
+ }
+
+
+}
diff --git a/samples/client/echo_api/java/feign-gson/src/test/java/org/openapitools/client/api/QueryApiTest.java b/samples/client/echo_api/java/feign-gson/src/test/java/org/openapitools/client/api/QueryApiTest.java
new file mode 100644
index 00000000000..b55588a0406
--- /dev/null
+++ b/samples/client/echo_api/java/feign-gson/src/test/java/org/openapitools/client/api/QueryApiTest.java
@@ -0,0 +1,123 @@
+package org.openapitools.client.api;
+
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.model.Pet;
+import org.openapitools.client.model.TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.BeforeEach;
+
+import java.time.LocalDate;
+import java.time.OffsetDateTime;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * API tests for QueryApi
+ */
+class QueryApiTest {
+
+ private QueryApi api;
+
+ @BeforeEach
+ public void setup() {
+ api = new ApiClient().buildClient(QueryApi.class);
+ }
+
+
+ /**
+ * Test query parameter(s)
+ *
+ * Test query parameter(s)
+ */
+ @Test
+ void testQueryIntegerBooleanStringTest() {
+ Integer integerQuery = null;
+ Boolean booleanQuery = null;
+ String stringQuery = null;
+ // String response = api.testQueryIntegerBooleanString(integerQuery, booleanQuery, stringQuery);
+
+ // TODO: test validations
+ }
+
+ /**
+ * Test query parameter(s)
+ *
+ * Test query parameter(s)
+ *
+ * This tests the overload of the method that uses a Map for query parameters instead of
+ * listing them out individually.
+ */
+ @Test
+ void testQueryIntegerBooleanStringTestQueryMap() {
+ QueryApi.TestQueryIntegerBooleanStringQueryParams queryParams = new QueryApi.TestQueryIntegerBooleanStringQueryParams()
+ .integerQuery(null)
+ .booleanQuery(null)
+ .stringQuery(null);
+ // String response = api.testQueryIntegerBooleanString(queryParams);
+
+ // TODO: test validations
+ }
+
+ /**
+ * Test query parameter(s)
+ *
+ * Test query parameter(s)
+ */
+ @Test
+ void testQueryStyleFormExplodeTrueArrayStringTest() {
+ TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter queryObject = null;
+ // String response = api.testQueryStyleFormExplodeTrueArrayString(queryObject);
+
+ // TODO: test validations
+ }
+
+ /**
+ * Test query parameter(s)
+ *
+ * Test query parameter(s)
+ *
+ * This tests the overload of the method that uses a Map for query parameters instead of
+ * listing them out individually.
+ */
+ @Test
+ void testQueryStyleFormExplodeTrueArrayStringTestQueryMap() {
+ QueryApi.TestQueryStyleFormExplodeTrueArrayStringQueryParams queryParams = new QueryApi.TestQueryStyleFormExplodeTrueArrayStringQueryParams()
+ .queryObject(null);
+ // String response = api.testQueryStyleFormExplodeTrueArrayString(queryParams);
+
+ // TODO: test validations
+ }
+
+ /**
+ * Test query parameter(s)
+ *
+ * Test query parameter(s)
+ */
+ @Test
+ void testQueryStyleFormExplodeTrueObjectTest() {
+ Pet queryObject = null;
+ // String response = api.testQueryStyleFormExplodeTrueObject(queryObject);
+
+ // TODO: test validations
+ }
+
+ /**
+ * Test query parameter(s)
+ *
+ * Test query parameter(s)
+ *
+ * This tests the overload of the method that uses a Map for query parameters instead of
+ * listing them out individually.
+ */
+ @Test
+ void testQueryStyleFormExplodeTrueObjectTestQueryMap() {
+ QueryApi.TestQueryStyleFormExplodeTrueObjectQueryParams queryParams = new QueryApi.TestQueryStyleFormExplodeTrueObjectQueryParams()
+ .queryObject(null);
+ // String response = api.testQueryStyleFormExplodeTrueObject(queryParams);
+
+ // TODO: test validations
+ }
+
+}
diff --git a/samples/client/echo_api/java/feign-gson/src/test/java/org/openapitools/client/model/CategoryTest.java b/samples/client/echo_api/java/feign-gson/src/test/java/org/openapitools/client/model/CategoryTest.java
new file mode 100644
index 00000000000..ab5409ab270
--- /dev/null
+++ b/samples/client/echo_api/java/feign-gson/src/test/java/org/openapitools/client/model/CategoryTest.java
@@ -0,0 +1,55 @@
+/*
+ * Echo Server API
+ * Echo Server API
+ *
+ * The version of the OpenAPI document: 0.1.0
+ * Contact: team@openapitools.org
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+package org.openapitools.client.model;
+
+import com.google.gson.TypeAdapter;
+import com.google.gson.annotations.JsonAdapter;
+import com.google.gson.annotations.SerializedName;
+import com.google.gson.stream.JsonReader;
+import com.google.gson.stream.JsonWriter;
+import java.io.IOException;
+import org.junit.jupiter.api.Test;
+
+
+/**
+ * Model tests for Category
+ */
+class CategoryTest {
+ private final Category model = new Category();
+
+ /**
+ * Model tests for Category
+ */
+ @Test
+ void testCategory() {
+ // TODO: test Category
+ }
+
+ /**
+ * Test the property 'id'
+ */
+ @Test
+ void idTest() {
+ // TODO: test id
+ }
+
+ /**
+ * Test the property 'name'
+ */
+ @Test
+ void nameTest() {
+ // TODO: test name
+ }
+
+}
diff --git a/samples/client/echo_api/java/feign-gson/src/test/java/org/openapitools/client/model/PetTest.java b/samples/client/echo_api/java/feign-gson/src/test/java/org/openapitools/client/model/PetTest.java
new file mode 100644
index 00000000000..886e8dee6c0
--- /dev/null
+++ b/samples/client/echo_api/java/feign-gson/src/test/java/org/openapitools/client/model/PetTest.java
@@ -0,0 +1,91 @@
+/*
+ * Echo Server API
+ * Echo Server API
+ *
+ * The version of the OpenAPI document: 0.1.0
+ * Contact: team@openapitools.org
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+package org.openapitools.client.model;
+
+import com.google.gson.TypeAdapter;
+import com.google.gson.annotations.JsonAdapter;
+import com.google.gson.annotations.SerializedName;
+import com.google.gson.stream.JsonReader;
+import com.google.gson.stream.JsonWriter;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import org.openapitools.client.model.Category;
+import org.openapitools.client.model.Tag;
+import org.junit.jupiter.api.Test;
+
+
+/**
+ * Model tests for Pet
+ */
+class PetTest {
+ private final Pet model = new Pet();
+
+ /**
+ * Model tests for Pet
+ */
+ @Test
+ void testPet() {
+ // TODO: test Pet
+ }
+
+ /**
+ * Test the property 'id'
+ */
+ @Test
+ void idTest() {
+ // TODO: test id
+ }
+
+ /**
+ * Test the property 'name'
+ */
+ @Test
+ void nameTest() {
+ // TODO: test name
+ }
+
+ /**
+ * Test the property 'category'
+ */
+ @Test
+ void categoryTest() {
+ // TODO: test category
+ }
+
+ /**
+ * Test the property 'photoUrls'
+ */
+ @Test
+ void photoUrlsTest() {
+ // TODO: test photoUrls
+ }
+
+ /**
+ * Test the property 'tags'
+ */
+ @Test
+ void tagsTest() {
+ // TODO: test tags
+ }
+
+ /**
+ * Test the property 'status'
+ */
+ @Test
+ void statusTest() {
+ // TODO: test status
+ }
+
+}
diff --git a/samples/client/echo_api/java/feign-gson/src/test/java/org/openapitools/client/model/TagTest.java b/samples/client/echo_api/java/feign-gson/src/test/java/org/openapitools/client/model/TagTest.java
new file mode 100644
index 00000000000..033deaceb70
--- /dev/null
+++ b/samples/client/echo_api/java/feign-gson/src/test/java/org/openapitools/client/model/TagTest.java
@@ -0,0 +1,55 @@
+/*
+ * Echo Server API
+ * Echo Server API
+ *
+ * The version of the OpenAPI document: 0.1.0
+ * Contact: team@openapitools.org
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+package org.openapitools.client.model;
+
+import com.google.gson.TypeAdapter;
+import com.google.gson.annotations.JsonAdapter;
+import com.google.gson.annotations.SerializedName;
+import com.google.gson.stream.JsonReader;
+import com.google.gson.stream.JsonWriter;
+import java.io.IOException;
+import org.junit.jupiter.api.Test;
+
+
+/**
+ * Model tests for Tag
+ */
+class TagTest {
+ private final Tag model = new Tag();
+
+ /**
+ * Model tests for Tag
+ */
+ @Test
+ void testTag() {
+ // TODO: test Tag
+ }
+
+ /**
+ * Test the property 'id'
+ */
+ @Test
+ void idTest() {
+ // TODO: test id
+ }
+
+ /**
+ * Test the property 'name'
+ */
+ @Test
+ void nameTest() {
+ // TODO: test name
+ }
+
+}
diff --git a/samples/client/echo_api/java/feign-gson/src/test/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterTest.java b/samples/client/echo_api/java/feign-gson/src/test/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterTest.java
new file mode 100644
index 00000000000..3633d8e2cef
--- /dev/null
+++ b/samples/client/echo_api/java/feign-gson/src/test/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterTest.java
@@ -0,0 +1,49 @@
+/*
+ * Echo Server API
+ * Echo Server API
+ *
+ * The version of the OpenAPI document: 0.1.0
+ * Contact: team@openapitools.org
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+package org.openapitools.client.model;
+
+import com.google.gson.TypeAdapter;
+import com.google.gson.annotations.JsonAdapter;
+import com.google.gson.annotations.SerializedName;
+import com.google.gson.stream.JsonReader;
+import com.google.gson.stream.JsonWriter;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import org.junit.jupiter.api.Test;
+
+
+/**
+ * Model tests for TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter
+ */
+class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterTest {
+ private final TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter model = new TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter();
+
+ /**
+ * Model tests for TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter
+ */
+ @Test
+ void testTestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter() {
+ // TODO: test TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter
+ }
+
+ /**
+ * Test the property 'values'
+ */
+ @Test
+ void valuesTest() {
+ // TODO: test values
+ }
+
+}
diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/ApiClient.java
index 89305984908..41b1d1e5cf8 100644
--- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/ApiClient.java
+++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/ApiClient.java
@@ -6,7 +6,6 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import feign.okhttp.OkHttpClient;
-
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
@@ -43,8 +42,8 @@ public class ApiClient {
private Feign.Builder feignBuilder;
public ApiClient() {
- objectMapper = createObjectMapper();
apiAuthorizations = new LinkedHashMap();
+ objectMapper = createObjectMapper();
feignBuilder = Feign.builder()
.client(new OkHttpClient())
.encoder(new FormEncoder(new JacksonEncoder(objectMapper)))
@@ -141,6 +140,7 @@ public class ApiClient {
}
}
+
public ObjectMapper getObjectMapper(){
return objectMapper;
}
diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/ApiClient.java
index b7116f494f2..0923b7f67d5 100644
--- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/ApiClient.java
+++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/ApiClient.java
@@ -6,7 +6,6 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import feign.okhttp.OkHttpClient;
-
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
@@ -44,8 +43,8 @@ public class ApiClient {
private Feign.Builder feignBuilder;
public ApiClient() {
- objectMapper = createObjectMapper();
apiAuthorizations = new LinkedHashMap();
+ objectMapper = createObjectMapper();
feignBuilder = Feign.builder()
.client(new OkHttpClient())
.encoder(new FormEncoder(new JacksonEncoder(objectMapper)))
@@ -148,6 +147,7 @@ public class ApiClient {
}
}
+
public ObjectMapper getObjectMapper(){
return objectMapper;
}