> getAsyncResponseInterceptor() {
+ return asyncResponseInterceptor;
+ }
+
+ /**
+ * Set the read timeout for the http client.
+ *
+ * This is the value used by default for each request, though it can be
+ * overridden on a per-request basis with a request interceptor.
+ *
+ * @param readTimeout The read timeout used by default by the http client.
+ * Setting this value to null resets the timeout to an
+ * effectively infinite value.
+ * @return This object.
+ */
+ public ApiClient setReadTimeout(Duration readTimeout) {
+ this.readTimeout = readTimeout;
+ return this;
+ }
+
+ /**
+ * Get the read timeout that was set.
+ *
+ * @return The read timeout, or null if no timeout was set. Null represents
+ * an infinite wait time.
+ */
+ public Duration getReadTimeout() {
+ return readTimeout;
+ }
+ /**
+ * Sets the connect timeout (in milliseconds) for the http client.
+ *
+ * In the case where a new connection needs to be established, if
+ * the connection cannot be established within the given {@code
+ * duration}, then {@link HttpClient#send(HttpRequest,BodyHandler)
+ * HttpClient::send} throws an {@link HttpConnectTimeoutException}, or
+ * {@link HttpClient#sendAsync(HttpRequest,BodyHandler)
+ * HttpClient::sendAsync} completes exceptionally with an
+ * {@code HttpConnectTimeoutException}. If a new connection does not
+ * need to be established, for example if a connection can be reused
+ * from a previous request, then this timeout duration has no effect.
+ *
+ * @param connectTimeout connection timeout in milliseconds
+ *
+ * @return This object.
+ */
+ public ApiClient setConnectTimeout(Duration connectTimeout) {
+ this.connectTimeout = connectTimeout;
+ this.builder.connectTimeout(connectTimeout);
+ return this;
+ }
+
+ /**
+ * Get connection timeout (in milliseconds).
+ *
+ * @return Timeout in milliseconds
+ */
+ public Duration getConnectTimeout() {
+ return connectTimeout;
+ }
+
+ /**
+ * Returns the response body InputStream, transparently decoding gzip-compressed
+ * payloads when the server sets {@code Content-Encoding: gzip}.
+ *
+ * @param response HTTP response whose body should be consumed
+ * @return Original or decompressed InputStream for the response body
+ * @throws IOException if the response body cannot be accessed or wrapping fails
+ */
+ public static InputStream getResponseBody(HttpResponse response) throws IOException {
+ if (response == null) {
+ return null;
+ }
+ InputStream body = response.body();
+ if (body == null) {
+ return null;
+ }
+ Optional encoding = response.headers().firstValue("Content-Encoding");
+ if (encoding.isPresent()) {
+ for (String token : encoding.get().split(",")) {
+ if ("gzip".equalsIgnoreCase(token.trim())) {
+ return new GZIPInputStream(body);
+ }
+ }
+ }
+ return body;
+ }
+
+}
diff --git a/samples/client/petstore/java/native-useGzipFeature/src/main/java/org/openapitools/client/ApiException.java b/samples/client/petstore/java/native-useGzipFeature/src/main/java/org/openapitools/client/ApiException.java
new file mode 100644
index 000000000000..64cd92883331
--- /dev/null
+++ b/samples/client/petstore/java/native-useGzipFeature/src/main/java/org/openapitools/client/ApiException.java
@@ -0,0 +1,92 @@
+/*
+ * OpenAPI Petstore
+ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ *
+ * 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.net.http.HttpHeaders;
+
+@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.18.0-SNAPSHOT")
+public class ApiException extends Exception {
+ private static final long serialVersionUID = 1L;
+
+ private int code = 0;
+ private HttpHeaders responseHeaders = null;
+ private String responseBody = null;
+
+ public ApiException() {}
+
+ public ApiException(Throwable throwable) {
+ super(throwable);
+ }
+
+ public ApiException(String message) {
+ super(message);
+ }
+
+ public ApiException(String message, Throwable throwable, int code, HttpHeaders responseHeaders, String responseBody) {
+ super(message, throwable);
+ this.code = code;
+ this.responseHeaders = responseHeaders;
+ this.responseBody = responseBody;
+ }
+
+ public ApiException(String message, int code, HttpHeaders responseHeaders, String responseBody) {
+ this(message, (Throwable) null, code, responseHeaders, responseBody);
+ }
+
+ public ApiException(String message, Throwable throwable, int code, HttpHeaders responseHeaders) {
+ this(message, throwable, code, responseHeaders, null);
+ }
+
+ public ApiException(int code, HttpHeaders responseHeaders, String responseBody) {
+ this((String) null, (Throwable) null, code, responseHeaders, responseBody);
+ }
+
+ public ApiException(int code, String message) {
+ super(message);
+ this.code = code;
+ }
+
+ public ApiException(int code, String message, HttpHeaders responseHeaders, String responseBody) {
+ this(code, message);
+ this.responseHeaders = responseHeaders;
+ this.responseBody = responseBody;
+ }
+
+ /**
+ * Get the HTTP status code.
+ *
+ * @return HTTP status code
+ */
+ public int getCode() {
+ return code;
+ }
+
+ /**
+ * Get the HTTP response headers.
+ *
+ * @return Headers as an HttpHeaders object
+ */
+ public HttpHeaders getResponseHeaders() {
+ return responseHeaders;
+ }
+
+ /**
+ * Get the HTTP response body.
+ *
+ * @return Response body in the form of string
+ */
+ public String getResponseBody() {
+ return responseBody;
+ }
+}
diff --git a/samples/client/petstore/java/native-useGzipFeature/src/main/java/org/openapitools/client/ApiResponse.java b/samples/client/petstore/java/native-useGzipFeature/src/main/java/org/openapitools/client/ApiResponse.java
new file mode 100644
index 000000000000..ab4019d72b50
--- /dev/null
+++ b/samples/client/petstore/java/native-useGzipFeature/src/main/java/org/openapitools/client/ApiResponse.java
@@ -0,0 +1,60 @@
+/*
+ * OpenAPI Petstore
+ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ *
+ * 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.List;
+import java.util.Map;
+
+/**
+ * API response returned by API call.
+ *
+ * @param The type of data that is deserialized from response body
+ */
+@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.18.0-SNAPSHOT")
+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;
+ }
+}
diff --git a/samples/client/petstore/java/native-useGzipFeature/src/main/java/org/openapitools/client/Configuration.java b/samples/client/petstore/java/native-useGzipFeature/src/main/java/org/openapitools/client/Configuration.java
new file mode 100644
index 000000000000..0518a3620619
--- /dev/null
+++ b/samples/client/petstore/java/native-useGzipFeature/src/main/java/org/openapitools/client/Configuration.java
@@ -0,0 +1,63 @@
+/*
+ * OpenAPI Petstore
+ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ *
+ * 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.Objects;
+import java.util.concurrent.atomic.AtomicReference;
+import java.util.function.Supplier;
+
+@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.18.0-SNAPSHOT")
+public class Configuration {
+ public static final String VERSION = "1.0.0";
+
+ private static final AtomicReference defaultApiClient = new AtomicReference<>();
+ private static volatile Supplier apiClientFactory = ApiClient::new;
+
+ /**
+ * Get the default API client, which would be used when creating API instances without providing an API client.
+ *
+ * @return Default API client
+ */
+ public static ApiClient getDefaultApiClient() {
+ ApiClient client = defaultApiClient.get();
+ if (client == null) {
+ client = defaultApiClient.updateAndGet(val -> {
+ if (val != null) { // changed by another thread
+ return val;
+ }
+ return apiClientFactory.get();
+ });
+ }
+ return client;
+ }
+
+ /**
+ * Set the default API client, which would be used when creating API instances without providing an API client.
+ *
+ * @param apiClient API client
+ */
+ public static void setDefaultApiClient(ApiClient apiClient) {
+ defaultApiClient.set(apiClient);
+ }
+
+ /**
+ * set the callback used to create new ApiClient objects
+ */
+ public static void setApiClientFactory(Supplier factory) {
+ apiClientFactory = Objects.requireNonNull(factory);
+ }
+
+ private Configuration() {
+ }
+}
\ No newline at end of file
diff --git a/samples/client/petstore/java/native-useGzipFeature/src/main/java/org/openapitools/client/JSON.java b/samples/client/petstore/java/native-useGzipFeature/src/main/java/org/openapitools/client/JSON.java
new file mode 100644
index 000000000000..f9cd6febe0d5
--- /dev/null
+++ b/samples/client/petstore/java/native-useGzipFeature/src/main/java/org/openapitools/client/JSON.java
@@ -0,0 +1,264 @@
+/*
+ * OpenAPI Petstore
+ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ *
+ * 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 com.fasterxml.jackson.annotation.*;
+import com.fasterxml.jackson.databind.*;
+import com.fasterxml.jackson.databind.json.JsonMapper;
+import org.openapitools.jackson.nullable.JsonNullableModule;
+import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
+import org.openapitools.client.model.*;
+
+import java.text.DateFormat;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.18.0-SNAPSHOT")
+public class JSON {
+ private ObjectMapper mapper;
+
+ public JSON() {
+ mapper = JsonMapper.builder()
+ .serializationInclusion(JsonInclude.Include.NON_NULL)
+ .disable(MapperFeature.ALLOW_COERCION_OF_SCALARS)
+ .disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
+ .enable(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE)
+ .disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS)
+ .enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING)
+ .enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING)
+ .defaultDateFormat(new RFC3339DateFormat())
+ .addModule(new JavaTimeModule())
+ .build();
+ JsonNullableModule jnm = new JsonNullableModule();
+ mapper.registerModule(jnm);
+ }
+
+ /**
+ * Set the date format for JSON (de)serialization with Date properties.
+ *
+ * @param dateFormat Date format
+ */
+ public void setDateFormat(DateFormat dateFormat) {
+ mapper.setDateFormat(dateFormat);
+ }
+
+ /**
+ * Get the object mapper
+ *
+ * @return object mapper
+ */
+ public ObjectMapper getMapper() { return mapper; }
+
+ /**
+ * Returns the target model class that should be used to deserialize the input data.
+ * The discriminator mappings are used to determine the target model class.
+ *
+ * @param node The input data.
+ * @param modelClass The class that contains the discriminator mappings.
+ *
+ * @return the target model class.
+ */
+ public static Class> getClassForElement(JsonNode node, Class> modelClass) {
+ ClassDiscriminatorMapping cdm = modelDiscriminators.get(modelClass);
+ if (cdm != null) {
+ return cdm.getClassForElement(node, new HashSet>());
+ }
+ return null;
+ }
+
+ /**
+ * Helper class to register the discriminator mappings.
+ */
+ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.18.0-SNAPSHOT")
+ private static class ClassDiscriminatorMapping {
+ // The model class name.
+ Class> modelClass;
+ // The name of the discriminator property.
+ String discriminatorName;
+ // The discriminator mappings for a model class.
+ Map> discriminatorMappings;
+
+ // Constructs a new class discriminator.
+ ClassDiscriminatorMapping(Class> cls, String propertyName, Map> mappings) {
+ modelClass = cls;
+ discriminatorName = propertyName;
+ discriminatorMappings = new HashMap>();
+ if (mappings != null) {
+ discriminatorMappings.putAll(mappings);
+ }
+ }
+
+ // Return the name of the discriminator property for this model class.
+ String getDiscriminatorPropertyName() {
+ return discriminatorName;
+ }
+
+ // Return the discriminator value or null if the discriminator is not
+ // present in the payload.
+ String getDiscriminatorValue(JsonNode node) {
+ // Determine the value of the discriminator property in the input data.
+ if (discriminatorName != null) {
+ // Get the value of the discriminator property, if present in the input payload.
+ node = node.get(discriminatorName);
+ if (node != null && node.isValueNode()) {
+ String discrValue = node.asText();
+ if (discrValue != null) {
+ return discrValue;
+ }
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Returns the target model class that should be used to deserialize the input data.
+ * This function can be invoked for anyOf/oneOf composed models with discriminator mappings.
+ * The discriminator mappings are used to determine the target model class.
+ *
+ * @param node The input data.
+ * @param visitedClasses The set of classes that have already been visited.
+ *
+ * @return the target model class.
+ */
+ Class> getClassForElement(JsonNode node, Set> visitedClasses) {
+ if (visitedClasses.contains(modelClass)) {
+ // Class has already been visited.
+ return null;
+ }
+ // Determine the value of the discriminator property in the input data.
+ String discrValue = getDiscriminatorValue(node);
+ if (discrValue == null) {
+ return null;
+ }
+ Class> cls = discriminatorMappings.get(discrValue);
+ // It may not be sufficient to return this cls directly because that target class
+ // may itself be a composed schema, possibly with its own discriminator.
+ visitedClasses.add(modelClass);
+ for (Class> childClass : discriminatorMappings.values()) {
+ ClassDiscriminatorMapping childCdm = modelDiscriminators.get(childClass);
+ if (childCdm == null) {
+ continue;
+ }
+ if (!discriminatorName.equals(childCdm.discriminatorName)) {
+ discrValue = getDiscriminatorValue(node);
+ if (discrValue == null) {
+ continue;
+ }
+ }
+ if (childCdm != null) {
+ // Recursively traverse the discriminator mappings.
+ Class> childDiscr = childCdm.getClassForElement(node, visitedClasses);
+ if (childDiscr != null) {
+ return childDiscr;
+ }
+ }
+ }
+ return cls;
+ }
+ }
+
+ /**
+ * Returns true if inst is an instance of modelClass in the OpenAPI model hierarchy.
+ *
+ * The Java class hierarchy is not implemented the same way as the OpenAPI model hierarchy,
+ * so it's not possible to use the instanceof keyword.
+ *
+ * @param modelClass A OpenAPI model class.
+ * @param inst The instance object.
+ * @param visitedClasses The set of classes that have already been visited.
+ *
+ * @return true if inst is an instance of modelClass in the OpenAPI model hierarchy.
+ */
+ public static boolean isInstanceOf(Class> modelClass, Object inst, Set> visitedClasses) {
+ if (modelClass.isInstance(inst)) {
+ // This handles the 'allOf' use case with single parent inheritance.
+ return true;
+ }
+ if (visitedClasses.contains(modelClass)) {
+ // This is to prevent infinite recursion when the composed schemas have
+ // a circular dependency.
+ return false;
+ }
+ visitedClasses.add(modelClass);
+
+ // Traverse the oneOf/anyOf composed schemas.
+ Map> descendants = modelDescendants.get(modelClass);
+ if (descendants != null) {
+ for (Class> childType : descendants.values()) {
+ if (isInstanceOf(childType, inst, visitedClasses)) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ /**
+ * A map of discriminators for all model classes.
+ */
+ private static Map, ClassDiscriminatorMapping> modelDiscriminators = new HashMap<>();
+
+ /**
+ * A map of oneOf/anyOf descendants for each model class.
+ */
+ private static Map, Map>> modelDescendants = new HashMap<>();
+
+ /**
+ * Register a model class discriminator.
+ *
+ * @param modelClass the model class
+ * @param discriminatorPropertyName the name of the discriminator property
+ * @param mappings a map with the discriminator mappings.
+ */
+ public static void registerDiscriminator(Class> modelClass, String discriminatorPropertyName, Map> mappings) {
+ ClassDiscriminatorMapping m = new ClassDiscriminatorMapping(modelClass, discriminatorPropertyName, mappings);
+ modelDiscriminators.put(modelClass, m);
+ }
+
+ /**
+ * Register the oneOf/anyOf descendants of the modelClass.
+ *
+ * @param modelClass the model class
+ * @param descendants a map of oneOf/anyOf descendants.
+ */
+ public static void registerDescendants(Class> modelClass, Map> descendants) {
+ modelDescendants.put(modelClass, descendants);
+ }
+
+ private static JSON json;
+
+ static {
+ json = new JSON();
+ }
+
+ /**
+ * Get the default JSON instance.
+ *
+ * @return the default JSON instance
+ */
+ public static JSON getDefault() {
+ return json;
+ }
+
+ /**
+ * Set the default JSON instance.
+ *
+ * @param json JSON instance to be used
+ */
+ public static void setDefault(JSON json) {
+ JSON.json = json;
+ }
+}
diff --git a/samples/client/petstore/java/native-useGzipFeature/src/main/java/org/openapitools/client/Pair.java b/samples/client/petstore/java/native-useGzipFeature/src/main/java/org/openapitools/client/Pair.java
new file mode 100644
index 000000000000..ae5a090430a8
--- /dev/null
+++ b/samples/client/petstore/java/native-useGzipFeature/src/main/java/org/openapitools/client/Pair.java
@@ -0,0 +1,37 @@
+/*
+ * OpenAPI Petstore
+ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ *
+ * 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;
+
+@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.18.0-SNAPSHOT")
+public class Pair {
+ private final String name;
+ private final String value;
+
+ public Pair(String name, String value) {
+ this.name = isValidString(name) ? name : "";
+ this.value = isValidString(value) ? value : "";
+ }
+
+ public String getName() {
+ return this.name;
+ }
+
+ public String getValue() {
+ return this.value;
+ }
+
+ private static boolean isValidString(String arg) {
+ return arg != null;
+ }
+}
diff --git a/samples/client/petstore/java/native-useGzipFeature/src/main/java/org/openapitools/client/RFC3339DateFormat.java b/samples/client/petstore/java/native-useGzipFeature/src/main/java/org/openapitools/client/RFC3339DateFormat.java
new file mode 100644
index 000000000000..37301d51c4fd
--- /dev/null
+++ b/samples/client/petstore/java/native-useGzipFeature/src/main/java/org/openapitools/client/RFC3339DateFormat.java
@@ -0,0 +1,58 @@
+/*
+ * OpenAPI Petstore
+ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ *
+ * 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 com.fasterxml.jackson.databind.util.StdDateFormat;
+
+import java.text.DateFormat;
+import java.text.FieldPosition;
+import java.text.ParsePosition;
+import java.util.Date;
+import java.text.DecimalFormat;
+import java.util.GregorianCalendar;
+import java.util.TimeZone;
+
+@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.18.0-SNAPSHOT")
+public class RFC3339DateFormat extends DateFormat {
+ private static final long serialVersionUID = 1L;
+ private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC");
+
+ private final StdDateFormat fmt = new StdDateFormat()
+ .withTimeZone(TIMEZONE_Z)
+ .withColonInTimeZone(true);
+
+ public RFC3339DateFormat() {
+ this.calendar = new GregorianCalendar();
+ this.numberFormat = new DecimalFormat();
+ }
+
+ @Override
+ public Date parse(String source) {
+ return parse(source, new ParsePosition(0));
+ }
+
+ @Override
+ public Date parse(String source, ParsePosition pos) {
+ return fmt.parse(source, pos);
+ }
+
+ @Override
+ public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
+ return fmt.format(date, toAppendTo, fieldPosition);
+ }
+
+ @Override
+ public Object clone() {
+ return super.clone();
+ }
+}
diff --git a/samples/client/petstore/java/native-useGzipFeature/src/main/java/org/openapitools/client/RFC3339InstantDeserializer.java b/samples/client/petstore/java/native-useGzipFeature/src/main/java/org/openapitools/client/RFC3339InstantDeserializer.java
new file mode 100644
index 000000000000..c1155302f56e
--- /dev/null
+++ b/samples/client/petstore/java/native-useGzipFeature/src/main/java/org/openapitools/client/RFC3339InstantDeserializer.java
@@ -0,0 +1,100 @@
+/*
+ * OpenAPI Petstore
+ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ *
+ * 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.io.IOException;
+import java.time.Instant;
+import java.time.OffsetDateTime;
+import java.time.ZoneId;
+import java.time.ZonedDateTime;
+import java.time.format.DateTimeFormatter;
+import java.time.temporal.Temporal;
+import java.time.temporal.TemporalAccessor;
+import java.util.function.BiFunction;
+import java.util.function.Function;
+
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import com.fasterxml.jackson.datatype.jsr310.JavaTimeFeature;
+import com.fasterxml.jackson.datatype.jsr310.deser.InstantDeserializer;
+
+@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.18.0-SNAPSHOT")
+public class RFC3339InstantDeserializer extends InstantDeserializer {
+ private static final long serialVersionUID = 1L;
+ private final static boolean DEFAULT_NORMALIZE_ZONE_ID = JavaTimeFeature.NORMALIZE_DESERIALIZED_ZONE_ID.enabledByDefault();
+ private final static boolean DEFAULT_ALWAYS_ALLOW_STRINGIFIED_DATE_TIMESTAMPS
+ = JavaTimeFeature.ALWAYS_ALLOW_STRINGIFIED_DATE_TIMESTAMPS.enabledByDefault();
+
+ public static final RFC3339InstantDeserializer INSTANT = new RFC3339InstantDeserializer<>(
+ Instant.class, DateTimeFormatter.ISO_INSTANT,
+ Instant::from,
+ a -> Instant.ofEpochMilli( a.value ),
+ a -> Instant.ofEpochSecond( a.integer, a.fraction ),
+ null,
+ true, // yes, replace zero offset with Z
+ DEFAULT_NORMALIZE_ZONE_ID,
+ DEFAULT_ALWAYS_ALLOW_STRINGIFIED_DATE_TIMESTAMPS
+ );
+
+ public static final RFC3339InstantDeserializer OFFSET_DATE_TIME = new RFC3339InstantDeserializer<>(
+ OffsetDateTime.class, DateTimeFormatter.ISO_OFFSET_DATE_TIME,
+ OffsetDateTime::from,
+ a -> OffsetDateTime.ofInstant( Instant.ofEpochMilli( a.value ), a.zoneId ),
+ a -> OffsetDateTime.ofInstant( Instant.ofEpochSecond( a.integer, a.fraction ), a.zoneId ),
+ (d, z) -> ( d.isEqual( OffsetDateTime.MIN ) || d.isEqual( OffsetDateTime.MAX ) ?
+ d :
+ d.withOffsetSameInstant( z.getRules().getOffset( d.toLocalDateTime() ) ) ),
+ true, // yes, replace zero offset with Z
+ DEFAULT_NORMALIZE_ZONE_ID,
+ DEFAULT_ALWAYS_ALLOW_STRINGIFIED_DATE_TIMESTAMPS
+ );
+
+ public static final RFC3339InstantDeserializer ZONED_DATE_TIME = new RFC3339InstantDeserializer<>(
+ ZonedDateTime.class, DateTimeFormatter.ISO_ZONED_DATE_TIME,
+ ZonedDateTime::from,
+ a -> ZonedDateTime.ofInstant( Instant.ofEpochMilli( a.value ), a.zoneId ),
+ a -> ZonedDateTime.ofInstant( Instant.ofEpochSecond( a.integer, a.fraction ), a.zoneId ),
+ ZonedDateTime::withZoneSameInstant,
+ false, // keep zero offset and Z separate since zones explicitly supported
+ DEFAULT_NORMALIZE_ZONE_ID,
+ DEFAULT_ALWAYS_ALLOW_STRINGIFIED_DATE_TIMESTAMPS
+ );
+
+ protected RFC3339InstantDeserializer(
+ Class supportedType,
+ DateTimeFormatter formatter,
+ Function parsedToValue,
+ Function fromMilliseconds,
+ Function fromNanoseconds,
+ BiFunction adjust,
+ boolean replaceZeroOffsetAsZ,
+ boolean normalizeZoneId,
+ boolean readNumericStringsAsTimestamp) {
+ super(
+ supportedType,
+ formatter,
+ parsedToValue,
+ fromMilliseconds,
+ fromNanoseconds,
+ adjust,
+ replaceZeroOffsetAsZ,
+ normalizeZoneId,
+ readNumericStringsAsTimestamp
+ );
+ }
+
+ @Override
+ protected T _fromString(JsonParser p, DeserializationContext ctxt, String string0) throws IOException {
+ return super._fromString(p, ctxt, string0.replace( ' ', 'T' ));
+ }
+}
\ No newline at end of file
diff --git a/samples/client/petstore/java/native-useGzipFeature/src/main/java/org/openapitools/client/RFC3339JavaTimeModule.java b/samples/client/petstore/java/native-useGzipFeature/src/main/java/org/openapitools/client/RFC3339JavaTimeModule.java
new file mode 100644
index 000000000000..5782e005915f
--- /dev/null
+++ b/samples/client/petstore/java/native-useGzipFeature/src/main/java/org/openapitools/client/RFC3339JavaTimeModule.java
@@ -0,0 +1,39 @@
+/*
+ * OpenAPI Petstore
+ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ *
+ * 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.time.Instant;
+import java.time.OffsetDateTime;
+import java.time.ZonedDateTime;
+
+import com.fasterxml.jackson.databind.module.SimpleModule;
+import com.fasterxml.jackson.databind.Module.SetupContext;
+
+@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.18.0-SNAPSHOT")
+public class RFC3339JavaTimeModule extends SimpleModule {
+ private static final long serialVersionUID = 1L;
+
+ public RFC3339JavaTimeModule() {
+ super("RFC3339JavaTimeModule");
+ }
+
+ @Override
+ public void setupModule(SetupContext context) {
+ super.setupModule(context);
+
+ addDeserializer(Instant.class, RFC3339InstantDeserializer.INSTANT);
+ addDeserializer(OffsetDateTime.class, RFC3339InstantDeserializer.OFFSET_DATE_TIME);
+ addDeserializer(ZonedDateTime.class, RFC3339InstantDeserializer.ZONED_DATE_TIME);
+ }
+
+}
diff --git a/samples/client/petstore/java/native-useGzipFeature/src/main/java/org/openapitools/client/ServerConfiguration.java b/samples/client/petstore/java/native-useGzipFeature/src/main/java/org/openapitools/client/ServerConfiguration.java
new file mode 100644
index 000000000000..35786b765364
--- /dev/null
+++ b/samples/client/petstore/java/native-useGzipFeature/src/main/java/org/openapitools/client/ServerConfiguration.java
@@ -0,0 +1,72 @@
+/*
+ * OpenAPI Petstore
+ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ *
+ * 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.Map;
+
+/**
+ * Representing a Server configuration.
+ */
+@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.18.0-SNAPSHOT")
+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/petstore/java/native-useGzipFeature/src/main/java/org/openapitools/client/ServerVariable.java b/samples/client/petstore/java/native-useGzipFeature/src/main/java/org/openapitools/client/ServerVariable.java
new file mode 100644
index 000000000000..7f2ead4d3582
--- /dev/null
+++ b/samples/client/petstore/java/native-useGzipFeature/src/main/java/org/openapitools/client/ServerVariable.java
@@ -0,0 +1,37 @@
+/*
+ * OpenAPI Petstore
+ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ *
+ * 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.HashSet;
+
+/**
+ * Representing a Server Variable for server URL template substitution.
+ */
+@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.18.0-SNAPSHOT")
+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/petstore/java/native-useGzipFeature/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/native-useGzipFeature/src/main/java/org/openapitools/client/api/PetApi.java
new file mode 100644
index 000000000000..435606543feb
--- /dev/null
+++ b/samples/client/petstore/java/native-useGzipFeature/src/main/java/org/openapitools/client/api/PetApi.java
@@ -0,0 +1,289 @@
+/*
+ * OpenAPI Petstore
+ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ *
+ * 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.api;
+
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.ApiResponse;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.Pair;
+
+import org.openapitools.client.model.Pet;
+
+import com.fasterxml.jackson.core.type.TypeReference;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+import java.io.InputStream;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.net.http.HttpRequest;
+import java.nio.channels.Channels;
+import java.nio.channels.Pipe;
+import java.net.URI;
+import java.net.http.HttpClient;
+import java.net.http.HttpRequest;
+import java.net.http.HttpResponse;
+import java.time.Duration;
+
+import java.util.ArrayList;
+import java.util.StringJoiner;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.Locale;
+import java.util.function.Consumer;
+
+@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.18.0-SNAPSHOT")
+public class PetApi {
+ /**
+ * Utility class for extending HttpRequest.Builder functionality.
+ */
+ private static class HttpRequestBuilderExtensions {
+ /**
+ * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific headers.
+ *
+ * @param builder the HttpRequest.Builder to which headers will be added
+ * @param headers a map of header names and values to add; may be null
+ * @return the same HttpRequest.Builder instance with the additional headers set
+ */
+ static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) {
+ if (headers != null) {
+ for (Map.Entry entry : headers.entrySet()) {
+ builder.header(entry.getKey(), entry.getValue());
+ }
+ }
+ return builder;
+ }
+ }
+ private final HttpClient memberVarHttpClient;
+ private final ObjectMapper memberVarObjectMapper;
+ private final String memberVarBaseUri;
+ private final Consumer memberVarInterceptor;
+ private final Duration memberVarReadTimeout;
+ private final Consumer> memberVarResponseInterceptor;
+ private final Consumer> memberVarAsyncResponseInterceptor;
+
+ public PetApi() {
+ this(Configuration.getDefaultApiClient());
+ }
+
+ public PetApi(ApiClient apiClient) {
+ memberVarHttpClient = apiClient.getHttpClient();
+ memberVarObjectMapper = apiClient.getObjectMapper();
+ memberVarBaseUri = apiClient.getBaseUri();
+ memberVarInterceptor = apiClient.getRequestInterceptor();
+ memberVarReadTimeout = apiClient.getReadTimeout();
+ memberVarResponseInterceptor = apiClient.getResponseInterceptor();
+ memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor();
+ }
+
+
+ protected ApiException getApiException(String operationId, HttpResponse response) throws IOException {
+ InputStream responseBody = ApiClient.getResponseBody(response);
+ String body = null;
+ try {
+ body = responseBody == null ? null : new String(responseBody.readAllBytes());
+ } finally {
+ if (responseBody != null) {
+ responseBody.close();
+ }
+ }
+ String message = formatExceptionMessage(operationId, response.statusCode(), body);
+ return new ApiException(response.statusCode(), message, response.headers(), body);
+ }
+
+ private String formatExceptionMessage(String operationId, int statusCode, String body) {
+ if (body == null || body.isEmpty()) {
+ body = "[no body]";
+ }
+ return operationId + " call failed with: " + statusCode + " - " + body;
+ }
+
+ /**
+ * Download file from the given response.
+ *
+ * @param response Response
+ * @return File
+ * @throws ApiException If fail to read file content from response and write to disk
+ */
+ public File downloadFileFromResponse(HttpResponse response, InputStream responseBody) throws ApiException {
+ if (responseBody == null) {
+ throw new ApiException(new IOException("Response body is empty"));
+ }
+ try {
+ File file = prepareDownloadFile(response);
+ java.nio.file.Files.copy(responseBody, file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING);
+ return file;
+ } catch (IOException e) {
+ throw new ApiException(e);
+ }
+ }
+
+ /**
+ * Prepare the file for download from the response.
+ *
+ * @param response a {@link java.net.http.HttpResponse} object.
+ * @return a {@link java.io.File} object.
+ * @throws java.io.IOException if any.
+ */
+ private File prepareDownloadFile(HttpResponse response) throws IOException {
+ String filename = null;
+ java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition");
+ if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) {
+ // Get filename from the Content-Disposition header.
+ java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?");
+ java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get());
+ if (matcher.find())
+ filename = matcher.group(1);
+ }
+ File file = null;
+ if (filename != null) {
+ java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native");
+ java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename));
+ file = filePath.toFile();
+ tempDir.toFile().deleteOnExit(); // best effort cleanup
+ file.deleteOnExit(); // best effort cleanup
+ } else {
+ file = java.nio.file.Files.createTempFile("download-", "").toFile();
+ file.deleteOnExit(); // best effort cleanup
+ }
+ return file;
+ }
+
+ /**
+ * Add a new pet to the store
+ *
+ * @param pet Pet object that needs to be added to the store (required)
+ * @return Pet
+ * @throws ApiException if fails to make API call
+ */
+ public Pet addPet(@jakarta.annotation.Nonnull Pet pet) throws ApiException {
+ return addPet(pet, null);
+ }
+
+ /**
+ * Add a new pet to the store
+ *
+ * @param pet Pet object that needs to be added to the store (required)
+ * @param headers Optional headers to include in the request
+ * @return Pet
+ * @throws ApiException if fails to make API call
+ */
+ public Pet addPet(@jakarta.annotation.Nonnull Pet pet, Map headers) throws ApiException {
+ ApiResponse localVarResponse = addPetWithHttpInfo(pet, headers);
+ return localVarResponse.getData();
+ }
+
+ /**
+ * Add a new pet to the store
+ *
+ * @param pet Pet object that needs to be added to the store (required)
+ * @return ApiResponse<Pet>
+ * @throws ApiException if fails to make API call
+ */
+ public ApiResponse addPetWithHttpInfo(@jakarta.annotation.Nonnull Pet pet) throws ApiException {
+ return addPetWithHttpInfo(pet, null);
+ }
+
+ /**
+ * Add a new pet to the store
+ *
+ * @param pet Pet object that needs to be added to the store (required)
+ * @param headers Optional headers to include in the request
+ * @return ApiResponse<Pet>
+ * @throws ApiException if fails to make API call
+ */
+ public ApiResponse addPetWithHttpInfo(@jakarta.annotation.Nonnull Pet pet, Map headers) throws ApiException {
+ HttpRequest.Builder localVarRequestBuilder = addPetRequestBuilder(pet, headers);
+ try {
+ HttpResponse localVarResponse = memberVarHttpClient.send(
+ localVarRequestBuilder.build(),
+ HttpResponse.BodyHandlers.ofInputStream());
+ if (memberVarResponseInterceptor != null) {
+ memberVarResponseInterceptor.accept(localVarResponse);
+ }
+ InputStream localVarResponseBody = null;
+ try {
+ if (localVarResponse.statusCode()/ 100 != 2) {
+ throw getApiException("addPet", localVarResponse);
+ }
+ localVarResponseBody = ApiClient.getResponseBody(localVarResponse);
+ if (localVarResponseBody == null) {
+ return new ApiResponse(
+ localVarResponse.statusCode(),
+ localVarResponse.headers().map(),
+ null
+ );
+ }
+
+
+
+ String responseBody = new String(localVarResponseBody.readAllBytes());
+ Pet responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {});
+
+
+ return new ApiResponse(
+ localVarResponse.statusCode(),
+ localVarResponse.headers().map(),
+ responseValue
+ );
+ } finally {
+ if (localVarResponseBody != null) {
+ localVarResponseBody.close();
+ }
+ }
+ } catch (IOException e) {
+ throw new ApiException(e);
+ }
+ catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
+ throw new ApiException(e);
+ }
+ }
+
+ private HttpRequest.Builder addPetRequestBuilder(@jakarta.annotation.Nonnull Pet pet, Map headers) throws ApiException {
+ // verify the required parameter 'pet' is set
+ if (pet == null) {
+ throw new ApiException(400, "Missing the required parameter 'pet' when calling addPet");
+ }
+
+ HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
+
+ String localVarPath = "/pet";
+
+ localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
+
+ localVarRequestBuilder.header("Content-Type", "application/json");
+ localVarRequestBuilder.header("Accept", "application/xml, application/json");
+
+ try {
+ byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(pet);
+ localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody));
+ } catch (IOException e) {
+ throw new ApiException(e);
+ }
+ if (memberVarReadTimeout != null) {
+ localVarRequestBuilder.timeout(memberVarReadTimeout);
+ }
+ // Add custom headers if provided
+ localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers);
+ if (memberVarInterceptor != null) {
+ memberVarInterceptor.accept(localVarRequestBuilder);
+ }
+ return localVarRequestBuilder;
+ }
+
+}
diff --git a/samples/client/petstore/java/native-useGzipFeature/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java b/samples/client/petstore/java/native-useGzipFeature/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java
new file mode 100644
index 000000000000..fd91c49262d7
--- /dev/null
+++ b/samples/client/petstore/java/native-useGzipFeature/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java
@@ -0,0 +1,147 @@
+/*
+ * OpenAPI Petstore
+ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ *
+ * 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.lang.reflect.Type;
+import java.util.Map;
+
+import com.fasterxml.jackson.annotation.JsonValue;
+
+/**
+ * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec
+ */
+@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.18.0-SNAPSHOT")
+public abstract class AbstractOpenApiSchema {
+
+ // store the actual instance of the schema/object
+ private Object instance;
+
+ // is nullable
+ private Boolean isNullable;
+
+ // schema type (e.g. oneOf, anyOf)
+ private final String schemaType;
+
+ public AbstractOpenApiSchema(String schemaType, Boolean isNullable) {
+ this.schemaType = schemaType;
+ this.isNullable = isNullable;
+ }
+
+ /**
+ * Get the list of oneOf/anyOf composed schemas allowed to be stored in this object
+ *
+ * @return an instance of the actual schema/object
+ */
+ public abstract Map> getSchemas();
+
+ /**
+ * Get the actual instance
+ *
+ * @return an instance of the actual schema/object
+ */
+ @JsonValue
+ public Object getActualInstance() {return instance;}
+
+ /**
+ * Set the actual instance
+ *
+ * @param instance the actual instance of the schema/object
+ */
+ public void setActualInstance(Object instance) {this.instance = instance;}
+
+ /**
+ * Get the instant recursively when the schemas defined in oneOf/anyof happen to be oneOf/anyOf schema as well
+ *
+ * @return an instance of the actual schema/object
+ */
+ public Object getActualInstanceRecursively() {
+ return getActualInstanceRecursively(this);
+ }
+
+ private Object getActualInstanceRecursively(AbstractOpenApiSchema object) {
+ if (object.getActualInstance() == null) {
+ return null;
+ } else if (object.getActualInstance() instanceof AbstractOpenApiSchema) {
+ return getActualInstanceRecursively((AbstractOpenApiSchema)object.getActualInstance());
+ } else {
+ return object.getActualInstance();
+ }
+ }
+
+ /**
+ * Get the schema type (e.g. anyOf, oneOf)
+ *
+ * @return the schema type
+ */
+ public String getSchemaType() {
+ return schemaType;
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class ").append(getClass()).append(" {\n");
+ sb.append(" instance: ").append(toIndentedString(instance)).append("\n");
+ sb.append(" isNullable: ").append(toIndentedString(isNullable)).append("\n");
+ sb.append(" schemaType: ").append(toIndentedString(schemaType)).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 ");
+ }
+
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ AbstractOpenApiSchema a = (AbstractOpenApiSchema) o;
+ return Objects.equals(this.instance, a.instance) &&
+ Objects.equals(this.isNullable, a.isNullable) &&
+ Objects.equals(this.schemaType, a.schemaType);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(instance, isNullable, schemaType);
+ }
+
+ /**
+ * Is nullable
+ *
+ * @return true if it's nullable
+ */
+ public Boolean isNullable() {
+ if (Boolean.TRUE.equals(isNullable)) {
+ return Boolean.TRUE;
+ } else {
+ return Boolean.FALSE;
+ }
+ }
+
+
+
+}
diff --git a/samples/client/petstore/java/native-useGzipFeature/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/native-useGzipFeature/src/main/java/org/openapitools/client/model/Category.java
new file mode 100644
index 000000000000..149d6af9ceb5
--- /dev/null
+++ b/samples/client/petstore/java/native-useGzipFeature/src/main/java/org/openapitools/client/model/Category.java
@@ -0,0 +1,188 @@
+/*
+ * OpenAPI Petstore
+ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ *
+ * 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.net.URLEncoder;
+import java.nio.charset.StandardCharsets;
+import java.util.StringJoiner;
+import java.util.Objects;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.Locale;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.fasterxml.jackson.annotation.JsonValue;
+import java.util.Arrays;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+
+
+import org.openapitools.client.ApiClient;
+/**
+ * A category for a pet
+ */
+@JsonPropertyOrder({
+ Category.JSON_PROPERTY_ID,
+ Category.JSON_PROPERTY_NAME
+})
+@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.18.0-SNAPSHOT")
+public class Category {
+ public static final String JSON_PROPERTY_ID = "id";
+ @jakarta.annotation.Nullable
+ private Long id;
+
+ public static final String JSON_PROPERTY_NAME = "name";
+ @jakarta.annotation.Nullable
+ private String name;
+
+ public Category() {
+ }
+
+ public Category id(@jakarta.annotation.Nullable Long id) {
+ this.id = id;
+ return this;
+ }
+
+ /**
+ * Get id
+ * @return id
+ */
+ @jakarta.annotation.Nullable
+ @JsonProperty(value = JSON_PROPERTY_ID, required = false)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public Long getId() {
+ return id;
+ }
+
+
+ @JsonProperty(value = JSON_PROPERTY_ID, required = false)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public void setId(@jakarta.annotation.Nullable Long id) {
+ this.id = id;
+ }
+
+
+ public Category name(@jakarta.annotation.Nullable String name) {
+ this.name = name;
+ return this;
+ }
+
+ /**
+ * Get name
+ * @return name
+ */
+ @jakarta.annotation.Nullable
+ @JsonProperty(value = JSON_PROPERTY_NAME, required = false)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public String getName() {
+ return name;
+ }
+
+
+ @JsonProperty(value = JSON_PROPERTY_NAME, required = false)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public void setName(@jakarta.annotation.Nullable String name) {
+ this.name = name;
+ }
+
+
+ /**
+ * Return true if this Category object is equal to o.
+ */
+ @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 ");
+ }
+
+ /**
+ * Convert the instance into URL query string.
+ *
+ * @return URL query string
+ */
+ public String toUrlQueryString() {
+ return toUrlQueryString(null);
+ }
+
+ /**
+ * Convert the instance into URL query string.
+ *
+ * @param prefix prefix of the query string
+ * @return URL query string
+ */
+ public String toUrlQueryString(String prefix) {
+ String suffix = "";
+ String containerSuffix = "";
+ String containerPrefix = "";
+ if (prefix == null) {
+ // style=form, explode=true, e.g. /pet?name=cat&type=manx
+ prefix = "";
+ } else {
+ // deepObject style e.g. /pet?id[name]=cat&id[type]=manx
+ prefix = prefix + "[";
+ suffix = "]";
+ containerSuffix = "]";
+ containerPrefix = "[";
+ }
+
+ StringJoiner joiner = new StringJoiner("&");
+
+ // add `id` to the URL query string
+ if (getId() != null) {
+ joiner.add(String.format(Locale.ROOT, "%sid%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId()))));
+ }
+
+ // add `name` to the URL query string
+ if (getName() != null) {
+ joiner.add(String.format(Locale.ROOT, "%sname%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getName()))));
+ }
+
+ return joiner.toString();
+ }
+}
+
diff --git a/samples/client/petstore/java/native-useGzipFeature/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/native-useGzipFeature/src/main/java/org/openapitools/client/model/Pet.java
new file mode 100644
index 000000000000..1497c6951731
--- /dev/null
+++ b/samples/client/petstore/java/native-useGzipFeature/src/main/java/org/openapitools/client/model/Pet.java
@@ -0,0 +1,400 @@
+/*
+ * OpenAPI Petstore
+ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ *
+ * 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.net.URLEncoder;
+import java.nio.charset.StandardCharsets;
+import java.util.StringJoiner;
+import java.util.Objects;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.Locale;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.fasterxml.jackson.annotation.JsonValue;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import org.openapitools.client.model.Category;
+import org.openapitools.client.model.Tag;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+
+
+import org.openapitools.client.ApiClient;
+/**
+ * A pet for sale in the pet store
+ */
+@JsonPropertyOrder({
+ Pet.JSON_PROPERTY_ID,
+ Pet.JSON_PROPERTY_CATEGORY,
+ Pet.JSON_PROPERTY_NAME,
+ Pet.JSON_PROPERTY_PHOTO_URLS,
+ Pet.JSON_PROPERTY_TAGS,
+ Pet.JSON_PROPERTY_STATUS
+})
+@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.18.0-SNAPSHOT")
+public class Pet {
+ public static final String JSON_PROPERTY_ID = "id";
+ @jakarta.annotation.Nullable
+ private Long id;
+
+ public static final String JSON_PROPERTY_CATEGORY = "category";
+ @jakarta.annotation.Nullable
+ private Category category;
+
+ public static final String JSON_PROPERTY_NAME = "name";
+ @jakarta.annotation.Nonnull
+ private String name;
+
+ public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls";
+ @jakarta.annotation.Nonnull
+ private List photoUrls = new ArrayList<>();
+
+ public static final String JSON_PROPERTY_TAGS = "tags";
+ @jakarta.annotation.Nullable
+ private List tags = new ArrayList<>();
+
+ /**
+ * pet status in the store
+ */
+ public enum StatusEnum {
+ AVAILABLE(String.valueOf("available")),
+
+ PENDING(String.valueOf("pending")),
+
+ SOLD(String.valueOf("sold"));
+
+ private String value;
+
+ StatusEnum(String value) {
+ this.value = value;
+ }
+
+ @JsonValue
+ public String getValue() {
+ return value;
+ }
+
+ @Override
+ public String toString() {
+ return String.valueOf(value);
+ }
+
+ @JsonCreator
+ 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 final String JSON_PROPERTY_STATUS = "status";
+ @jakarta.annotation.Nullable
+ private StatusEnum status;
+
+ public Pet() {
+ }
+
+ public Pet id(@jakarta.annotation.Nullable Long id) {
+ this.id = id;
+ return this;
+ }
+
+ /**
+ * Get id
+ * @return id
+ */
+ @jakarta.annotation.Nullable
+ @JsonProperty(value = JSON_PROPERTY_ID, required = false)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public Long getId() {
+ return id;
+ }
+
+
+ @JsonProperty(value = JSON_PROPERTY_ID, required = false)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public void setId(@jakarta.annotation.Nullable Long id) {
+ this.id = id;
+ }
+
+
+ public Pet category(@jakarta.annotation.Nullable Category category) {
+ this.category = category;
+ return this;
+ }
+
+ /**
+ * Get category
+ * @return category
+ */
+ @jakarta.annotation.Nullable
+ @JsonProperty(value = JSON_PROPERTY_CATEGORY, required = false)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public Category getCategory() {
+ return category;
+ }
+
+
+ @JsonProperty(value = JSON_PROPERTY_CATEGORY, required = false)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public void setCategory(@jakarta.annotation.Nullable Category category) {
+ this.category = category;
+ }
+
+
+ public Pet name(@jakarta.annotation.Nonnull String name) {
+ this.name = name;
+ return this;
+ }
+
+ /**
+ * Get name
+ * @return name
+ */
+ @jakarta.annotation.Nonnull
+ @JsonProperty(value = JSON_PROPERTY_NAME, required = true)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public String getName() {
+ return name;
+ }
+
+
+ @JsonProperty(value = JSON_PROPERTY_NAME, required = true)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public void setName(@jakarta.annotation.Nonnull String name) {
+ this.name = name;
+ }
+
+
+ public Pet photoUrls(@jakarta.annotation.Nonnull List photoUrls) {
+ this.photoUrls = photoUrls;
+ return this;
+ }
+
+ public Pet addPhotoUrlsItem(String photoUrlsItem) {
+ if (this.photoUrls == null) {
+ this.photoUrls = new ArrayList<>();
+ }
+ this.photoUrls.add(photoUrlsItem);
+ return this;
+ }
+
+ /**
+ * Get photoUrls
+ * @return photoUrls
+ */
+ @jakarta.annotation.Nonnull
+ @JsonProperty(value = JSON_PROPERTY_PHOTO_URLS, required = true)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public List getPhotoUrls() {
+ return photoUrls;
+ }
+
+
+ @JsonProperty(value = JSON_PROPERTY_PHOTO_URLS, required = true)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public void setPhotoUrls(@jakarta.annotation.Nonnull List photoUrls) {
+ this.photoUrls = photoUrls;
+ }
+
+
+ public Pet tags(@jakarta.annotation.Nullable 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
+ */
+ @jakarta.annotation.Nullable
+ @JsonProperty(value = JSON_PROPERTY_TAGS, required = false)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public List getTags() {
+ return tags;
+ }
+
+
+ @JsonProperty(value = JSON_PROPERTY_TAGS, required = false)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public void setTags(@jakarta.annotation.Nullable List tags) {
+ this.tags = tags;
+ }
+
+
+ public Pet status(@jakarta.annotation.Nullable StatusEnum status) {
+ this.status = status;
+ return this;
+ }
+
+ /**
+ * pet status in the store
+ * @return status
+ * @deprecated
+ */
+ @Deprecated
+ @jakarta.annotation.Nullable
+ @JsonProperty(value = JSON_PROPERTY_STATUS, required = false)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public StatusEnum getStatus() {
+ return status;
+ }
+
+
+ @JsonProperty(value = JSON_PROPERTY_STATUS, required = false)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public void setStatus(@jakarta.annotation.Nullable StatusEnum status) {
+ this.status = status;
+ }
+
+
+ /**
+ * Return true if this Pet object is equal to o.
+ */
+ @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.category, pet.category) &&
+ Objects.equals(this.name, pet.name) &&
+ 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, category, name, 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(" category: ").append(toIndentedString(category)).append("\n");
+ sb.append(" name: ").append(toIndentedString(name)).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 ");
+ }
+
+ /**
+ * Convert the instance into URL query string.
+ *
+ * @return URL query string
+ */
+ public String toUrlQueryString() {
+ return toUrlQueryString(null);
+ }
+
+ /**
+ * Convert the instance into URL query string.
+ *
+ * @param prefix prefix of the query string
+ * @return URL query string
+ */
+ public String toUrlQueryString(String prefix) {
+ String suffix = "";
+ String containerSuffix = "";
+ String containerPrefix = "";
+ if (prefix == null) {
+ // style=form, explode=true, e.g. /pet?name=cat&type=manx
+ prefix = "";
+ } else {
+ // deepObject style e.g. /pet?id[name]=cat&id[type]=manx
+ prefix = prefix + "[";
+ suffix = "]";
+ containerSuffix = "]";
+ containerPrefix = "[";
+ }
+
+ StringJoiner joiner = new StringJoiner("&");
+
+ // add `id` to the URL query string
+ if (getId() != null) {
+ joiner.add(String.format(Locale.ROOT, "%sid%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId()))));
+ }
+
+ // add `category` to the URL query string
+ if (getCategory() != null) {
+ joiner.add(getCategory().toUrlQueryString(prefix + "category" + suffix));
+ }
+
+ // add `name` to the URL query string
+ if (getName() != null) {
+ joiner.add(String.format(Locale.ROOT, "%sname%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getName()))));
+ }
+
+ // add `photoUrls` to the URL query string
+ if (getPhotoUrls() != null) {
+ for (int i = 0; i < getPhotoUrls().size(); i++) {
+ joiner.add(String.format(Locale.ROOT, "%sphotoUrls%s%s=%s", prefix, suffix,
+ "".equals(suffix) ? "" : String.format(Locale.ROOT, "%s%d%s", containerPrefix, i, containerSuffix),
+ ApiClient.urlEncode(ApiClient.valueToString(getPhotoUrls().get(i)))));
+ }
+ }
+
+ // add `tags` to the URL query string
+ if (getTags() != null) {
+ for (int i = 0; i < getTags().size(); i++) {
+ if (getTags().get(i) != null) {
+ joiner.add(getTags().get(i).toUrlQueryString(String.format(Locale.ROOT, "%stags%s%s", prefix, suffix,
+ "".equals(suffix) ? "" : String.format(Locale.ROOT, "%s%d%s", containerPrefix, i, containerSuffix))));
+ }
+ }
+ }
+
+ // add `status` to the URL query string
+ if (getStatus() != null) {
+ joiner.add(String.format(Locale.ROOT, "%sstatus%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getStatus()))));
+ }
+
+ return joiner.toString();
+ }
+}
+
diff --git a/samples/client/petstore/java/native-useGzipFeature/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/native-useGzipFeature/src/main/java/org/openapitools/client/model/Tag.java
new file mode 100644
index 000000000000..9045a0ac4850
--- /dev/null
+++ b/samples/client/petstore/java/native-useGzipFeature/src/main/java/org/openapitools/client/model/Tag.java
@@ -0,0 +1,188 @@
+/*
+ * OpenAPI Petstore
+ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ *
+ * 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.net.URLEncoder;
+import java.nio.charset.StandardCharsets;
+import java.util.StringJoiner;
+import java.util.Objects;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.Locale;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.fasterxml.jackson.annotation.JsonValue;
+import java.util.Arrays;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+
+
+import org.openapitools.client.ApiClient;
+/**
+ * A tag for a pet
+ */
+@JsonPropertyOrder({
+ Tag.JSON_PROPERTY_ID,
+ Tag.JSON_PROPERTY_NAME
+})
+@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.18.0-SNAPSHOT")
+public class Tag {
+ public static final String JSON_PROPERTY_ID = "id";
+ @jakarta.annotation.Nullable
+ private Long id;
+
+ public static final String JSON_PROPERTY_NAME = "name";
+ @jakarta.annotation.Nullable
+ private String name;
+
+ public Tag() {
+ }
+
+ public Tag id(@jakarta.annotation.Nullable Long id) {
+ this.id = id;
+ return this;
+ }
+
+ /**
+ * Get id
+ * @return id
+ */
+ @jakarta.annotation.Nullable
+ @JsonProperty(value = JSON_PROPERTY_ID, required = false)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public Long getId() {
+ return id;
+ }
+
+
+ @JsonProperty(value = JSON_PROPERTY_ID, required = false)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public void setId(@jakarta.annotation.Nullable Long id) {
+ this.id = id;
+ }
+
+
+ public Tag name(@jakarta.annotation.Nullable String name) {
+ this.name = name;
+ return this;
+ }
+
+ /**
+ * Get name
+ * @return name
+ */
+ @jakarta.annotation.Nullable
+ @JsonProperty(value = JSON_PROPERTY_NAME, required = false)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public String getName() {
+ return name;
+ }
+
+
+ @JsonProperty(value = JSON_PROPERTY_NAME, required = false)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public void setName(@jakarta.annotation.Nullable String name) {
+ this.name = name;
+ }
+
+
+ /**
+ * Return true if this Tag object is equal to o.
+ */
+ @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 ");
+ }
+
+ /**
+ * Convert the instance into URL query string.
+ *
+ * @return URL query string
+ */
+ public String toUrlQueryString() {
+ return toUrlQueryString(null);
+ }
+
+ /**
+ * Convert the instance into URL query string.
+ *
+ * @param prefix prefix of the query string
+ * @return URL query string
+ */
+ public String toUrlQueryString(String prefix) {
+ String suffix = "";
+ String containerSuffix = "";
+ String containerPrefix = "";
+ if (prefix == null) {
+ // style=form, explode=true, e.g. /pet?name=cat&type=manx
+ prefix = "";
+ } else {
+ // deepObject style e.g. /pet?id[name]=cat&id[type]=manx
+ prefix = prefix + "[";
+ suffix = "]";
+ containerSuffix = "]";
+ containerPrefix = "[";
+ }
+
+ StringJoiner joiner = new StringJoiner("&");
+
+ // add `id` to the URL query string
+ if (getId() != null) {
+ joiner.add(String.format(Locale.ROOT, "%sid%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId()))));
+ }
+
+ // add `name` to the URL query string
+ if (getName() != null) {
+ joiner.add(String.format(Locale.ROOT, "%sname%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getName()))));
+ }
+
+ return joiner.toString();
+ }
+}
+
diff --git a/samples/client/petstore/java/native-useGzipFeature/src/test/java/org/openapitools/client/api/PetApiTest.java b/samples/client/petstore/java/native-useGzipFeature/src/test/java/org/openapitools/client/api/PetApiTest.java
new file mode 100644
index 000000000000..5f3e8c59e94b
--- /dev/null
+++ b/samples/client/petstore/java/native-useGzipFeature/src/test/java/org/openapitools/client/api/PetApiTest.java
@@ -0,0 +1,54 @@
+/*
+ * OpenAPI Petstore
+ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ *
+ * 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.api;
+
+import org.openapitools.client.ApiException;
+import org.openapitools.client.model.Pet;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+
+/**
+ * API tests for PetApi
+ */
+@Disabled
+public class PetApiTest {
+
+ private final PetApi api = new PetApi();
+
+
+ /**
+ * Add a new pet to the store
+ *
+ *
+ *
+ * @throws ApiException
+ * if the Api call fails
+ */
+ @Test
+ public void addPetTest() throws ApiException {
+ Pet pet = null;
+ Pet response =
+ api.addPet(pet);
+
+ // TODO: test validations
+ }
+
+}
diff --git a/samples/client/petstore/java/native-useGzipFeature/src/test/java/org/openapitools/client/model/CategoryTest.java b/samples/client/petstore/java/native-useGzipFeature/src/test/java/org/openapitools/client/model/CategoryTest.java
new file mode 100644
index 000000000000..ae23ab433a50
--- /dev/null
+++ b/samples/client/petstore/java/native-useGzipFeature/src/test/java/org/openapitools/client/model/CategoryTest.java
@@ -0,0 +1,56 @@
+/*
+ * OpenAPI Petstore
+ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ *
+ * 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.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.fasterxml.jackson.annotation.JsonValue;
+import java.util.Arrays;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Disabled;
+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/petstore/java/native-useGzipFeature/src/test/java/org/openapitools/client/model/PetTest.java b/samples/client/petstore/java/native-useGzipFeature/src/test/java/org/openapitools/client/model/PetTest.java
new file mode 100644
index 000000000000..84aff8adbf96
--- /dev/null
+++ b/samples/client/petstore/java/native-useGzipFeature/src/test/java/org/openapitools/client/model/PetTest.java
@@ -0,0 +1,92 @@
+/*
+ * OpenAPI Petstore
+ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ *
+ * 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.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.fasterxml.jackson.annotation.JsonValue;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import org.openapitools.client.model.Category;
+import org.openapitools.client.model.Tag;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Disabled;
+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 'category'
+ */
+ @Test
+ void categoryTest() {
+ // TODO: test category
+ }
+
+ /**
+ * Test the property 'name'
+ */
+ @Test
+ void nameTest() {
+ // TODO: test name
+ }
+
+ /**
+ * 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/petstore/java/native-useGzipFeature/src/test/java/org/openapitools/client/model/TagTest.java b/samples/client/petstore/java/native-useGzipFeature/src/test/java/org/openapitools/client/model/TagTest.java
new file mode 100644
index 000000000000..6bd8b9f5035e
--- /dev/null
+++ b/samples/client/petstore/java/native-useGzipFeature/src/test/java/org/openapitools/client/model/TagTest.java
@@ -0,0 +1,56 @@
+/*
+ * OpenAPI Petstore
+ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ *
+ * 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.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.fasterxml.jackson.annotation.JsonValue;
+import java.util.Arrays;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Disabled;
+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
+ }
+
+}