diff --git a/bin/configs/java-jersey3.yaml b/bin/configs/java-jersey3.yaml
new file mode 100644
index 000000000000..50ea3258eca4
--- /dev/null
+++ b/bin/configs/java-jersey3.yaml
@@ -0,0 +1,13 @@
+generatorName: java
+outputDir: samples/client/petstore/java/jersey3
+library: jersey3
+inputSpec: modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml
+templateDir: modules/openapi-generator/src/main/resources/Java
+additionalProperties:
+ artifactId: petstore-jersey3
+ hideGenerationTimestamp: true
+ serverPort: "8082"
+ dateLibrary: java8
+ useOneOfDiscriminatorLookup: true
+ disallowAdditionalPropertiesIfNotPresent: false
+ gradleProperties: "\n# JVM arguments\norg.gradle.jvmargs=-Xmx2024m -XX:MaxPermSize=512m\n# set timeout\norg.gradle.daemon.idletimeout=3600000\n# show all warnings\norg.gradle.warning.mode=all"
diff --git a/docs/generators/java.md b/docs/generators/java.md
index 5184e5f56f7b..d2988169c0f5 100644
--- a/docs/generators/java.md
+++ b/docs/generators/java.md
@@ -52,7 +52,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 'jersey2' or other HTTP libraries instead. **jersey2** HTTP client: Jersey client 2.25.1. JSON processing: Jackson 2.9.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+ **microprofile** HTTP client: Microprofile client 1.x. JSON processing: JSON-B **apache-httpclient** HTTP client: Apache httpclient 4.x |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. **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+ **microprofile** HTTP client: Microprofile client 1.x. JSON processing: JSON-B **apache-httpclient** HTTP client: Apache httpclient 4.x |okhttp-gson|
|licenseName|The name of the license| |Unlicense|
|licenseUrl|The URL of the license| |http://unlicense.org|
|microprofileFramework|Framework for microprofile. Possible values "kumuluzee"| |null|
@@ -78,7 +78,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|useAbstractionForFiles|Use alternative types instead of java.io.File to allow passing bytes without a file on disk. Available on resttemplate, webclient, libraries| |false|
|useBeanValidation|Use BeanValidation API annotations| |false|
|useGzipFeature|Send gzip-encoded requests| |false|
-|useOneOfDiscriminatorLookup|Use the discriminator's mapping in oneOf to speed up the model lookup. IMPORTANT: Validation (e.g. one and only one match in oneOf's schemas) will be skipped. Only jersey2, native, okhttp-gson support this option.| |false|
+|useOneOfDiscriminatorLookup|Use the discriminator's mapping in oneOf to speed up the model lookup. IMPORTANT: Validation (e.g. one and only one match in oneOf's schemas) will be skipped. Only jersey2, jersey3, native, okhttp-gson support this option.| |false|
|usePlayWS|Use Play! Async HTTP client (Play WS API)| |false|
|useReflectionEqualsHashCode|Use org.apache.commons.lang3.builder for equals and hashCode in the models. WARNING: This will fail under a security manager, unless the appropriate permissions are set up correctly and also there's potential performance impact.| |false|
|useRuntimeException|Use RuntimeException instead of Exception| |false|
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java
index 047af4467179..0063f80568f7 100644
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java
@@ -76,6 +76,7 @@ public class JavaClientCodegen extends AbstractJavaCodegen
public static final String GOOGLE_API_CLIENT = "google-api-client";
public static final String JERSEY1 = "jersey1";
public static final String JERSEY2 = "jersey2";
+ public static final String JERSEY3 = "jersey3";
public static final String NATIVE = "native";
public static final String OKHTTP_GSON = "okhttp-gson";
public static final String RESTEASY = "resteasy";
@@ -162,10 +163,11 @@ public JavaClientCodegen() {
cliOptions.add(CliOption.newString(GRADLE_PROPERTIES, "Append additional Gradle properties to the gradle.properties file"));
cliOptions.add(CliOption.newString(ERROR_OBJECT_TYPE, "Error Object type. (This option is for okhttp-gson-next-gen only)"));
cliOptions.add(CliOption.newString(CONFIG_KEY, "Config key in @RegisterRestClient. Default to none. Only `microprofile` supports this option."));
- cliOptions.add(CliOption.newBoolean(CodegenConstants.USE_ONEOF_DISCRIMINATOR_LOOKUP, CodegenConstants.USE_ONEOF_DISCRIMINATOR_LOOKUP_DESC + " Only jersey2, native, okhttp-gson support this option."));
+ cliOptions.add(CliOption.newBoolean(CodegenConstants.USE_ONEOF_DISCRIMINATOR_LOOKUP, CodegenConstants.USE_ONEOF_DISCRIMINATOR_LOOKUP_DESC + " Only jersey2, jersey3, native, okhttp-gson support this option."));
- supportedLibraries.put(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 'jersey2' or other HTTP libraries instead.");
+ supportedLibraries.put(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.");
supportedLibraries.put(JERSEY2, "HTTP client: Jersey client 2.25.1. JSON processing: Jackson 2.9.x");
+ supportedLibraries.put(JERSEY3, "HTTP client: Jersey client 3.x. JSON processing: Jackson 2.x");
supportedLibraries.put(FEIGN, "HTTP client: OpenFeign 10.x. JSON processing: Jackson 2.9.x.");
supportedLibraries.put(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'.");
supportedLibraries.put(RETROFIT_2, "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)");
@@ -369,7 +371,7 @@ public void processOpts() {
}
// helper for client library that allow to parse/format java.time.OffsetDateTime or org.threeten.bp.OffsetDateTime
- if (additionalProperties.containsKey("jsr310") && (isLibrary(WEBCLIENT) || isLibrary(VERTX) || isLibrary(RESTTEMPLATE) || isLibrary(RESTEASY) || isLibrary(MICROPROFILE) || isLibrary(JERSEY1) || isLibrary(JERSEY2) || isLibrary(APACHE))) {
+ if (additionalProperties.containsKey("jsr310") && (isLibrary(WEBCLIENT) || isLibrary(VERTX) || isLibrary(RESTTEMPLATE) || isLibrary(RESTEASY) || isLibrary(MICROPROFILE) || isLibrary(JERSEY1) || isLibrary(JERSEY2) || isLibrary(JERSEY3) || isLibrary(APACHE))) {
supportingFiles.add(new SupportingFile("JavaTimeFormatter.mustache", invokerFolder, "JavaTimeFormatter.java"));
}
@@ -478,6 +480,23 @@ public void processOpts() {
// one by one for each library.
supportsAdditionalPropertiesWithComposedSchema = true;
+ } else if (JERSEY3.equals(getLibrary())) {
+ additionalProperties.put("jersey3", true);
+ supportingFiles.add(new SupportingFile("JSON.mustache", invokerFolder, "JSON.java"));
+ supportingFiles.add(new SupportingFile("ApiResponse.mustache", invokerFolder, "ApiResponse.java"));
+ if (ProcessUtils.hasHttpSignatureMethods(openAPI)) {
+ supportingFiles.add(new SupportingFile("auth/HttpSignatureAuth.mustache", authFolder, "HttpSignatureAuth.java"));
+ }
+ supportingFiles.add(new SupportingFile("AbstractOpenApiSchema.mustache", modelsFolder, "AbstractOpenApiSchema.java"));
+ forceSerializationLibrary(SERIALIZATION_LIBRARY_JACKSON);
+
+ // Composed schemas can have the 'additionalProperties' keyword, as specified in JSON schema.
+ // In principle, this should be enabled by default for all code generators. However due to limitations
+ // in other code generators, support needs to be enabled on a case-by-case basis.
+ // The flag below should be set for all Java libraries, but the templates need to be ported
+ // one by one for each library.
+ supportsAdditionalPropertiesWithComposedSchema = true;
+
} else if (NATIVE.equals(getLibrary())) {
supportingFiles.add(new SupportingFile("ApiResponse.mustache", invokerFolder, "ApiResponse.java"));
supportingFiles.add(new SupportingFile("JSON.mustache", invokerFolder, "JSON.java"));
@@ -892,7 +911,7 @@ public ModelsMap postProcessModels(ModelsMap objs) {
CodegenModel cm = mo.getModel();
cm.getVendorExtensions().putIfAbsent("x-implements", new ArrayList());
- if (JERSEY2.equals(getLibrary()) || NATIVE.equals(getLibrary()) || OKHTTP_GSON.equals(getLibrary())) {
+ if (JERSEY2.equals(getLibrary()) || JERSEY3.equals(getLibrary()) || NATIVE.equals(getLibrary()) || OKHTTP_GSON.equals(getLibrary())) {
cm.getVendorExtensions().put("x-implements", new ArrayList());
if (cm.oneOf != null && !cm.oneOf.isEmpty() && cm.oneOf.contains("ModelNull")) {
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/AbstractOpenApiSchema.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/AbstractOpenApiSchema.mustache
new file mode 100644
index 000000000000..afbf6a9a02c9
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/AbstractOpenApiSchema.mustache
@@ -0,0 +1,138 @@
+{{>licenseInfo}}
+
+package {{modelPackage}};
+
+import {{invokerPackage}}.ApiException;
+import java.util.Objects;
+import java.lang.reflect.Type;
+import java.util.Map;
+import jakarta.ws.rs.core.GenericType;
+
+import com.fasterxml.jackson.annotation.JsonValue;
+
+/**
+ * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec
+ */
+{{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}
+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;
+ }
+ }
+
+{{>libraries/jersey2/additional_properties}}
+
+}
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/ApiClient.mustache
new file mode 100644
index 000000000000..2454aafa8973
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/ApiClient.mustache
@@ -0,0 +1,1444 @@
+package {{invokerPackage}};
+
+import jakarta.ws.rs.client.Client;
+import jakarta.ws.rs.client.ClientBuilder;
+import jakarta.ws.rs.client.Entity;
+import jakarta.ws.rs.client.Invocation;
+import jakarta.ws.rs.client.WebTarget;
+import jakarta.ws.rs.core.Form;
+import jakarta.ws.rs.core.GenericType;
+import jakarta.ws.rs.core.MediaType;
+import jakarta.ws.rs.core.Response;
+import jakarta.ws.rs.core.Response.Status;
+
+{{#hasOAuthMethods}}
+import com.github.scribejava.core.model.OAuth2AccessToken;
+{{/hasOAuthMethods}}
+import org.glassfish.jersey.client.ClientConfig;
+import org.glassfish.jersey.client.ClientProperties;
+import org.glassfish.jersey.client.HttpUrlConnectorProvider;
+import org.glassfish.jersey.jackson.JacksonFeature;
+import org.glassfish.jersey.media.multipart.FormDataBodyPart;
+import org.glassfish.jersey.media.multipart.FormDataContentDisposition;
+import org.glassfish.jersey.media.multipart.MultiPart;
+import org.glassfish.jersey.media.multipart.MultiPartFeature;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+import java.net.URI;
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.TrustManager;
+import javax.net.ssl.X509TrustManager;
+import java.security.cert.X509Certificate;
+import java.security.KeyManagementException;
+import java.security.NoSuchAlgorithmException;
+import java.security.SecureRandom;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.nio.file.StandardCopyOption;
+import org.glassfish.jersey.logging.LoggingFeature;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Arrays;
+import java.util.ArrayList;
+import java.util.Date;
+{{#jsr310}}
+import java.time.OffsetDateTime;
+{{/jsr310}}
+
+import java.net.URLEncoder;
+
+import java.io.File;
+import java.io.UnsupportedEncodingException;
+
+import java.text.DateFormat;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import {{invokerPackage}}.auth.Authentication;
+import {{invokerPackage}}.auth.HttpBasicAuth;
+import {{invokerPackage}}.auth.HttpBearerAuth;
+{{#hasHttpSignatureMethods}}
+import {{invokerPackage}}.auth.HttpSignatureAuth;
+{{/hasHttpSignatureMethods}}
+import {{invokerPackage}}.auth.ApiKeyAuth;
+{{#hasOAuthMethods}}
+import {{invokerPackage}}.auth.OAuth;
+{{/hasOAuthMethods}}
+
+/**
+ * ApiClient class.
+ */
+{{>generatedAnnotation}}
+public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
+ protected Map defaultHeaderMap = new HashMap();
+ protected Map defaultCookieMap = new HashMap();
+ protected String basePath = "{{{basePath}}}";
+ protected String userAgent;
+ private static final Logger log = Logger.getLogger(ApiClient.class.getName());
+
+ protected List servers = new ArrayList({{#servers}}{{#-first}}Arrays.asList(
+{{/-first}} new ServerConfiguration(
+ "{{{url}}}",
+ "{{{description}}}{{^description}}No description provided{{/description}}",
+ new HashMap(){{#variables}}{{#-first}} {{
+{{/-first}} put("{{{name}}}", new ServerVariable(
+ "{{{description}}}{{^description}}No description provided{{/description}}",
+ "{{{defaultValue}}}",
+ new HashSet(
+ {{#enumValues}}
+ {{#-first}}
+ Arrays.asList(
+ {{/-first}}
+ "{{{.}}}"{{^-last}},{{/-last}}
+ {{#-last}}
+ )
+ {{/-last}}
+ {{/enumValues}}
+ )
+ ));
+ {{#-last}}
+ }}{{/-last}}{{/variables}}
+ ){{^-last}},{{/-last}}
+ {{#-last}}
+ ){{/-last}}{{/servers}});
+ protected Integer serverIndex = 0;
+ protected Map serverVariables = null;
+ protected Map> operationServers = new HashMap>() {{
+ {{#apiInfo}}
+ {{#apis}}
+ {{#operations}}
+ {{#operation}}
+ {{#servers}}
+ {{#-first}}
+ put("{{{classname}}}.{{{operationId}}}", new ArrayList(Arrays.asList(
+ {{/-first}}
+ new ServerConfiguration(
+ "{{{url}}}",
+ "{{{description}}}{{^description}}No description provided{{/description}}",
+ new HashMap(){{#variables}}{{#-first}} {{
+{{/-first}} put("{{{name}}}", new ServerVariable(
+ "{{{description}}}{{^description}}No description provided{{/description}}",
+ "{{{defaultValue}}}",
+ new HashSet(
+ {{#enumValues}}
+ {{#-first}}
+ Arrays.asList(
+ {{/-first}}
+ "{{{.}}}"{{^-last}},{{/-last}}
+ {{#-last}}
+ )
+ {{/-last}}
+ {{/enumValues}}
+ )
+ ));
+ {{#-last}}
+ }}{{/-last}}{{/variables}}
+ ){{^-last}},{{/-last}}
+ {{#-last}}
+ )));{{/-last}}
+ {{/servers}}
+ {{/operation}}
+ {{/operations}}
+ {{/apis}}
+ {{/apiInfo}}
+ }};
+ protected Map operationServerIndex = new HashMap();
+ protected Map> operationServerVariables = new HashMap>();
+ protected boolean debugging = false;
+ protected ClientConfig clientConfig;
+ protected int connectionTimeout = 0;
+ private int readTimeout = 0;
+
+ protected Client httpClient;
+ protected JSON json;
+ protected String tempFolderPath = null;
+
+ protected Map authentications;
+ protected Map authenticationLookup;
+
+ protected DateFormat dateFormat;
+
+ /**
+ * Constructs a new ApiClient with default parameters.
+ */
+ public ApiClient() {
+ this(null);
+ }
+
+ /**
+ * Constructs a new ApiClient with the specified authentication parameters.
+ *
+ * @param authMap A hash map containing authentication parameters.
+ */
+ public ApiClient(Map authMap) {
+ json = new JSON();
+ httpClient = buildHttpClient();
+
+ this.dateFormat = new RFC3339DateFormat();
+
+ // Set default User-Agent.
+ setUserAgent("{{{httpUserAgent}}}{{^httpUserAgent}}OpenAPI-Generator/{{{artifactVersion}}}/java{{/httpUserAgent}}");
+
+ // Setup authentications (key: authentication name, value: authentication).
+ authentications = new HashMap();
+ Authentication auth = null;
+ {{#authMethods}}
+ if (authMap != null) {
+ auth = authMap.get("{{name}}");
+ }
+ {{#isBasic}}
+ {{#isBasicBasic}}
+ if (auth instanceof HttpBasicAuth) {
+ authentications.put("{{name}}", auth);
+ } else {
+ authentications.put("{{name}}", new HttpBasicAuth());
+ }
+ {{/isBasicBasic}}
+ {{#isBasicBearer}}
+ if (auth instanceof HttpBearerAuth) {
+ authentications.put("{{name}}", auth);
+ } else {
+ authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));
+ }
+ {{/isBasicBearer}}
+ {{#isHttpSignature}}
+ if (auth instanceof HttpSignatureAuth) {
+ authentications.put("{{name}}", auth);
+ }
+ {{/isHttpSignature}}
+ {{/isBasic}}
+ {{#isApiKey}}
+ if (auth instanceof ApiKeyAuth) {
+ authentications.put("{{name}}", auth);
+ } else {
+ authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{^isKeyInHeader}}"query"{{/isKeyInHeader}}, "{{keyParamName}}"));
+ }
+ {{/isApiKey}}
+ {{#isOAuth}}
+ if (auth instanceof OAuth) {
+ authentications.put("{{name}}", auth);
+ } else {
+ authentications.put("{{name}}", new OAuth(basePath, "{{tokenUrl}}"));
+ }
+ {{/isOAuth}}
+ {{/authMethods}}
+ // Prevent the authentications from being modified.
+ authentications = Collections.unmodifiableMap(authentications);
+
+ // Setup authentication lookup (key: authentication alias, value: authentication name)
+ authenticationLookup = new HashMap();{{#authMethods}}{{#vendorExtensions.x-auth-id-alias}}
+ authenticationLookup.put("{{name}}", "{{.}}");{{/vendorExtensions.x-auth-id-alias}}{{/authMethods}}
+ }
+
+ /**
+ * Gets the JSON instance to do JSON serialization and deserialization.
+ *
+ * @return JSON
+ */
+ public JSON getJSON() {
+ return json;
+ }
+
+ /**
+ * Getter for the field httpClient
.
+ *
+ * @return a {@link jakarta.ws.rs.client.Client} object.
+ */
+ public Client getHttpClient() {
+ return httpClient;
+ }
+
+ /**
+ * Setter for the field httpClient
.
+ *
+ * @param httpClient a {@link jakarta.ws.rs.client.Client} object.
+ * @return a {@link org.openapitools.client.ApiClient} object.
+ */
+ public ApiClient setHttpClient(Client httpClient) {
+ this.httpClient = httpClient;
+ return this;
+ }
+
+ /**
+ * Returns the base URL to the location where the OpenAPI document is being served.
+ *
+ * @return The base URL to the target host.
+ */
+ public String getBasePath() {
+ return basePath;
+ }
+
+ /**
+ * Sets the base URL to the location where the OpenAPI document is being served.
+ *
+ * @param basePath The base URL to the target host.
+ * @return a {@link org.openapitools.client.ApiClient} object.
+ */
+ public ApiClient setBasePath(String basePath) {
+ this.basePath = basePath;
+ {{#hasOAuthMethods}}
+ setOauthBasePath(basePath);
+ {{/hasOAuthMethods}}
+ return this;
+ }
+
+ /**
+ * Getter for the field servers
.
+ *
+ * @return a {@link java.util.List} of servers.
+ */
+ public List getServers() {
+ return servers;
+ }
+
+ /**
+ * Setter for the field servers
.
+ *
+ * @param servers a {@link java.util.List} of servers.
+ * @return a {@link org.openapitools.client.ApiClient} object.
+ */
+ public ApiClient setServers(List servers) {
+ this.servers = servers;
+ updateBasePath();
+ return this;
+ }
+
+ /**
+ * Getter for the field serverIndex
.
+ *
+ * @return a {@link java.lang.Integer} object.
+ */
+ public Integer getServerIndex() {
+ return serverIndex;
+ }
+
+ /**
+ * Setter for the field serverIndex
.
+ *
+ * @param serverIndex the server index
+ * @return a {@link org.openapitools.client.ApiClient} object.
+ */
+ public ApiClient setServerIndex(Integer serverIndex) {
+ this.serverIndex = serverIndex;
+ updateBasePath();
+ return this;
+ }
+
+ /**
+ * Getter for the field serverVariables
.
+ *
+ * @return a {@link java.util.Map} of server variables.
+ */
+ public Map getServerVariables() {
+ return serverVariables;
+ }
+
+ /**
+ * Setter for the field serverVariables
.
+ *
+ * @param serverVariables a {@link java.util.Map} of server variables.
+ * @return a {@link org.openapitools.client.ApiClient} object.
+ */
+ public ApiClient setServerVariables(Map serverVariables) {
+ this.serverVariables = serverVariables;
+ updateBasePath();
+ return this;
+ }
+
+ private void updateBasePath() {
+ if (serverIndex != null) {
+ setBasePath(servers.get(serverIndex).URL(serverVariables));
+ }
+ }
+
+ {{#hasOAuthMethods}}
+ private void setOauthBasePath(String basePath) {
+ for(Authentication auth : authentications.values()) {
+ if (auth instanceof OAuth) {
+ ((OAuth) auth).setBasePath(basePath);
+ }
+ }
+ }
+
+ {{/hasOAuthMethods}}
+ /**
+ * Get authentications (key: authentication name, value: authentication).
+ *
+ * @return Map of authentication object
+ */
+ public Map getAuthentications() {
+ return authentications;
+ }
+
+ /**
+ * Get authentication for the given name.
+ *
+ * @param authName The authentication name
+ * @return The authentication, null if not found
+ */
+ public Authentication getAuthentication(String authName) {
+ return authentications.get(authName);
+ }
+
+ /**
+ * Helper method to set username for the first HTTP basic authentication.
+ *
+ * @param username Username
+ * @return a {@link org.openapitools.client.ApiClient} object.
+ */
+ public ApiClient setUsername(String username) {
+ for (Authentication auth : authentications.values()) {
+ if (auth instanceof HttpBasicAuth) {
+ ((HttpBasicAuth) auth).setUsername(username);
+ return this;
+ }
+ }
+ throw new RuntimeException("No HTTP basic authentication configured!");
+ }
+
+ /**
+ * Helper method to set password for the first HTTP basic authentication.
+ *
+ * @param password Password
+ * @return a {@link org.openapitools.client.ApiClient} object.
+ */
+ public ApiClient setPassword(String password) {
+ for (Authentication auth : authentications.values()) {
+ if (auth instanceof HttpBasicAuth) {
+ ((HttpBasicAuth) auth).setPassword(password);
+ return this;
+ }
+ }
+ throw new RuntimeException("No HTTP basic authentication configured!");
+ }
+
+ /**
+ * Helper method to set API key value for the first API key authentication.
+ *
+ * @param apiKey API key
+ * @return a {@link org.openapitools.client.ApiClient} object.
+ */
+ public ApiClient setApiKey(String apiKey) {
+ for (Authentication auth : authentications.values()) {
+ if (auth instanceof ApiKeyAuth) {
+ ((ApiKeyAuth) auth).setApiKey(apiKey);
+ return this;
+ }
+ }
+ throw new RuntimeException("No API key authentication configured!");
+ }
+
+ /**
+ * Helper method to configure authentications which respects aliases of API keys.
+ *
+ * @param secrets Hash map from authentication name to its secret.
+ * @return a {@link org.openapitools.client.ApiClient} object.
+ */
+ public ApiClient configureApiKeys(Map secrets) {
+ for (Map.Entry authEntry : authentications.entrySet()) {
+ Authentication auth = authEntry.getValue();
+ if (auth instanceof ApiKeyAuth) {
+ String name = authEntry.getKey();
+ // respect x-auth-id-alias property
+ name = authenticationLookup.containsKey(name) ? authenticationLookup.get(name) : name;
+ if (secrets.containsKey(name)) {
+ ((ApiKeyAuth) auth).setApiKey(secrets.get(name));
+ }
+ }
+ }
+ return this;
+ }
+
+ /**
+ * Helper method to set API key prefix for the first API key authentication.
+ *
+ * @param apiKeyPrefix API key prefix
+ * @return a {@link org.openapitools.client.ApiClient} object.
+ */
+ public ApiClient setApiKeyPrefix(String apiKeyPrefix) {
+ for (Authentication auth : authentications.values()) {
+ if (auth instanceof ApiKeyAuth) {
+ ((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix);
+ return this;
+ }
+ }
+ throw new RuntimeException("No API key authentication configured!");
+ }
+
+ /**
+ * Helper method to set bearer token for the first Bearer authentication.
+ *
+ * @param bearerToken Bearer token
+ * @return a {@link org.openapitools.client.ApiClient} object.
+ */
+ public ApiClient setBearerToken(String bearerToken) {
+ for (Authentication auth : authentications.values()) {
+ if (auth instanceof HttpBearerAuth) {
+ ((HttpBearerAuth) auth).setBearerToken(bearerToken);
+ return this;
+ }
+ }
+ throw new RuntimeException("No Bearer authentication configured!");
+ }
+
+ {{#hasOAuthMethods}}
+ /**
+ * Helper method to set access token for the first OAuth2 authentication.
+ *
+ * @param accessToken Access token
+ * @return a {@link org.openapitools.client.ApiClient} object.
+ */
+ public ApiClient setAccessToken(String accessToken) {
+ for (Authentication auth : authentications.values()) {
+ if (auth instanceof OAuth) {
+ ((OAuth) auth).setAccessToken(accessToken);
+ return this;
+ }
+ }
+ throw new RuntimeException("No OAuth2 authentication configured!");
+ }
+
+ /**
+ * Helper method to set the credentials for the first OAuth2 authentication.
+ *
+ * @param clientId the client ID
+ * @param clientSecret the client secret
+ * @return a {@link org.openapitools.client.ApiClient} object.
+ */
+ public ApiClient setOauthCredentials(String clientId, String clientSecret) {
+ for (Authentication auth : authentications.values()) {
+ if (auth instanceof OAuth) {
+ ((OAuth) auth).setCredentials(clientId, clientSecret, isDebugging());
+ return this;
+ }
+ }
+ throw new RuntimeException("No OAuth2 authentication configured!");
+ }
+
+ /**
+ * Helper method to set the password flow for the first OAuth2 authentication.
+ *
+ * @param username the user name
+ * @param password the user password
+ * @return a {@link org.openapitools.client.ApiClient} object.
+ */
+ public ApiClient setOauthPasswordFlow(String username, String password) {
+ for (Authentication auth : authentications.values()) {
+ if (auth instanceof OAuth) {
+ ((OAuth) auth).usePasswordFlow(username, password);
+ return this;
+ }
+ }
+ throw new RuntimeException("No OAuth2 authentication configured!");
+ }
+
+ /**
+ * Helper method to set the authorization code flow for the first OAuth2 authentication.
+ *
+ * @param code the authorization code
+ * @return a {@link org.openapitools.client.ApiClient} object.
+ */
+ public ApiClient setOauthAuthorizationCodeFlow(String code) {
+ for (Authentication auth : authentications.values()) {
+ if (auth instanceof OAuth) {
+ ((OAuth) auth).useAuthorizationCodeFlow(code);
+ return this;
+ }
+ }
+ throw new RuntimeException("No OAuth2 authentication configured!");
+ }
+
+ /**
+ * Helper method to set the scopes for the first OAuth2 authentication.
+ *
+ * @param scope the oauth scope
+ * @return a {@link org.openapitools.client.ApiClient} object.
+ */
+ public ApiClient setOauthScope(String scope) {
+ for (Authentication auth : authentications.values()) {
+ if (auth instanceof OAuth) {
+ ((OAuth) auth).setScope(scope);
+ return this;
+ }
+ }
+ throw new RuntimeException("No OAuth2 authentication configured!");
+ }
+
+ {{/hasOAuthMethods}}
+ /**
+ * Set the User-Agent header's value (by adding to the default header map).
+ *
+ * @param userAgent Http user agent
+ * @return a {@link org.openapitools.client.ApiClient} object.
+ */
+ public ApiClient setUserAgent(String userAgent) {
+ this.userAgent = userAgent;
+ addDefaultHeader("User-Agent", userAgent);
+ return this;
+ }
+
+ /**
+ * Get the User-Agent header's value.
+ *
+ * @return User-Agent string
+ */
+ public String getUserAgent(){
+ return userAgent;
+ }
+
+ /**
+ * Add a default header.
+ *
+ * @param key The header's key
+ * @param value The header's value
+ * @return a {@link org.openapitools.client.ApiClient} object.
+ */
+ public ApiClient addDefaultHeader(String key, String value) {
+ defaultHeaderMap.put(key, value);
+ return this;
+ }
+
+ /**
+ * Add a default cookie.
+ *
+ * @param key The cookie's key
+ * @param value The cookie's value
+ * @return a {@link org.openapitools.client.ApiClient} object.
+ */
+ public ApiClient addDefaultCookie(String key, String value) {
+ defaultCookieMap.put(key, value);
+ return this;
+ }
+
+ /**
+ * Gets the client config.
+ *
+ * @return Client config
+ */
+ public ClientConfig getClientConfig() {
+ return clientConfig;
+ }
+
+ /**
+ * Set the client config.
+ *
+ * @param clientConfig Set the client config
+ * @return a {@link org.openapitools.client.ApiClient} object.
+ */
+ public ApiClient setClientConfig(ClientConfig clientConfig) {
+ this.clientConfig = clientConfig;
+ // Rebuild HTTP Client according to the new "clientConfig" value.
+ this.httpClient = buildHttpClient();
+ return this;
+ }
+
+ /**
+ * Check that whether debugging is enabled for this API client.
+ *
+ * @return True if debugging is switched on
+ */
+ public boolean isDebugging() {
+ return debugging;
+ }
+
+ /**
+ * Enable/disable debugging for this API client.
+ *
+ * @param debugging To enable (true) or disable (false) debugging
+ * @return a {@link org.openapitools.client.ApiClient} object.
+ */
+ public ApiClient setDebugging(boolean debugging) {
+ this.debugging = debugging;
+ // Rebuild HTTP Client according to the new "debugging" value.
+ this.httpClient = buildHttpClient();
+ return this;
+ }
+
+ /**
+ * The path of temporary folder used to store downloaded files from endpoints
+ * with file response. The default value is null
, i.e. using
+ * the system's default temporary folder.
+ *
+ * @return Temp folder path
+ */
+ public String getTempFolderPath() {
+ return tempFolderPath;
+ }
+
+ /**
+ * Set temp folder path
+ *
+ * @param tempFolderPath Temp folder path
+ * @return a {@link org.openapitools.client.ApiClient} object.
+ */
+ public ApiClient setTempFolderPath(String tempFolderPath) {
+ this.tempFolderPath = tempFolderPath;
+ return this;
+ }
+
+ /**
+ * Connect timeout (in milliseconds).
+ *
+ * @return Connection timeout
+ */
+ public int getConnectTimeout() {
+ return connectionTimeout;
+ }
+
+ /**
+ * Set the connect timeout (in milliseconds).
+ * A value of 0 means no timeout, otherwise values must be between 1 and
+ * {@link Integer#MAX_VALUE}.
+ *
+ * @param connectionTimeout Connection timeout in milliseconds
+ * @return a {@link org.openapitools.client.ApiClient} object.
+ */
+ public ApiClient setConnectTimeout(int connectionTimeout) {
+ this.connectionTimeout = connectionTimeout;
+ httpClient.property(ClientProperties.CONNECT_TIMEOUT, connectionTimeout);
+ return this;
+ }
+
+ /**
+ * read timeout (in milliseconds).
+ *
+ * @return Read timeout
+ */
+ public int getReadTimeout() {
+ return readTimeout;
+ }
+
+ /**
+ * Set the read timeout (in milliseconds).
+ * A value of 0 means no timeout, otherwise values must be between 1 and
+ * {@link Integer#MAX_VALUE}.
+ *
+ * @param readTimeout Read timeout in milliseconds
+ * @return a {@link org.openapitools.client.ApiClient} object.
+ */
+ public ApiClient setReadTimeout(int readTimeout) {
+ this.readTimeout = readTimeout;
+ httpClient.property(ClientProperties.READ_TIMEOUT, readTimeout);
+ return this;
+ }
+
+ /**
+ * Get the date format used to parse/format date parameters.
+ *
+ * @return Date format
+ */
+ public DateFormat getDateFormat() {
+ return dateFormat;
+ }
+
+ /**
+ * Set the date format used to parse/format date parameters.
+ *
+ * @param dateFormat Date format
+ * @return a {@link org.openapitools.client.ApiClient} object.
+ */
+ public ApiClient setDateFormat(DateFormat dateFormat) {
+ this.dateFormat = dateFormat;
+ // also set the date format for model (de)serialization with Date properties
+ this.json.setDateFormat((DateFormat) dateFormat.clone());
+ return this;
+ }
+
+ /**
+ * Parse the given string into Date object.
+ *
+ * @param str String
+ * @return Date
+ */
+ public Date parseDate(String str) {
+ try {
+ return dateFormat.parse(str);
+ } catch (java.text.ParseException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ /**
+ * Format the given Date object into string.
+ *
+ * @param date Date
+ * @return Date in string format
+ */
+ public String formatDate(Date date) {
+ return dateFormat.format(date);
+ }
+
+ /**
+ * Format the given parameter object into string.
+ *
+ * @param param Object
+ * @return Object in string format
+ */
+ public String parameterToString(Object param) {
+ if (param == null) {
+ return "";
+ } else if (param instanceof Date) {
+ return formatDate((Date) param);
+ } {{#jsr310}}else if (param instanceof OffsetDateTime) {
+ return formatOffsetDateTime((OffsetDateTime) param);
+ } {{/jsr310}}else if (param instanceof Collection) {
+ StringBuilder b = new StringBuilder();
+ for(Object o : (Collection)param) {
+ if(b.length() > 0) {
+ b.append(',');
+ }
+ b.append(String.valueOf(o));
+ }
+ return b.toString();
+ } else {
+ return String.valueOf(param);
+ }
+ }
+
+ /*
+ * Format to {@code Pair} objects.
+ *
+ * @param collectionFormat Collection format
+ * @param name Name
+ * @param value Value
+ * @return List of pairs
+ */
+ public List parameterToPairs(String collectionFormat, String name, Object value){
+ List params = new ArrayList();
+
+ // preconditions
+ if (name == null || name.isEmpty() || value == null) return params;
+
+ Collection valueCollection;
+ if (value instanceof Collection) {
+ valueCollection = (Collection) value;
+ } else {
+ params.add(new Pair(name, parameterToString(value)));
+ return params;
+ }
+
+ if (valueCollection.isEmpty()){
+ return params;
+ }
+
+ // get the collection format (default: csv)
+ String format = (collectionFormat == null || collectionFormat.isEmpty() ? "csv" : collectionFormat);
+
+ // create the params based on the collection format
+ if ("multi".equals(format)) {
+ for (Object item : valueCollection) {
+ params.add(new Pair(name, parameterToString(item)));
+ }
+
+ return params;
+ }
+
+ String delimiter = ",";
+
+ if ("csv".equals(format)) {
+ delimiter = ",";
+ } else if ("ssv".equals(format)) {
+ delimiter = " ";
+ } else if ("tsv".equals(format)) {
+ delimiter = "\t";
+ } else if ("pipes".equals(format)) {
+ delimiter = "|";
+ }
+
+ StringBuilder sb = new StringBuilder() ;
+ for (Object item : valueCollection) {
+ sb.append(delimiter);
+ sb.append(parameterToString(item));
+ }
+
+ params.add(new Pair(name, sb.substring(1)));
+
+ return params;
+ }
+
+ /**
+ * Check if the given MIME is a JSON MIME.
+ * JSON MIME examples:
+ * application/json
+ * application/json; charset=UTF8
+ * APPLICATION/JSON
+ * application/vnd.company+json
+ * "* / *" is also default to JSON
+ *
+ * @param mime MIME
+ * @return True if the MIME type is JSON
+ */
+ public boolean isJsonMime(String mime) {
+ String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$";
+ return mime != null && (mime.matches(jsonMime) || mime.equals("*/*"));
+ }
+
+ /**
+ * Select the Accept header's value from the given accepts array:
+ * if JSON exists in the given array, use it;
+ * otherwise use all of them (joining into a string)
+ *
+ * @param accepts The accepts array to select from
+ * @return The Accept header to use. If the given array is empty,
+ * null will be returned (not to set the Accept header explicitly).
+ */
+ public String selectHeaderAccept(String[] accepts) {
+ if (accepts.length == 0) {
+ return null;
+ }
+ for (String accept : accepts) {
+ if (isJsonMime(accept)) {
+ return accept;
+ }
+ }
+ return StringUtil.join(accepts, ",");
+ }
+
+ /**
+ * Select the Content-Type header's value from the given array:
+ * if JSON exists in the given array, use it;
+ * otherwise use the first one of the array.
+ *
+ * @param contentTypes The Content-Type array to select from
+ * @return The Content-Type header to use. If the given array is empty,
+ * JSON will be used.
+ */
+ public String selectHeaderContentType(String[] contentTypes) {
+ if (contentTypes.length == 0) {
+ return "application/json";
+ }
+ for (String contentType : contentTypes) {
+ if (isJsonMime(contentType)) {
+ return contentType;
+ }
+ }
+ return contentTypes[0];
+ }
+
+ /**
+ * Escape the given string to be used as URL query value.
+ *
+ * @param str String
+ * @return Escaped string
+ */
+ public String escapeString(String str) {
+ try {
+ return URLEncoder.encode(str, "utf8").replaceAll("\\+", "%20");
+ } catch (UnsupportedEncodingException e) {
+ return str;
+ }
+ }
+
+ /**
+ * Serialize the given Java object into string entity according the given
+ * Content-Type (only JSON is supported for now).
+ *
+ * @param obj Object
+ * @param formParams Form parameters
+ * @param contentType Context type
+ * @return Entity
+ * @throws ApiException API exception
+ */
+ public Entity> serialize(Object obj, Map formParams, String contentType, boolean isBodyNullable) throws ApiException {
+ Entity> entity;
+ if (contentType.startsWith("multipart/form-data")) {
+ MultiPart multiPart = new MultiPart();
+ for (Entry param: formParams.entrySet()) {
+ if (param.getValue() instanceof File) {
+ File file = (File) param.getValue();
+ FormDataContentDisposition contentDisp = FormDataContentDisposition.name(param.getKey())
+ .fileName(file.getName()).size(file.length()).build();
+ multiPart.bodyPart(new FormDataBodyPart(contentDisp, file, MediaType.APPLICATION_OCTET_STREAM_TYPE));
+ } else {
+ FormDataContentDisposition contentDisp = FormDataContentDisposition.name(param.getKey()).build();
+ multiPart.bodyPart(new FormDataBodyPart(contentDisp, parameterToString(param.getValue())));
+ }
+ }
+ entity = Entity.entity(multiPart, MediaType.MULTIPART_FORM_DATA_TYPE);
+ } else if (contentType.startsWith("application/x-www-form-urlencoded")) {
+ Form form = new Form();
+ for (Entry param: formParams.entrySet()) {
+ form.param(param.getKey(), parameterToString(param.getValue()));
+ }
+ entity = Entity.entity(form, MediaType.APPLICATION_FORM_URLENCODED_TYPE);
+ } else {
+ // We let jersey handle the serialization
+ if (isBodyNullable) { // payload is nullable
+ if (obj instanceof String) {
+ entity = Entity.entity(obj == null ? "null" : "\"" + ((String)obj).replaceAll("\"", Matcher.quoteReplacement("\\\"")) + "\"", contentType);
+ } else {
+ entity = Entity.entity(obj == null ? "null" : obj, contentType);
+ }
+ } else {
+ if (obj instanceof String) {
+ entity = Entity.entity(obj == null ? "" : "\"" + ((String)obj).replaceAll("\"", Matcher.quoteReplacement("\\\"")) + "\"", contentType);
+ } else {
+ entity = Entity.entity(obj == null ? "" : obj, contentType);
+ }
+ }
+ }
+ return entity;
+ }
+
+ /**
+ * Serialize the given Java object into string according the given
+ * Content-Type (only JSON, HTTP form is supported for now).
+ *
+ * @param obj Object
+ * @param formParams Form parameters
+ * @param contentType Context type
+ * @param isBodyNullable True if the body is nullable
+ * @return String
+ * @throws ApiException API exception
+ */
+ public String serializeToString(Object obj, Map formParams, String contentType, boolean isBodyNullable) throws ApiException {
+ try {
+ if (contentType.startsWith("multipart/form-data")) {
+ throw new ApiException("multipart/form-data not yet supported for serializeToString (http signature authentication)");
+ } else if (contentType.startsWith("application/x-www-form-urlencoded")) {
+ String formString = "";
+ for (Entry param : formParams.entrySet()) {
+ formString = param.getKey() + "=" + URLEncoder.encode(parameterToString(param.getValue()), "UTF-8") + "&";
+ }
+
+ if (formString.length() == 0) { // empty string
+ return formString;
+ } else {
+ return formString.substring(0, formString.length() - 1);
+ }
+ } else {
+ if (isBodyNullable) {
+ return obj == null ? "null" : json.getMapper().writeValueAsString(obj);
+ } else {
+ return obj == null ? "" : json.getMapper().writeValueAsString(obj);
+ }
+ }
+ } catch (Exception ex) {
+ throw new ApiException("Failed to perform serializeToString: " + ex.toString());
+ }
+ }
+
+ /**
+ * Deserialize response body to Java object according to the Content-Type.
+ *
+ * @param Type
+ * @param response Response
+ * @param returnType Return type
+ * @return Deserialize object
+ * @throws ApiException API exception
+ */
+ @SuppressWarnings("unchecked")
+ public T deserialize(Response response, GenericType returnType) throws ApiException {
+ if (response == null || returnType == null) {
+ return null;
+ }
+
+ if ("byte[]".equals(returnType.toString())) {
+ // Handle binary response (byte array).
+ return (T) response.readEntity(byte[].class);
+ } else if (returnType.getRawType() == File.class) {
+ // Handle file downloading.
+ T file = (T) downloadFileFromResponse(response);
+ return file;
+ }
+
+ String contentType = null;
+ List contentTypes = response.getHeaders().get("Content-Type");
+ if (contentTypes != null && !contentTypes.isEmpty())
+ contentType = String.valueOf(contentTypes.get(0));
+
+ // read the entity stream multiple times
+ response.bufferEntity();
+
+ return response.readEntity(returnType);
+ }
+
+ /**
+ * 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(Response response) throws ApiException {
+ try {
+ File file = prepareDownloadFile(response);
+ Files.copy(response.readEntity(InputStream.class), file.toPath(), StandardCopyOption.REPLACE_EXISTING);
+ return file;
+ } catch (IOException e) {
+ throw new ApiException(e);
+ }
+ }
+
+ /**
+ * Prepare the file for download from the response.
+ *
+ * @param response a {@link jakarta.ws.rs.core.Response} object.
+ * @return a {@link java.io.File} object.
+ * @throws java.io.IOException if any.
+ */
+ public File prepareDownloadFile(Response response) throws IOException {
+ String filename = null;
+ String contentDisposition = (String) response.getHeaders().getFirst("Content-Disposition");
+ if (contentDisposition != null && !"".equals(contentDisposition)) {
+ // Get filename from the Content-Disposition header.
+ Pattern pattern = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?");
+ Matcher matcher = pattern.matcher(contentDisposition);
+ if (matcher.find())
+ filename = matcher.group(1);
+ }
+
+ String prefix;
+ String suffix = null;
+ if (filename == null) {
+ prefix = "download-";
+ suffix = "";
+ } else {
+ int pos = filename.lastIndexOf('.');
+ if (pos == -1) {
+ prefix = filename + "-";
+ } else {
+ prefix = filename.substring(0, pos) + "-";
+ suffix = filename.substring(pos);
+ }
+ // Files.createTempFile requires the prefix to be at least three characters long
+ if (prefix.length() < 3)
+ prefix = "download-";
+ }
+
+ if (tempFolderPath == null)
+ return Files.createTempFile(prefix, suffix).toFile();
+ else
+ return Files.createTempFile(Paths.get(tempFolderPath), prefix, suffix).toFile();
+ }
+
+ /**
+ * Invoke API by sending HTTP request with the given options.
+ *
+ * @param Type
+ * @param operation The qualified name of the operation
+ * @param path The sub-path of the HTTP URL
+ * @param method The request method, one of "GET", "POST", "PUT", "HEAD" and "DELETE"
+ * @param queryParams The query parameters
+ * @param body The request body object
+ * @param headerParams The header parameters
+ * @param cookieParams The cookie parameters
+ * @param formParams The form parameters
+ * @param accept The request's Accept header
+ * @param contentType The request's Content-Type header
+ * @param authNames The authentications to apply
+ * @param returnType The return type into which to deserialize the response
+ * @param isBodyNullable True if the body is nullable
+ * @return The response body in type of string
+ * @throws ApiException API exception
+ */
+ public ApiResponse invokeAPI(
+ String operation,
+ String path,
+ String method,
+ List queryParams,
+ Object body,
+ Map headerParams,
+ Map cookieParams,
+ Map formParams,
+ String accept,
+ String contentType,
+ String[] authNames,
+ GenericType returnType,
+ boolean isBodyNullable)
+ throws ApiException {
+
+ // Not using `.target(targetURL).path(path)` below,
+ // to support (constant) query string in `path`, e.g. "/posts?draft=1"
+ String targetURL;
+ if (serverIndex != null && operationServers.containsKey(operation)) {
+ Integer index = operationServerIndex.containsKey(operation) ? operationServerIndex.get(operation) : serverIndex;
+ Map variables = operationServerVariables.containsKey(operation) ?
+ operationServerVariables.get(operation) : serverVariables;
+ List serverConfigurations = operationServers.get(operation);
+ if (index < 0 || index >= serverConfigurations.size()) {
+ throw new ArrayIndexOutOfBoundsException(
+ String.format(
+ "Invalid index %d when selecting the host settings. Must be less than %d",
+ index, serverConfigurations.size()));
+ }
+ targetURL = serverConfigurations.get(index).URL(variables) + path;
+ } else {
+ targetURL = this.basePath + path;
+ }
+ WebTarget target = httpClient.target(targetURL);
+
+ if (queryParams != null) {
+ for (Pair queryParam : queryParams) {
+ if (queryParam.getValue() != null) {
+ target = target.queryParam(queryParam.getName(), escapeString(queryParam.getValue()));
+ }
+ }
+ }
+
+ Invocation.Builder invocationBuilder;
+ if (accept != null) {
+ invocationBuilder = target.request().accept(accept);
+ } else {
+ invocationBuilder = target.request();
+ }
+
+ for (Entry entry : cookieParams.entrySet()) {
+ String value = entry.getValue();
+ if (value != null) {
+ invocationBuilder = invocationBuilder.cookie(entry.getKey(), value);
+ }
+ }
+
+ for (Entry entry : defaultCookieMap.entrySet()) {
+ String value = entry.getValue();
+ if (value != null) {
+ invocationBuilder = invocationBuilder.cookie(entry.getKey(), value);
+ }
+ }
+
+ Entity> entity = serialize(body, formParams, contentType, isBodyNullable);
+
+ // put all headers in one place
+ Map allHeaderParams = new HashMap<>(defaultHeaderMap);
+ allHeaderParams.putAll(headerParams);
+
+ // update different parameters (e.g. headers) for authentication
+ updateParamsForAuth(
+ authNames,
+ queryParams,
+ allHeaderParams,
+ cookieParams,
+ serializeToString(body, formParams, contentType, isBodyNullable),
+ method,
+ target.getUri());
+
+ for (Entry entry : allHeaderParams.entrySet()) {
+ String value = entry.getValue();
+ if (value != null) {
+ invocationBuilder = invocationBuilder.header(entry.getKey(), value);
+ }
+ }
+
+ Response response = null;
+
+ try {
+ response = sendRequest(method, invocationBuilder, entity);
+
+ {{#hasOAuthMethods}}
+ // If OAuth is used and a status 401 is received, renew the access token and retry the request
+ if (response.getStatusInfo() == Status.UNAUTHORIZED) {
+ for (String authName : authNames) {
+ Authentication authentication = authentications.get(authName);
+ if (authentication instanceof OAuth) {
+ OAuth2AccessToken accessToken = ((OAuth) authentication).renewAccessToken();
+ if (accessToken != null) {
+ invocationBuilder.header("Authorization", null);
+ invocationBuilder.header("Authorization", "Bearer " + accessToken.getAccessToken());
+ response = sendRequest(method, invocationBuilder, entity);
+ }
+ break;
+ }
+ }
+ }
+
+ {{/hasOAuthMethods}}
+ int statusCode = response.getStatusInfo().getStatusCode();
+ Map> responseHeaders = buildResponseHeaders(response);
+
+ if (response.getStatusInfo() == Status.NO_CONTENT) {
+ return new ApiResponse(statusCode, responseHeaders);
+ } else if (response.getStatusInfo().getFamily() == Status.Family.SUCCESSFUL) {
+ if (returnType == null) {
+ return new ApiResponse(statusCode, responseHeaders);
+ } else {
+ return new ApiResponse(statusCode, responseHeaders, deserialize(response, returnType));
+ }
+ } else {
+ String message = "error";
+ String respBody = null;
+ if (response.hasEntity()) {
+ try {
+ respBody = String.valueOf(response.readEntity(String.class));
+ message = respBody;
+ } catch (RuntimeException e) {
+ // e.printStackTrace();
+ }
+ }
+ throw new ApiException(
+ response.getStatus(), message, buildResponseHeaders(response), respBody);
+ }
+ } finally {
+ try {
+ response.close();
+ } catch (Exception e) {
+ // it's not critical, since the response object is local in method invokeAPI; that's fine,
+ // just continue
+ }
+ }
+ }
+
+ private Response sendRequest(String method, Invocation.Builder invocationBuilder, Entity> entity) {
+ Response response;
+ if ("POST".equals(method)) {
+ response = invocationBuilder.post(entity);
+ } else if ("PUT".equals(method)) {
+ response = invocationBuilder.put(entity);
+ } else if ("DELETE".equals(method)) {
+ response = invocationBuilder.method("DELETE", entity);
+ } else if ("PATCH".equals(method)) {
+ response = invocationBuilder.method("PATCH", entity);
+ } else {
+ response = invocationBuilder.method(method);
+ }
+ return response;
+ }
+
+ /**
+ * @deprecated Add qualified name of the operation as a first parameter.
+ */
+ @Deprecated
+ public ApiResponse invokeAPI(String path, String method, List queryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String accept, String contentType, String[] authNames, GenericType returnType, boolean isBodyNullable) throws ApiException {
+ return invokeAPI(null, path, method, queryParams, body, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType, isBodyNullable);
+ }
+
+ /**
+ * Build the Client used to make HTTP requests.
+ *
+ * @return Client
+ */
+ protected Client buildHttpClient() {
+ // recreate the client config to pickup changes
+ clientConfig = getDefaultClientConfig();
+
+ ClientBuilder clientBuilder = ClientBuilder.newBuilder();
+ customizeClientBuilder(clientBuilder);
+ clientBuilder = clientBuilder.withConfig(clientConfig);
+ return clientBuilder.build();
+ }
+
+ /**
+ * Get the default client config.
+ *
+ * @return Client config
+ */
+ public ClientConfig getDefaultClientConfig() {
+ ClientConfig clientConfig = new ClientConfig();
+ clientConfig.register(MultiPartFeature.class);
+ clientConfig.register(json);
+ clientConfig.register(JacksonFeature.class);
+ clientConfig.property(HttpUrlConnectorProvider.SET_METHOD_WORKAROUND, true);
+ // turn off compliance validation to be able to send payloads with DELETE calls
+ clientConfig.property(ClientProperties.SUPPRESS_HTTP_COMPLIANCE_VALIDATION, true);
+ if (debugging) {
+ clientConfig.register(new LoggingFeature(java.util.logging.Logger.getLogger(LoggingFeature.DEFAULT_LOGGER_NAME), java.util.logging.Level.INFO, LoggingFeature.Verbosity.PAYLOAD_ANY, 1024*50 /* Log payloads up to 50K */));
+ clientConfig.property(LoggingFeature.LOGGING_FEATURE_VERBOSITY, LoggingFeature.Verbosity.PAYLOAD_ANY);
+ // Set logger to ALL
+ java.util.logging.Logger.getLogger(LoggingFeature.DEFAULT_LOGGER_NAME).setLevel(java.util.logging.Level.ALL);
+ } else {
+ // suppress warnings for payloads with DELETE calls:
+ java.util.logging.Logger.getLogger("org.glassfish.jersey.client").setLevel(java.util.logging.Level.SEVERE);
+ }
+
+ return clientConfig;
+ }
+
+ /**
+ * Customize the client builder.
+ *
+ * This method can be overridden to customize the API client. For example, this can be used to:
+ * 1. Set the hostname verifier to be used by the client to verify the endpoint's hostname
+ * against its identification information.
+ * 2. Set the client-side key store.
+ * 3. Set the SSL context that will be used when creating secured transport connections to
+ * server endpoints from web targets created by the client instance that is using this SSL context.
+ * 4. Set the client-side trust store.
+ *
+ * To completely disable certificate validation (at your own risk), you can
+ * override this method and invoke disableCertificateValidation(clientBuilder).
+ *
+ * @param clientBuilder a {@link jakarta.ws.rs.client.ClientBuilder} object.
+ */
+ protected void customizeClientBuilder(ClientBuilder clientBuilder) {
+ // No-op extension point
+ }
+
+ /**
+ * Disable X.509 certificate validation in TLS connections.
+ *
+ * Please note that trusting all certificates is extremely risky.
+ * This may be useful in a development environment with self-signed certificates.
+ *
+ * @param clientBuilder a {@link jakarta.ws.rs.client.ClientBuilder} object.
+ * @throws java.security.KeyManagementException if any.
+ * @throws java.security.NoSuchAlgorithmException if any.
+ */
+ protected void disableCertificateValidation(ClientBuilder clientBuilder) throws KeyManagementException, NoSuchAlgorithmException {
+ TrustManager[] trustAllCerts = new X509TrustManager[] {
+ new X509TrustManager() {
+ @Override
+ public X509Certificate[] getAcceptedIssuers() {
+ return null;
+ }
+ @Override
+ public void checkClientTrusted(X509Certificate[] certs, String authType) {
+ }
+ @Override
+ public void checkServerTrusted(X509Certificate[] certs, String authType) {
+ }
+ }
+ };
+ SSLContext sslContext = SSLContext.getInstance("TLS");
+ sslContext.init(null, trustAllCerts, new SecureRandom());
+ clientBuilder.sslContext(sslContext);
+ }
+
+ /**
+ * Build the response headers.
+ *
+ * @param response a {@link jakarta.ws.rs.core.Response} object.
+ * @return a {@link java.util.Map} of response headers.
+ */
+ protected Map> buildResponseHeaders(Response response) {
+ Map> responseHeaders = new HashMap>();
+ for (Entry> entry: response.getHeaders().entrySet()) {
+ List values = entry.getValue();
+ List headers = new ArrayList();
+ for (Object o : values) {
+ headers.add(String.valueOf(o));
+ }
+ responseHeaders.put(entry.getKey(), headers);
+ }
+ return responseHeaders;
+ }
+
+ /**
+ * Update query and header parameters based on authentication settings.
+ *
+ * @param authNames The authentications to apply
+ * @param queryParams List of query parameters
+ * @param headerParams Map of header parameters
+ * @param cookieParams Map of cookie parameters
+ * @param method HTTP method (e.g. POST)
+ * @param uri HTTP URI
+ */
+ protected void updateParamsForAuth(String[] authNames, List queryParams, Map headerParams,
+ Map cookieParams, String payload, String method, URI uri) throws ApiException {
+ for (String authName : authNames) {
+ Authentication auth = authentications.get(authName);
+ if (auth == null) {
+ continue;
+ }
+ auth.applyToParams(queryParams, headerParams, cookieParams, payload, method, uri);
+ }
+ }
+}
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/ApiResponse.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/ApiResponse.mustache
new file mode 100644
index 000000000000..86c889b0f67b
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/ApiResponse.mustache
@@ -0,0 +1,73 @@
+{{>licenseInfo}}
+
+package {{invokerPackage}};
+
+import java.util.List;
+import java.util.Map;
+{{#caseInsensitiveResponseHeaders}}
+import java.util.Map.Entry;
+import java.util.TreeMap;
+{{/caseInsensitiveResponseHeaders}}
+
+/**
+ * API response returned by API call.
+ *
+ * @param The type of data that is deserialized from response body
+ */
+public class ApiResponse {
+ private final int statusCode;
+ private final Map> headers;
+ private final 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;
+ {{#caseInsensitiveResponseHeaders}}
+ Map> responseHeaders = new TreeMap>(String.CASE_INSENSITIVE_ORDER);
+ for(Entry> entry : headers.entrySet()){
+ responseHeaders.put(entry.getKey().toLowerCase(), entry.getValue());
+ }
+ {{/caseInsensitiveResponseHeaders}}
+ this.headers = {{#caseInsensitiveResponseHeaders}}responseHeaders{{/caseInsensitiveResponseHeaders}}{{^caseInsensitiveResponseHeaders}}headers{{/caseInsensitiveResponseHeaders}};
+ this.data = data;
+ }
+
+ /**
+ * Get the status code
+ *
+ * @return status code
+ */
+ public int getStatusCode() {
+ return statusCode;
+ }
+
+ /**
+ * Get the headers
+ *
+ * @return map of headers
+ */
+ public Map> getHeaders() {
+ return headers;
+ }
+
+ /**
+ * Get the data
+ *
+ * @return data
+ */
+ public T getData() {
+ return data;
+ }
+}
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/JSON.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/JSON.mustache
new file mode 100644
index 000000000000..aea0628ac378
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/JSON.mustache
@@ -0,0 +1,261 @@
+package {{invokerPackage}};
+
+import com.fasterxml.jackson.annotation.*;
+import com.fasterxml.jackson.databind.*;
+import com.fasterxml.jackson.databind.json.JsonMapper;
+{{#openApiNullable}}
+import org.openapitools.jackson.nullable.JsonNullableModule;
+{{/openApiNullable}}
+import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
+{{#joda}}
+import com.fasterxml.jackson.datatype.joda.JodaModule;
+{{/joda}}
+{{#models.0}}
+import {{modelPackage}}.*;
+{{/models.0}}
+
+import java.text.DateFormat;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import jakarta.ws.rs.core.GenericType;
+import jakarta.ws.rs.ext.ContextResolver;
+
+{{>generatedAnnotation}}
+public class JSON implements ContextResolver {
+ private ObjectMapper mapper;
+
+ public JSON() {
+ mapper = new ObjectMapper();
+ mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
+ JsonMapper.builder().configure(MapperFeature.ALLOW_COERCION_OF_SCALARS, false);
+ mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, true);
+ mapper.configure(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE, true);
+ mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
+ mapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING);
+ mapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING);
+ mapper.setDateFormat(new RFC3339DateFormat());
+ mapper.registerModule(new JavaTimeModule());
+ {{#joda}}
+ mapper.registerModule(new JodaModule());
+ {{/joda}}
+ {{#openApiNullable}}
+ JsonNullableModule jnm = new JsonNullableModule();
+ mapper.registerModule(jnm);
+ {{/openApiNullable}}
+ }
+
+ /**
+ * Set the date format for JSON (de)serialization with Date properties.
+ * @param dateFormat Date format
+ */
+ public void setDateFormat(DateFormat dateFormat) {
+ mapper.setDateFormat(dateFormat);
+ }
+
+ @Override
+ public ObjectMapper getContext(Class> type) {
+ return mapper;
+ }
+
+ /**
+ * 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.
+ */
+ 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.
+ */
+ 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.
+ */
+ 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.
+ */
+ 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 (GenericType childType : descendants.values()) {
+ if (isInstanceOf(childType.getRawType(), inst, visitedClasses)) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ /**
+ * A map of discriminators for all model classes.
+ */
+ private static Map, ClassDiscriminatorMapping> modelDiscriminators = new HashMap, ClassDiscriminatorMapping>();
+
+ /**
+ * A map of oneOf/anyOf descendants for each model class.
+ */
+ private static Map, Map> modelDescendants = new HashMap, Map>();
+
+ /**
+ * 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/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/additional_properties.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/additional_properties.mustache
new file mode 100644
index 000000000000..61973dc24fa1
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/additional_properties.mustache
@@ -0,0 +1,39 @@
+{{#additionalPropertiesType}}
+ /**
+ * A container for additional, undeclared properties.
+ * This is a holder for any undeclared properties as specified with
+ * the 'additionalProperties' keyword in the OAS document.
+ */
+ private Map additionalProperties;
+
+ /**
+ * Set the additional (undeclared) property with the specified name and value.
+ * If the property does not already exist, create it otherwise replace it.
+ */
+ @JsonAnySetter
+ public {{classname}} putAdditionalProperty(String key, {{{.}}} value) {
+ if (this.additionalProperties == null) {
+ this.additionalProperties = new HashMap();
+ }
+ this.additionalProperties.put(key, value);
+ return this;
+ }
+
+ /**
+ * Return the additional (undeclared) property.
+ */
+ @JsonAnyGetter
+ public Map getAdditionalProperties() {
+ return additionalProperties;
+ }
+
+ /**
+ * Return the additional (undeclared) property with the specified name.
+ */
+ public {{{.}}} getAdditionalProperty(String key) {
+ if (this.additionalProperties == null) {
+ return null;
+ }
+ return this.additionalProperties.get(key);
+ }
+{{/additionalPropertiesType}}
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/anyof_model.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/anyof_model.mustache
new file mode 100644
index 000000000000..2e14233bb93f
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/anyof_model.mustache
@@ -0,0 +1,202 @@
+import jakarta.ws.rs.core.GenericType;
+import jakarta.ws.rs.core.Response;
+import java.io.IOException;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashSet;
+
+import com.fasterxml.jackson.core.JsonGenerator;
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.core.type.TypeReference;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import com.fasterxml.jackson.databind.JsonMappingException;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.SerializerProvider;
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
+import com.fasterxml.jackson.databind.ser.std.StdSerializer;
+import {{invokerPackage}}.JSON;
+
+{{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{>xmlAnnotation}}
+@JsonDeserialize(using={{classname}}.{{classname}}Deserializer.class)
+@JsonSerialize(using = {{classname}}.{{classname}}Serializer.class)
+public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-implements}}, {{{.}}}{{/vendorExtensions.x-implements}} {
+ private static final Logger log = Logger.getLogger({{classname}}.class.getName());
+
+ public static class {{classname}}Serializer extends StdSerializer<{{classname}}> {
+ public {{classname}}Serializer(Class<{{classname}}> t) {
+ super(t);
+ }
+
+ public {{classname}}Serializer() {
+ this(null);
+ }
+
+ @Override
+ public void serialize({{classname}} value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException {
+ jgen.writeObject(value.getActualInstance());
+ }
+ }
+
+ public static class {{classname}}Deserializer extends StdDeserializer<{{classname}}> {
+ public {{classname}}Deserializer() {
+ this({{classname}}.class);
+ }
+
+ public {{classname}}Deserializer(Class> vc) {
+ super(vc);
+ }
+
+ @Override
+ public {{classname}} deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException {
+ JsonNode tree = jp.readValueAsTree();
+
+ Object deserialized = null;
+ {{#discriminator}}
+ Class> cls = JSON.getClassForElement(tree, {{classname}}.class);
+ if (cls != null) {
+ // When the OAS schema includes a discriminator, use the discriminator value to
+ // discriminate the anyOf schemas.
+ // Get the discriminator mapping value to get the class.
+ deserialized = tree.traverse(jp.getCodec()).readValueAs(cls);
+ {{classname}} ret = new {{classname}}();
+ ret.setActualInstance(deserialized);
+ return ret;
+ }
+ {{/discriminator}}
+ {{#anyOf}}
+ // deserialize {{{.}}}
+ try {
+ deserialized = tree.traverse(jp.getCodec()).readValueAs({{{.}}}.class);
+ {{classname}} ret = new {{classname}}();
+ ret.setActualInstance(deserialized);
+ return ret;
+ } catch (Exception e) {
+ // deserialization failed, continue, log to help debugging
+ log.log(Level.FINER, "Input data does not match '{{classname}}'", e);
+ }
+
+ {{/anyOf}}
+ throw new IOException(String.format("Failed deserialization for {{classname}}: no match found"));
+ }
+
+ /**
+ * Handle deserialization of the 'null' value.
+ */
+ @Override
+ public {{classname}} getNullValue(DeserializationContext ctxt) throws JsonMappingException {
+ {{#isNullable}}
+ return null;
+ {{/isNullable}}
+ {{^isNullable}}
+ throw new JsonMappingException(ctxt.getParser(), "{{classname}} cannot be null");
+ {{/isNullable}}
+ }
+ }
+
+ // store a list of schema names defined in anyOf
+ public static final Map schemas = new HashMap();
+
+ public {{classname}}() {
+ super("anyOf", {{#isNullable}}Boolean.TRUE{{/isNullable}}{{^isNullable}}Boolean.FALSE{{/isNullable}});
+ }
+{{> libraries/jersey2/additional_properties }}
+ {{#additionalPropertiesType}}
+ /**
+ * Return true if this {{name}} object is equal to o.
+ */
+ @Override
+ public boolean equals(Object o) {
+ return super.equals(o) && Objects.equals(this.additionalProperties, (({{classname}})o).additionalProperties);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(getActualInstance(), isNullable(), getSchemaType(), additionalProperties);
+ }
+ {{/additionalPropertiesType}}
+ {{#anyOf}}
+ public {{classname}}({{{.}}} o) {
+ super("anyOf", {{#isNullable}}Boolean.TRUE{{/isNullable}}{{^isNullable}}Boolean.FALSE{{/isNullable}});
+ setActualInstance(o);
+ }
+
+ {{/anyOf}}
+ static {
+ {{#anyOf}}
+ schemas.put("{{{.}}}", new GenericType<{{{.}}}>() {
+ });
+ {{/anyOf}}
+ JSON.registerDescendants({{classname}}.class, Collections.unmodifiableMap(schemas));
+ {{#discriminator}}
+ // Initialize and register the discriminator mappings.
+ Map> mappings = new HashMap>();
+ {{#mappedModels}}
+ mappings.put("{{mappingName}}", {{modelName}}.class);
+ {{/mappedModels}}
+ mappings.put("{{name}}", {{classname}}.class);
+ JSON.registerDiscriminator({{classname}}.class, "{{propertyBaseName}}", mappings);
+ {{/discriminator}}
+ }
+
+ @Override
+ public Map getSchemas() {
+ return {{classname}}.schemas;
+ }
+
+ /**
+ * Set the instance that matches the anyOf child schema, check
+ * the instance parameter is valid against the anyOf child schemas:
+ * {{#anyOf}}{{{.}}}{{^-last}}, {{/-last}}{{/anyOf}}
+ *
+ * It could be an instance of the 'anyOf' schemas.
+ * The anyOf child schemas may themselves be a composed schema (allOf, anyOf, anyOf).
+ */
+ @Override
+ public void setActualInstance(Object instance) {
+ {{#isNullable}}
+ if (instance == null) {
+ super.setActualInstance(instance);
+ return;
+ }
+
+ {{/isNullable}}
+ {{#anyOf}}
+ if (JSON.isInstanceOf({{{.}}}.class, instance, new HashSet>())) {
+ super.setActualInstance(instance);
+ return;
+ }
+
+ {{/anyOf}}
+ throw new RuntimeException("Invalid instance type. Must be {{#anyOf}}{{{.}}}{{^-last}}, {{/-last}}{{/anyOf}}");
+ }
+
+ /**
+ * Get the actual instance, which can be the following:
+ * {{#anyOf}}{{{.}}}{{^-last}}, {{/-last}}{{/anyOf}}
+ *
+ * @return The actual instance ({{#anyOf}}{{{.}}}{{^-last}}, {{/-last}}{{/anyOf}})
+ */
+ @Override
+ public Object getActualInstance() {
+ return super.getActualInstance();
+ }
+
+ {{#anyOf}}
+ /**
+ * Get the actual instance of `{{{.}}}`. If the actual instance is not `{{{.}}}`,
+ * the ClassCastException will be thrown.
+ *
+ * @return The actual instance of `{{{.}}}`
+ * @throws ClassCastException if the instance is not `{{{.}}}`
+ */
+ public {{{.}}} get{{{.}}}() throws ClassCastException {
+ return ({{{.}}})super.getActualInstance();
+ }
+
+ {{/anyOf}}
+}
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/api.mustache
new file mode 100644
index 000000000000..16cd00688679
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/api.mustache
@@ -0,0 +1,262 @@
+package {{package}};
+
+import {{invokerPackage}}.ApiException;
+import {{invokerPackage}}.ApiClient;
+import {{invokerPackage}}.ApiResponse;
+import {{invokerPackage}}.Configuration;
+import {{invokerPackage}}.Pair;
+
+import jakarta.ws.rs.core.GenericType;
+
+{{#imports}}import {{import}};
+{{/imports}}
+
+{{^fullJavaUtil}}
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+{{/fullJavaUtil}}
+{{>generatedAnnotation}}
+{{#operations}}
+public class {{classname}} {
+ private ApiClient apiClient;
+
+ public {{classname}}() {
+ this(Configuration.getDefaultApiClient());
+ }
+
+ public {{classname}}(ApiClient apiClient) {
+ this.apiClient = apiClient;
+ }
+
+ /**
+ * Get the API client
+ *
+ * @return API client
+ */
+ public ApiClient getApiClient() {
+ return apiClient;
+ }
+
+ /**
+ * Set the API client
+ *
+ * @param apiClient an instance of API client
+ */
+ public void setApiClient(ApiClient apiClient) {
+ this.apiClient = apiClient;
+ }
+
+ {{#operation}}
+ {{^vendorExtensions.x-group-parameters}}
+ /**
+ * {{summary}}
+ * {{notes}}
+ {{#allParams}}
+ * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}
+ {{/allParams}}
+ {{#returnType}}
+ * @return {{.}}
+ {{/returnType}}
+ * @throws ApiException if fails to make API call
+ {{#responses.0}}
+ * @http.response.details
+
+ Status Code Description Response Headers
+ {{#responses}}
+ {{code}} {{message}} {{#headers}} * {{baseName}} - {{description}} {{/headers}}{{^headers.0}} - {{/headers.0}}
+ {{/responses}}
+
+ {{/responses.0}}
+ {{#isDeprecated}}
+ * @deprecated
+ {{/isDeprecated}}
+ {{#externalDocs}}
+ * {{description}}
+ * @see {{summary}} Documentation
+ {{/externalDocs}}
+ */
+ {{#isDeprecated}}
+ @Deprecated
+ {{/isDeprecated}}
+ public {{#returnType}}{{{.}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException {
+ {{#returnType}}return {{/returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}){{#returnType}}.getData(){{/returnType}};
+ }
+ {{/vendorExtensions.x-group-parameters}}
+
+ {{^vendorExtensions.x-group-parameters}}
+ /**
+ * {{summary}}
+ * {{notes}}
+ {{#allParams}}
+ * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}
+ {{/allParams}}
+ * @return ApiResponse<{{returnType}}{{^returnType}}Void{{/returnType}}>
+ * @throws ApiException if fails to make API call
+ {{#responses.0}}
+ * @http.response.details
+
+ Status Code Description Response Headers
+ {{#responses}}
+ {{code}} {{message}} {{#headers}} * {{baseName}} - {{description}} {{/headers}}{{^headers.0}} - {{/headers.0}}
+ {{/responses}}
+
+ {{/responses.0}}
+ {{#isDeprecated}}
+ * @deprecated
+ {{/isDeprecated}}
+ {{#externalDocs}}
+ * {{description}}
+ * @see {{summary}} Documentation
+ {{/externalDocs}}
+ */
+ {{#isDeprecated}}
+ @Deprecated
+ {{/isDeprecated}}
+ public{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}private{{/vendorExtensions.x-group-parameters}} ApiResponse<{{{returnType}}}{{^returnType}}Void{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException {
+ Object localVarPostBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}};
+ {{#allParams}}{{#required}}
+ // verify the required parameter '{{paramName}}' is set
+ if ({{paramName}} == null) {
+ throw new ApiException(400, "Missing the required parameter '{{paramName}}' when calling {{operationId}}");
+ }
+ {{/required}}{{/allParams}}
+ // create path and map variables
+ String localVarPath = "{{{path}}}"{{#pathParams}}
+ .replaceAll("\\{" + "{{baseName}}" + "\\}", apiClient.escapeString({{{paramName}}}.toString())){{/pathParams}};
+
+ // query params
+ {{javaUtilPrefix}}List localVarQueryParams = new {{javaUtilPrefix}}ArrayList();
+ {{javaUtilPrefix}}Map localVarHeaderParams = new {{javaUtilPrefix}}HashMap();
+ {{javaUtilPrefix}}Map localVarCookieParams = new {{javaUtilPrefix}}HashMap();
+ {{javaUtilPrefix}}Map localVarFormParams = new {{javaUtilPrefix}}HashMap();
+
+ {{#queryParams}}
+ localVarQueryParams.addAll(apiClient.parameterToPairs("{{{collectionFormat}}}", "{{baseName}}", {{paramName}}));
+ {{/queryParams}}
+
+ {{#headerParams}}if ({{paramName}} != null)
+ localVarHeaderParams.put("{{baseName}}", apiClient.parameterToString({{paramName}}));
+ {{/headerParams}}
+
+ {{#cookieParams}}if ({{paramName}} != null)
+ localVarCookieParams.put("{{baseName}}", apiClient.parameterToString({{paramName}}));
+ {{/cookieParams}}
+
+ {{#formParams}}if ({{paramName}} != null)
+ localVarFormParams.put("{{baseName}}", {{paramName}});
+ {{/formParams}}
+
+ final String[] localVarAccepts = {
+ {{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}}
+ };
+ final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
+
+ final String[] localVarContentTypes = {
+ {{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}}
+ };
+ final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
+
+ String[] localVarAuthNames = new String[] { {{#authMethods}}"{{name}}"{{^-last}}, {{/-last}}{{/authMethods}} };
+
+ {{#returnType}}
+ GenericType<{{{returnType}}}> localVarReturnType = new GenericType<{{{returnType}}}>() {};
+
+ {{/returnType}}
+ return apiClient.invokeAPI("{{classname}}.{{operationId}}", localVarPath, "{{httpMethod}}", localVarQueryParams, localVarPostBody,
+ localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType,
+ localVarAuthNames, {{#returnType}}localVarReturnType{{/returnType}}{{^returnType}}null{{/returnType}}, {{#bodyParam}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/bodyParam}}{{^bodyParam}}false{{/bodyParam}});
+ }
+ {{#vendorExtensions.x-group-parameters}}
+
+ public class API{{operationId}}Request {
+ {{#allParams}}
+ private {{#isRequired}}final {{/isRequired}}{{{dataType}}} {{paramName}};
+ {{/allParams}}
+
+ private API{{operationId}}Request({{#pathParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/pathParams}}) {
+ {{#pathParams}}
+ this.{{paramName}} = {{paramName}};
+ {{/pathParams}}
+ }
+ {{#allParams}}
+ {{^isPathParam}}
+
+ /**
+ * Set {{paramName}}
+ * @param {{paramName}} {{description}} ({{^required}}optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}{{/isContainer}}{{/required}}{{#required}}required{{/required}})
+ * @return API{{operationId}}Request
+ */
+ public API{{operationId}}Request {{paramName}}({{{dataType}}} {{paramName}}) {
+ this.{{paramName}} = {{paramName}};
+ return this;
+ }
+ {{/isPathParam}}
+ {{/allParams}}
+
+ /**
+ * Execute {{operationId}} request
+ {{#returnType}}* @return {{.}}{{/returnType}}
+ * @throws ApiException if fails to make API call
+ {{#responses.0}}
+ * @http.response.details
+
+ Status Code Description Response Headers
+ {{#responses}}
+ {{code}} {{message}} {{#headers}} * {{baseName}} - {{description}} {{/headers}}{{^headers.0}} - {{/headers.0}}
+ {{/responses}}
+
+ {{/responses.0}}
+ {{#isDeprecated}}* @deprecated{{/isDeprecated}}
+ */
+ {{#isDeprecated}}@Deprecated{{/isDeprecated}}
+ public {{{returnType}}}{{^returnType}}void{{/returnType}} execute() throws ApiException {
+ {{#returnType}}return {{/returnType}}this.executeWithHttpInfo().getData();
+ }
+
+ /**
+ * Execute {{operationId}} request with HTTP info returned
+ * @return ApiResponse<{{returnType}}{{^returnType}}Void{{/returnType}}>
+ * @throws ApiException if fails to make API call
+ {{#responses.0}}
+ * @http.response.details
+
+ Status Code Description Response Headers
+ {{#responses}}
+ {{code}} {{message}} {{#headers}} * {{baseName}} - {{description}} {{/headers}}{{^headers.0}} - {{/headers.0}}
+ {{/responses}}
+
+ {{/responses.0}}
+ {{#isDeprecated}}
+ * @deprecated{{/isDeprecated}}
+ */
+ {{#isDeprecated}}
+ @Deprecated
+ {{/isDeprecated}}
+ public ApiResponse<{{{returnType}}}{{^returnType}}Void{{/returnType}}> executeWithHttpInfo() throws ApiException {
+ return {{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});
+ }
+ }
+
+ /**
+ * {{summary}}
+ * {{notes}}{{#pathParams}}
+ * @param {{paramName}} {{description}} (required){{/pathParams}}
+ * @return {{operationId}}Request
+ * @throws ApiException if fails to make API call
+ {{#isDeprecated}}* @deprecated{{/isDeprecated}}
+ {{#externalDocs}}* {{description}}
+ * @see {{summary}} Documentation {{/externalDocs}}
+ */
+ {{#isDeprecated}}
+ @Deprecated
+ {{/isDeprecated}}
+ public API{{operationId}}Request {{operationId}}({{#pathParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/pathParams}}) throws ApiException {
+ return new API{{operationId}}Request({{#pathParams}}{{paramName}}{{^-last}}, {{/-last}}{{/pathParams}});
+ }
+ {{/vendorExtensions.x-group-parameters}}
+ {{/operation}}
+}
+{{/operations}}
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/apiException.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/apiException.mustache
new file mode 100644
index 000000000000..74a419aacf16
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/apiException.mustache
@@ -0,0 +1,99 @@
+{{>licenseInfo}}
+
+package {{invokerPackage}};
+
+import java.util.Map;
+import java.util.List;
+{{#caseInsensitiveResponseHeaders}}
+import java.util.Map.Entry;
+import java.util.TreeMap;
+{{/caseInsensitiveResponseHeaders}}
+
+/**
+ * API Exception
+ */
+{{>generatedAnnotation}}
+public class ApiException extends{{#useRuntimeException}} RuntimeException {{/useRuntimeException}}{{^useRuntimeException}} Exception {{/useRuntimeException}}{
+ private int code = 0;
+ private Map> 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, Map> responseHeaders, String responseBody) {
+ super(message, throwable);
+ this.code = code;
+ {{#caseInsensitiveResponseHeaders}}
+ Map> headers = new TreeMap>(String.CASE_INSENSITIVE_ORDER);
+ for(Entry> entry : responseHeaders.entrySet()){
+ headers.put(entry.getKey().toLowerCase(), entry.getValue());
+ }
+ {{/caseInsensitiveResponseHeaders}}
+ this.responseHeaders = {{#caseInsensitiveResponseHeaders}}headers{{/caseInsensitiveResponseHeaders}}{{^caseInsensitiveResponseHeaders}}responseHeaders{{/caseInsensitiveResponseHeaders}};
+ this.responseBody = responseBody;
+ }
+
+ public ApiException(String message, int code, Map> responseHeaders, String responseBody) {
+ this(message, (Throwable) null, code, responseHeaders, responseBody);
+ }
+
+ public ApiException(String message, Throwable throwable, int code, Map> responseHeaders) {
+ this(message, throwable, code, responseHeaders, null);
+ }
+
+ public ApiException(int code, Map> 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, Map> responseHeaders, String responseBody) {
+ this(code, message);
+ {{#caseInsensitiveResponseHeaders}}
+ Map> headers = new TreeMap>(String.CASE_INSENSITIVE_ORDER);
+ for(Entry> entry : responseHeaders.entrySet()){
+ headers.put(entry.getKey().toLowerCase(), entry.getValue());
+ }
+ {{/caseInsensitiveResponseHeaders}}
+ this.responseHeaders = {{#caseInsensitiveResponseHeaders}}headers{{/caseInsensitiveResponseHeaders}}{{^caseInsensitiveResponseHeaders}}responseHeaders{{/caseInsensitiveResponseHeaders}};
+ this.responseBody = responseBody;
+ }
+
+ /**
+ * Get the HTTP status code.
+ *
+ * @return HTTP status code
+ */
+ public int getCode() {
+ return code;
+ }
+
+ /**
+ * Get the HTTP response headers.
+ *
+ * @return A map of list of string
+ */
+ public Map> getResponseHeaders() {
+ return responseHeaders;
+ }
+
+ /**
+ * Get the HTTP response body.
+ *
+ * @return Response body in the form of string
+ */
+ public String getResponseBody() {
+ return responseBody;
+ }
+}
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/api_doc.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/api_doc.mustache
new file mode 100644
index 000000000000..26c98508ea1d
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/api_doc.mustache
@@ -0,0 +1,124 @@
+# {{classname}}{{#description}}
+
+{{.}}{{/description}}
+
+All URIs are relative to *{{basePath}}*
+
+| Method | HTTP request | Description |
+|------------- | ------------- | -------------|
+{{#operations}}{{#operation}}| [**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} |
+{{/operation}}{{/operations}}
+
+{{#operations}}
+{{#operation}}
+
+## {{operationId}}
+
+{{^vendorExtensions.x-group-parameters}}
+> {{#returnType}}{{.}} {{/returnType}}{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}})
+{{/vendorExtensions.x-group-parameters}}
+{{#vendorExtensions.x-group-parameters}}
+> {{#returnType}}{{.}} {{/returnType}}{{operationId}}({{#pathParams}}{{paramName}}{{^-last}}, {{/-last}}{{/pathParams}}){{#allParams}}{{^isPathParam}}.{{paramName}}({{paramName}}){{/isPathParam}}{{/allParams}}.execute();
+{{/vendorExtensions.x-group-parameters}}
+
+{{summary}}{{#notes}}
+
+{{{unescapedNotes}}}{{/notes}}
+
+### Example
+
+```java
+{{#vendorExtensions.x-java-import}}
+import {{.}};
+{{/vendorExtensions.x-java-import}}
+// Import classes:
+import {{{invokerPackage}}}.ApiClient;
+import {{{invokerPackage}}}.ApiException;
+import {{{invokerPackage}}}.Configuration;{{#hasAuthMethods}}
+import {{{invokerPackage}}}.auth.*;{{/hasAuthMethods}}
+import {{{invokerPackage}}}.model.*;
+import {{{package}}}.{{{classname}}};
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("{{{basePath}}}");
+ {{#hasAuthMethods}}
+ {{#authMethods}}{{#isBasic}}{{#isBasicBasic}}
+ // Configure HTTP basic authorization: {{{name}}}
+ HttpBasicAuth {{{name}}} = (HttpBasicAuth) defaultClient.getAuthentication("{{{name}}}");
+ {{{name}}}.setUsername("YOUR USERNAME");
+ {{{name}}}.setPassword("YOUR PASSWORD");{{/isBasicBasic}}{{#isBasicBearer}}
+ // Configure HTTP bearer authorization: {{{name}}}
+ HttpBearerAuth {{{name}}} = (HttpBearerAuth) defaultClient.getAuthentication("{{{name}}}");
+ {{{name}}}.setBearerToken("BEARER TOKEN");{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}}
+ // Configure API key authorization: {{{name}}}
+ ApiKeyAuth {{{name}}} = (ApiKeyAuth) defaultClient.getAuthentication("{{{name}}}");
+ {{{name}}}.setApiKey("YOUR API KEY");
+ // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
+ //{{{name}}}.setApiKeyPrefix("Token");{{/isApiKey}}{{#isOAuth}}
+ // Configure OAuth2 access token for authorization: {{{name}}}
+ OAuth {{{name}}} = (OAuth) defaultClient.getAuthentication("{{{name}}}");
+ {{{name}}}.setAccessToken("YOUR ACCESS TOKEN");{{/isOAuth}}
+ {{/authMethods}}
+ {{/hasAuthMethods}}
+
+ {{{classname}}} apiInstance = new {{{classname}}}(defaultClient);
+ {{#allParams}}
+ {{{dataType}}} {{{paramName}}} = {{{example}}}; // {{{dataType}}} | {{{description}}}
+ {{/allParams}}
+ try {
+ {{^vendorExtensions.x-group-parameters}}
+ {{#returnType}}{{{.}}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}});
+ {{/vendorExtensions.x-group-parameters}}
+ {{#vendorExtensions.x-group-parameters}}
+ {{#returnType}}{{{.}}} result = {{/returnType}}api.{{operationId}}({{#pathParams}}{{paramName}}{{^-last}}, {{/-last}}{{/pathParams}}){{#allParams}}{{^isPathParam}}
+ .{{paramName}}({{paramName}}){{/isPathParam}}{{/allParams}}
+ .execute();
+ {{/vendorExtensions.x-group-parameters}}
+ {{#returnType}}
+ System.out.println(result);
+ {{/returnType}}
+ } catch (ApiException e) {
+ System.err.println("Exception when calling {{{classname}}}#{{{operationId}}}");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+{{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}}
+| Name | Type | Description | Notes |
+|------------- | ------------- | ------------- | -------------|{{/-last}}{{/allParams}}
+{{#allParams}}| **{{paramName}}** | {{#isContainer}}{{#isArray}}{{#items}}{{#isModel}}{{^isFile}}[{{/isFile}}{{/isModel}}**List<{{dataType}}>**{{#isModel}}{{^isFile}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isFile}}{{/isModel}}{{/items}}{{/isArray}}{{#isMap}}{{#items}}{{#isModel}}{{^isFile}}[{{/isFile}}{{/isModel}}**Map<String,{{dataType}}>**{{#isModel}}{{^isFile}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isFile}}{{/isModel}}{{/items}}{{/isMap}}{{/isContainer}}{{^isContainer}}{{#isModel}}{{^isFile}}[{{/isFile}}{{/isModel}}**{{dataType}}**{{#isModel}}{{^isFile}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isFile}}{{/isModel}}{{/isContainer}}| {{description}} |{{^required}} [optional]{{/required}}{{^isContainer}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}}{{/isContainer}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} |
+{{/allParams}}
+
+### Return type
+
+{{#returnType}}{{#returnTypeIsPrimitive}}**{{returnType}}**{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}[**{{returnType}}**]({{returnBaseType}}.md){{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}null (empty response body){{/returnType}}
+
+### Authorization
+
+{{^authMethods}}No authorization required{{/authMethods}}{{#authMethods}}[{{name}}](../README.md#{{name}}){{^-last}}, {{/-last}}{{/authMethods}}
+
+### HTTP request headers
+
+- **Content-Type**: {{#consumes}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}
+- **Accept**: {{#produces}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/produces}}{{^produces}}Not defined{{/produces}}
+
+{{#responses.0}}
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+{{#responses}}
+| **{{code}}** | {{message}} | {{#headers}} * {{baseName}} - {{description}} {{/headers}}{{^headers.0}} - {{/headers.0}} |
+{{/responses}}
+{{/responses.0}}
+
+{{/operation}}
+{{/operations}}
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/api_test.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/api_test.mustache
new file mode 100644
index 000000000000..eb5101b1a602
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/api_test.mustache
@@ -0,0 +1,59 @@
+{{>licenseInfo}}
+
+package {{package}};
+
+import {{invokerPackage}}.*;
+import {{invokerPackage}}.auth.*;
+{{#imports}}import {{import}};
+{{/imports}}
+
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
+
+{{^fullJavaUtil}}
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+{{/fullJavaUtil}}
+/**
+ * API tests for {{classname}}
+ */
+public class {{classname}}Test {
+
+ private final {{classname}} api = new {{classname}}();
+
+ {{#operations}}
+ {{#operation}}
+ /**
+ {{#summary}}
+ * {{summary}}
+ *
+ {{/summary}}
+ {{#notes}}
+ * {{notes}}
+ *
+ {{/notes}}
+ * @throws ApiException if the Api call fails
+ */
+ @Test
+ public void {{operationId}}Test() throws ApiException {
+ {{#allParams}}
+ //{{{dataType}}} {{paramName}} = null;
+ {{/allParams}}
+ {{^vendorExtensions.x-group-parameters}}
+ //{{#returnType}}{{{.}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});
+ {{/vendorExtensions.x-group-parameters}}
+ {{#vendorExtensions.x-group-parameters}}
+ //{{#returnType}}{{{.}}} response = {{/returnType}}api.{{operationId}}({{#pathParams}}{{paramName}}{{^-last}}, {{/-last}}{{/pathParams}}){{#allParams}}{{^isPathParam}}
+ // .{{paramName}}({{paramName}}){{/isPathParam}}{{/allParams}}
+ // .execute();
+ {{/vendorExtensions.x-group-parameters}}
+ // TODO: test validations
+ }
+
+ {{/operation}}
+ {{/operations}}
+}
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/auth/ApiKeyAuth.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/auth/ApiKeyAuth.mustache
new file mode 100644
index 000000000000..1731f936fb87
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/auth/ApiKeyAuth.mustache
@@ -0,0 +1,68 @@
+{{>licenseInfo}}
+
+package {{invokerPackage}}.auth;
+
+import {{invokerPackage}}.Pair;
+import {{invokerPackage}}.ApiException;
+
+import java.net.URI;
+import java.util.Map;
+import java.util.List;
+
+{{>generatedAnnotation}}
+public class ApiKeyAuth implements Authentication {
+ private final String location;
+ private final String paramName;
+
+ private String apiKey;
+ private String apiKeyPrefix;
+
+ 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;
+ }
+
+ public String getApiKeyPrefix() {
+ return apiKeyPrefix;
+ }
+
+ public void setApiKeyPrefix(String apiKeyPrefix) {
+ this.apiKeyPrefix = apiKeyPrefix;
+ }
+
+ @Override
+ public void applyToParams(List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException {
+ if (apiKey == null) {
+ return;
+ }
+ String value;
+ if (apiKeyPrefix != null) {
+ value = apiKeyPrefix + " " + apiKey;
+ } else {
+ value = apiKey;
+ }
+ if ("query".equals(location)) {
+ queryParams.add(new Pair(paramName, value));
+ } else if ("header".equals(location)) {
+ headerParams.put(paramName, value);
+ } else if ("cookie".equals(location)) {
+ cookieParams.put(paramName, value);
+ }
+ }
+}
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/auth/Authentication.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/auth/Authentication.mustache
new file mode 100644
index 000000000000..46d9c1ab6ace
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/auth/Authentication.mustache
@@ -0,0 +1,22 @@
+{{>licenseInfo}}
+
+package {{invokerPackage}}.auth;
+
+import {{invokerPackage}}.Pair;
+import {{invokerPackage}}.ApiException;
+
+import java.net.URI;
+import java.util.Map;
+import java.util.List;
+
+public interface Authentication {
+ /**
+ * Apply authentication settings to header and query params.
+ *
+ * @param queryParams List of query parameters
+ * @param headerParams Map of header parameters
+ * @param cookieParams Map of cookie parameters
+ */
+ void applyToParams(List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException;
+
+}
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/auth/HttpBasicAuth.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/auth/HttpBasicAuth.mustache
new file mode 100644
index 000000000000..13cecfa90a73
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/auth/HttpBasicAuth.mustache
@@ -0,0 +1,44 @@
+{{>licenseInfo}}
+
+package {{invokerPackage}}.auth;
+
+import {{invokerPackage}}.Pair;
+import {{invokerPackage}}.ApiException;
+
+import java.util.Base64;
+import java.nio.charset.StandardCharsets;
+
+import java.net.URI;
+import java.util.Map;
+import java.util.List;
+
+{{>generatedAnnotation}}
+public class HttpBasicAuth implements Authentication {
+ 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;
+ }
+
+ @Override
+ public void applyToParams(List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException {
+ if (username == null && password == null) {
+ return;
+ }
+ String str = (username == null ? "" : username) + ":" + (password == null ? "" : password);
+ headerParams.put("Authorization", "Basic " + Base64.getEncoder().encodeToString(str.getBytes(StandardCharsets.UTF_8)));
+ }
+}
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/auth/HttpBearerAuth.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/auth/HttpBearerAuth.mustache
new file mode 100644
index 000000000000..110a11ea7798
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/auth/HttpBearerAuth.mustache
@@ -0,0 +1,51 @@
+{{>licenseInfo}}
+
+package {{invokerPackage}}.auth;
+
+import {{invokerPackage}}.Pair;
+import {{invokerPackage}}.ApiException;
+
+import java.net.URI;
+import java.util.Map;
+import java.util.List;
+
+{{>generatedAnnotation}}
+public class HttpBearerAuth implements Authentication {
+ 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.
+ *
+ * @return The bearer token
+ */
+ public String getBearerToken() {
+ return bearerToken;
+ }
+
+ /**
+ * Sets the token, which together with the scheme, will be sent as the value of the Authorization header.
+ *
+ * @param bearerToken The bearer token to send in the Authorization header
+ */
+ public void setBearerToken(String bearerToken) {
+ this.bearerToken = bearerToken;
+ }
+
+ @Override
+ public void applyToParams(List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException {
+ if(bearerToken == null) {
+ return;
+ }
+
+ headerParams.put("Authorization", (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken);
+ }
+
+ private static String upperCaseBearer(String scheme) {
+ return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme;
+ }
+}
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/auth/HttpSignatureAuth.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/auth/HttpSignatureAuth.mustache
new file mode 100644
index 000000000000..ac0a77db8acf
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/auth/HttpSignatureAuth.mustache
@@ -0,0 +1,269 @@
+{{>licenseInfo}}
+
+package {{invokerPackage}}.auth;
+
+import {{invokerPackage}}.Pair;
+import {{invokerPackage}}.ApiException;
+
+import java.net.URI;
+import java.net.URLEncoder;
+import java.security.MessageDigest;
+import java.security.Key;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Base64;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.Locale;
+import java.util.Map;
+import java.util.List;
+import java.util.TimeZone;
+import java.security.spec.AlgorithmParameterSpec;
+import java.security.InvalidKeyException;
+
+import org.tomitribe.auth.signatures.Algorithm;
+import org.tomitribe.auth.signatures.Signer;
+import org.tomitribe.auth.signatures.Signature;
+import org.tomitribe.auth.signatures.SigningAlgorithm;
+
+/**
+ * A Configuration object for the HTTP message signature security scheme.
+ */
+public class HttpSignatureAuth implements Authentication {
+
+ private Signer signer;
+
+ // An opaque string that the server can use to look up the component they need to validate the signature.
+ private String keyId;
+
+ // The HTTP signature algorithm.
+ private SigningAlgorithm signingAlgorithm;
+
+ // The HTTP cryptographic algorithm.
+ private Algorithm algorithm;
+
+ // The cryptographic parameters.
+ private AlgorithmParameterSpec parameterSpec;
+
+ // The list of HTTP headers that should be included in the HTTP signature.
+ private List headers;
+
+ // The digest algorithm which is used to calculate a cryptographic digest of the HTTP request body.
+ private String digestAlgorithm;
+
+ // The maximum validity duration of the HTTP signature.
+ private Long maxSignatureValidity;
+
+ /**
+ * Construct a new HTTP signature auth configuration object.
+ *
+ * @param keyId An opaque string that the server can use to look up the component they need to validate the signature.
+ * @param signingAlgorithm The signature algorithm.
+ * @param algorithm The cryptographic algorithm.
+ * @param digestAlgorithm The digest algorithm.
+ * @param headers The list of HTTP headers that should be included in the HTTP signature.
+ * @param maxSignatureValidity The maximum validity duration of the HTTP signature.
+ * Used to set the '(expires)' field in the HTTP signature.
+ */
+ public HttpSignatureAuth(String keyId,
+ SigningAlgorithm signingAlgorithm,
+ Algorithm algorithm,
+ String digestAlgorithm,
+ AlgorithmParameterSpec parameterSpec,
+ List headers,
+ Long maxSignatureValidity) {
+ this.keyId = keyId;
+ this.signingAlgorithm = signingAlgorithm;
+ this.algorithm = algorithm;
+ this.parameterSpec = parameterSpec;
+ this.digestAlgorithm = digestAlgorithm;
+ this.headers = headers;
+ this.maxSignatureValidity = maxSignatureValidity;
+ }
+
+ /**
+ * Returns the opaque string that the server can use to look up the component they need to validate the signature.
+ *
+ * @return The keyId.
+ */
+ public String getKeyId() {
+ return keyId;
+ }
+
+ /**
+ * Set the HTTP signature key id.
+ *
+ * @param keyId An opaque string that the server can use to look up the component they need to validate the signature.
+ */
+ public void setKeyId(String keyId) {
+ this.keyId = keyId;
+ }
+
+ /**
+ * Returns the HTTP signature algorithm which is used to sign HTTP requests.
+ */
+ public SigningAlgorithm getSigningAlgorithm() {
+ return signingAlgorithm;
+ }
+
+ /**
+ * Sets the HTTP signature algorithm which is used to sign HTTP requests.
+ *
+ * @param signingAlgorithm The HTTP signature algorithm.
+ */
+ public void setSigningAlgorithm(SigningAlgorithm signingAlgorithm) {
+ this.signingAlgorithm = signingAlgorithm;
+ }
+
+ /**
+ * Returns the HTTP cryptographic algorithm which is used to sign HTTP requests.
+ */
+ public Algorithm getAlgorithm() {
+ return algorithm;
+ }
+
+ /**
+ * Sets the HTTP cryptographic algorithm which is used to sign HTTP requests.
+ *
+ * @param algorithm The HTTP signature algorithm.
+ */
+ public void setAlgorithm(Algorithm algorithm) {
+ this.algorithm = algorithm;
+ }
+
+ /**
+ * Returns the cryptographic parameters which are used to sign HTTP requests.
+ */
+ public AlgorithmParameterSpec getAlgorithmParameterSpec() {
+ return parameterSpec;
+ }
+
+ /**
+ * Sets the cryptographic parameters which are used to sign HTTP requests.
+ *
+ * @param parameterSpec The cryptographic parameters.
+ */
+ public void setAlgorithmParameterSpec(AlgorithmParameterSpec parameterSpec) {
+ this.parameterSpec = parameterSpec;
+ }
+
+ /**
+ * Returns the digest algorithm which is used to calculate a cryptographic digest of the HTTP request body.
+ *
+ * @see java.security.MessageDigest
+ */
+ public String getDigestAlgorithm() {
+ return digestAlgorithm;
+ }
+
+ /**
+ * Sets the digest algorithm which is used to calculate a cryptographic digest of the HTTP request body.
+ *
+ * The exact list of supported digest algorithms depends on the installed security providers.
+ * Every implementation of the Java platform is required to support "MD5", "SHA-1" and "SHA-256".
+ * Do not use "MD5" and "SHA-1", they are vulnerable to multiple known attacks.
+ * By default, "SHA-256" is used.
+ *
+ * @param digestAlgorithm The digest algorithm.
+ *
+ * @see java.security.MessageDigest
+ */
+ public void setDigestAlgorithm(String digestAlgorithm) {
+ this.digestAlgorithm = digestAlgorithm;
+ }
+
+ /**
+ * Returns the list of HTTP headers that should be included in the HTTP signature.
+ */
+ public List getHeaders() {
+ return headers;
+ }
+
+ /**
+ * Sets the list of HTTP headers that should be included in the HTTP signature.
+ *
+ * @param headers The HTTP headers.
+ */
+ public void setHeaders(List headers) {
+ this.headers = headers;
+ }
+
+ /**
+ * Returns the maximum validity duration of the HTTP signature.
+ * @return The maximum validity duration of the HTTP signature.
+ */
+ public Long getMaxSignatureValidity() {
+ return maxSignatureValidity;
+ }
+
+ /**
+ * Returns the signer instance used to sign HTTP messages.
+ *
+ * @return the signer instance.
+ */
+ public Signer getSigner() {
+ return signer;
+ }
+
+ /**
+ * Sets the signer instance used to sign HTTP messages.
+ *
+ * @param signer The signer instance to set.
+ */
+ public void setSigner(Signer signer) {
+ this.signer = signer;
+ }
+
+ /**
+ * Set the private key used to sign HTTP requests using the HTTP signature scheme.
+ *
+ * @param key The private key.
+ *
+ * @throws InvalidKeyException Unable to parse the key, or the security provider for this key
+ * is not installed.
+ */
+ public void setPrivateKey(Key key) throws InvalidKeyException, ApiException {
+ if (key == null) {
+ throw new ApiException("Private key (java.security.Key) cannot be null");
+ }
+ signer = new Signer(key, new Signature(keyId, signingAlgorithm, algorithm, parameterSpec, null, headers, maxSignatureValidity));
+ }
+
+ @Override
+ public void applyToParams(List queryParams, Map headerParams, Map cookieParams,
+ String payload, String method, URI uri) throws ApiException {
+ try {
+ if (headers.contains("host")) {
+ headerParams.put("host", uri.getHost());
+ }
+
+ if (headers.contains("date")) {
+ SimpleDateFormat dateFormat = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss z", Locale.US);
+ dateFormat.setTimeZone(TimeZone.getTimeZone("GMT"));
+ headerParams.put("date", dateFormat.format(Calendar.getInstance().getTime()));
+ }
+
+ if (headers.contains("digest")) {
+ headerParams.put("digest",
+ this.digestAlgorithm + "=" +
+ new String(Base64.getEncoder().encode(MessageDigest.getInstance(this.digestAlgorithm).digest(payload.getBytes()))));
+ }
+
+ if (signer == null) {
+ throw new ApiException("Signer cannot be null. Please call the method `setPrivateKey` to set it up correctly");
+ }
+
+ // construct the path with the URL-encoded path and query.
+ // Calling getRawPath and getRawQuery ensures the path is URL-encoded as it will be serialized
+ // on the wire. The HTTP signature must use the encode URL as it is sent on the wire.
+ String path = uri.getRawPath();
+ if (uri.getRawQuery() != null && !"".equals(uri.getRawQuery())) {
+ path += "?" + uri.getRawQuery();
+ }
+
+ headerParams.put("Authorization", signer.sign(method, path, headerParams).toString());
+ } catch (Exception ex) {
+ throw new ApiException("Failed to create signature in the HTTP request header: " + ex.toString());
+ }
+ }
+}
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/auth/OAuth.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/auth/OAuth.mustache
new file mode 100644
index 000000000000..73d6d19dbdbd
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/auth/OAuth.mustache
@@ -0,0 +1,182 @@
+{{>licenseInfo}}
+
+package {{invokerPackage}}.auth;
+
+import {{invokerPackage}}.Pair;
+import {{invokerPackage}}.ApiException;
+import com.github.scribejava.core.builder.ServiceBuilder;
+import com.github.scribejava.core.builder.api.DefaultApi20;
+import com.github.scribejava.core.exceptions.OAuthException;
+import com.github.scribejava.core.model.OAuth2AccessToken;
+import com.github.scribejava.core.oauth.OAuth20Service;
+
+import jakarta.ws.rs.core.UriBuilder;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ExecutionException;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+{{>generatedAnnotation}}
+public class OAuth implements Authentication {
+ private static final Logger log = Logger.getLogger(OAuth.class.getName());
+
+ private String tokenUrl;
+ private String absoluteTokenUrl;
+ private OAuthFlow flow = OAuthFlow.APPLICATION;
+ private OAuth20Service service;
+ private DefaultApi20 authApi;
+ private String scope;
+ private String username;
+ private String password;
+ private String code;
+ private volatile OAuth2AccessToken accessToken;
+
+ public OAuth(String basePath, String tokenUrl) {
+ this.tokenUrl = tokenUrl;
+ this.absoluteTokenUrl = createAbsoluteTokenUrl(basePath, tokenUrl);
+ authApi = new DefaultApi20() {
+ @Override
+ public String getAccessTokenEndpoint() {
+ return absoluteTokenUrl;
+ }
+
+ @Override
+ protected String getAuthorizationBaseUrl() {
+ throw new UnsupportedOperationException("Shouldn't get there !");
+ }
+ };
+ }
+
+ private static String createAbsoluteTokenUrl(String basePath, String tokenUrl) {
+ if (!URI.create(tokenUrl).isAbsolute()) {
+ try {
+ return UriBuilder.fromPath(basePath).path(tokenUrl).build().toURL().toString();
+ } catch (MalformedURLException e) {
+ log.log(Level.SEVERE, "Couldn't create absolute token URL", e);
+ }
+ }
+ return tokenUrl;
+ }
+
+ @Override
+ public void applyToParams(
+ List queryParams,
+ Map headerParams,
+ Map cookieParams,
+ String payload,
+ String method,
+ URI uri)
+ throws ApiException {
+
+ if (accessToken == null) {
+ obtainAccessToken(null);
+ }
+ if (accessToken != null) {
+ headerParams.put("Authorization", "Bearer " + accessToken.getAccessToken());
+ }
+ }
+
+ public OAuth2AccessToken renewAccessToken() throws ApiException {
+ String refreshToken = null;
+ if (accessToken != null) {
+ refreshToken = accessToken.getRefreshToken();
+ accessToken = null;
+ }
+ return obtainAccessToken(refreshToken);
+ }
+
+ public synchronized OAuth2AccessToken obtainAccessToken(String refreshToken) throws ApiException {
+ if (service == null) {
+ log.log(Level.FINE, "service is null in obtainAccessToken.");
+ return null;
+ }
+ try {
+ if (refreshToken != null) {
+ return service.refreshAccessToken(refreshToken);
+ }
+ } catch (OAuthException | InterruptedException | ExecutionException | IOException e) {
+ log.log(Level.FINE, "Refreshing the access token using the refresh token failed", e);
+ }
+ try {
+ switch (flow) {
+ case PASSWORD:
+ if (username != null && password != null) {
+ accessToken = service.getAccessTokenPasswordGrant(username, password, scope);
+ }
+ break;
+ case ACCESS_CODE:
+ if (code != null) {
+ accessToken = service.getAccessToken(code);
+ code = null;
+ }
+ break;
+ case APPLICATION:
+ accessToken = service.getAccessTokenClientCredentialsGrant(scope);
+ break;
+ default:
+ log.log(Level.SEVERE, "Invalid flow in obtainAccessToken: " + flow);
+ }
+ } catch (OAuthException | InterruptedException | ExecutionException | IOException e) {
+ throw new ApiException(e);
+ }
+ return accessToken;
+ }
+
+ public OAuth2AccessToken getAccessToken() {
+ return accessToken;
+ }
+
+ public OAuth setAccessToken(OAuth2AccessToken accessToken) {
+ this.accessToken = accessToken;
+ return this;
+ }
+
+ public OAuth setAccessToken(String accessToken) {
+ this.accessToken = new OAuth2AccessToken(accessToken);
+ return this;
+ }
+
+ public OAuth setScope(String scope) {
+ this.scope = scope;
+ return this;
+ }
+
+ public OAuth setCredentials(String clientId, String clientSecret, Boolean debug) {
+ if (Boolean.TRUE.equals(debug)) {
+ service = new ServiceBuilder(clientId)
+ .apiSecret(clientSecret).debug()
+ .build(authApi);
+ } else {
+ service = new ServiceBuilder(clientId)
+ .apiSecret(clientSecret)
+ .build(authApi);
+ }
+ return this;
+ }
+
+ public OAuth usePasswordFlow(String username, String password) {
+ this.flow = OAuthFlow.PASSWORD;
+ this.username = username;
+ this.password = password;
+ return this;
+ }
+
+ public OAuth useAuthorizationCodeFlow(String code) {
+ this.flow = OAuthFlow.ACCESS_CODE;
+ this.code = code;
+ return this;
+ }
+
+ public OAuth setFlow(OAuthFlow flow) {
+ this.flow = flow;
+ return this;
+ }
+
+ public void setBasePath(String basePath) {
+ this.absoluteTokenUrl = createAbsoluteTokenUrl(basePath, tokenUrl);
+ }
+}
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/auth/OAuthFlow.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/auth/OAuthFlow.mustache
new file mode 100644
index 000000000000..190781fb1264
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/auth/OAuthFlow.mustache
@@ -0,0 +1,13 @@
+{{>licenseInfo}}
+
+package {{invokerPackage}}.auth;
+
+/**
+ * OAuth flows that are supported by this client
+ */
+public enum OAuthFlow {
+ ACCESS_CODE,
+ IMPLICIT,
+ PASSWORD,
+ APPLICATION
+}
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/build.gradle.mustache
new file mode 100644
index 000000000000..5ebc725c4f37
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/build.gradle.mustache
@@ -0,0 +1,177 @@
+apply plugin: 'idea'
+apply plugin: 'eclipse'
+apply plugin: 'com.diffplug.spotless'
+
+group = '{{groupId}}'
+version = '{{artifactVersion}}'
+
+buildscript {
+ repositories {
+ mavenCentral()
+ }
+ dependencies {
+ classpath 'com.android.tools.build:gradle:2.3.+'
+ classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
+ classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.3.0'
+ }
+}
+
+repositories {
+ mavenCentral()
+}
+
+if(hasProperty('target') && target == 'android') {
+
+ apply plugin: 'com.android.library'
+ apply plugin: 'com.github.dcendents.android-maven'
+
+ android {
+ compileSdkVersion 25
+ buildToolsVersion '25.0.2'
+ defaultConfig {
+ minSdkVersion 14
+ targetSdkVersion 25
+ }
+ compileOptions {
+ sourceCompatibility JavaVersion.VERSION_1_8
+ targetCompatibility JavaVersion.VERSION_1_8
+ }
+
+ // Rename the aar correctly
+ libraryVariants.all { variant ->
+ variant.outputs.each { output ->
+ def outputFile = output.outputFile
+ if (outputFile != null && outputFile.name.endsWith('.aar')) {
+ def fileName = "${project.name}-${variant.baseName}-${version}.aar"
+ output.outputFile = new File(outputFile.parent, fileName)
+ }
+ }
+ }
+
+ dependencies {
+ provided "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version"
+ }
+ }
+
+ afterEvaluate {
+ android.libraryVariants.all { variant ->
+ def task = project.tasks.create "jar${variant.name.capitalize()}", Jar
+ task.description = "Create jar artifact for ${variant.name}"
+ task.dependsOn variant.javaCompile
+ task.from variant.javaCompile.destinationDir
+ task.destinationDir = project.file("${project.buildDir}/outputs/jar")
+ task.archiveName = "${project.name}-${variant.baseName}-${version}.jar"
+ artifacts.add('archives', task);
+ }
+ }
+
+ task sourcesJar(type: Jar) {
+ from android.sourceSets.main.java.srcDirs
+ classifier = 'sources'
+ }
+
+ artifacts {
+ archives sourcesJar
+ }
+
+} else {
+
+ apply plugin: 'java'
+ apply plugin: 'maven-publish'
+ sourceCompatibility = JavaVersion.VERSION_1_8
+ targetCompatibility = JavaVersion.VERSION_1_8
+
+ publishing {
+ publications {
+ maven(MavenPublication) {
+ artifactId = '{{artifactId}}'
+
+ from components.java
+ }
+ }
+ }
+
+ task execute(type:JavaExec) {
+ main = System.getProperty('mainClass')
+ classpath = sourceSets.main.runtimeClasspath
+ }
+}
+
+ext {
+ swagger_annotations_version = "1.6.5"
+ jackson_version = "2.13.2"
+ jackson_databind_version = "2.13.2"
+ {{#openApiNullable}}
+ jackson_databind_nullable_version = "0.2.2"
+ {{/openApiNullable}}
+ jakarta_annotation_version = "2.1.0"
+ jersey_version = "3.0.4"
+ junit_version = "5.8.2"
+ {{#hasOAuthMethods}}
+ scribejava_apis_version = "8.3.1"
+ {{/hasOAuthMethods}}
+ {{#hasHttpSignatureMethods}}
+ tomitribe_http_signatures_version = "1.7"
+ {{/hasHttpSignatureMethods}}
+}
+
+dependencies {
+ implementation "io.swagger:swagger-annotations:$swagger_annotations_version"
+ implementation "com.google.code.findbugs:jsr305:3.0.2"
+ implementation "org.glassfish.jersey.core:jersey-client:$jersey_version"
+ implementation "org.glassfish.jersey.inject:jersey-hk2:$jersey_version"
+ implementation "org.glassfish.jersey.media:jersey-media-multipart:$jersey_version"
+ implementation "org.glassfish.jersey.media:jersey-media-json-jackson:$jersey_version"
+ implementation "org.glassfish.jersey.connectors:jersey-apache-connector:$jersey_version"
+ implementation "com.fasterxml.jackson.core:jackson-core:$jackson_version"
+ implementation "com.fasterxml.jackson.core:jackson-annotations:$jackson_version"
+ implementation "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version"
+ {{#openApiNullable}}
+ implementation "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version"
+ {{/openApiNullable}}
+ {{#joda}}
+ implementation "com.fasterxml.jackson.datatype:jackson-datatype-joda:$jackson_version"
+ {{/joda}}
+ implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version"
+ {{#hasOAuthMethods}}
+ implementation "com.github.scribejava:scribejava-apis:$scribejava_apis_version"
+ {{/hasOAuthMethods}}
+ {{#hasHttpSignatureMethods}}
+ implementation "org.tomitribe:tomitribe-http-signatures:$tomitribe_http_signatures_version"
+ {{/hasHttpSignatureMethods}}
+ implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version"
+ testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version"
+ testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit_version"
+}
+
+test {
+ useJUnitPlatform()
+}
+
+javadoc {
+ options.tags = [ "http.response.details:a:Http Response Details" ]
+}
+
+// Use spotless plugin to automatically format code, remove unused import, etc
+// To apply changes directly to the file, run `gradlew spotlessApply`
+// Ref: https://github.com/diffplug/spotless/tree/main/plugin-gradle
+spotless {
+ // comment out below to run spotless as part of the `check` task
+ enforceCheck false
+
+ format 'misc', {
+ // define the files (e.g. '*.gradle', '*.md') to apply `misc` to
+ target '.gitignore'
+ // define the steps to apply to those files
+ trimTrailingWhitespace()
+ indentWithSpaces() // Takes an integer argument if you don't like 4
+ endWithNewline()
+ }
+ java {
+ // don't need to set target, it is inferred from java
+ // apply a specific flavor of google-java-format
+ googleJavaFormat('1.8').aosp().reflowLongStrings()
+ removeUnusedImports()
+ importOrder()
+ }
+}
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/build.sbt.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/build.sbt.mustache
new file mode 100644
index 000000000000..aef4fc30d162
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/build.sbt.mustache
@@ -0,0 +1,38 @@
+lazy val root = (project in file(".")).
+ settings(
+ organization := "{{groupId}}",
+ name := "{{artifactId}}",
+ version := "{{artifactVersion}}",
+ scalaVersion := "2.11.4",
+ scalacOptions ++= Seq("-feature"),
+ Compile / javacOptions ++= Seq("-Xlint:deprecation"),
+ Compile / packageDoc / publishArtifact := false,
+ resolvers += Resolver.mavenLocal,
+ libraryDependencies ++= Seq(
+ "com.google.code.findbugs" % "jsr305" % "3.0.0",
+ "io.swagger" % "swagger-annotations" % "1.6.5",
+ "org.glassfish.jersey.core" % "jersey-client" % "3.0.4",
+ "org.glassfish.jersey.inject" % "jersey-hk2" % "3.0.4",
+ "org.glassfish.jersey.media" % "jersey-media-multipart" % "3.0.4",
+ "org.glassfish.jersey.media" % "jersey-media-json-jackson" % "3.0.4",
+ "org.glassfish.jersey.connectors" % "jersey-apache-connector" % "3.0.4",
+ "com.fasterxml.jackson.core" % "jackson-core" % "2.13.2" % "compile",
+ "com.fasterxml.jackson.core" % "jackson-annotations" % "2.13.2" % "compile",
+ "com.fasterxml.jackson.core" % "jackson-databind" % "2.13.2" % "compile",
+ {{#joda}}
+ "com.fasterxml.jackson.datatype" % "jackson-datatype-joda" % "2.13.0" % "compile",
+ {{/joda}}
+ "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.13.0" % "compile",
+ {{#openApiNullable}}
+ "org.openapitools" % "jackson-databind-nullable" % "0.2.2" % "compile",
+ {{/openApiNullable}}
+ {{#hasOAuthMethods}}
+ "com.github.scribejava" % "scribejava-apis" % "8.3.1" % "compile",
+ {{/hasOAuthMethods}}
+ {{#hasHttpSignatureMethods}}
+ "org.tomitribe" % "tomitribe-http-signatures" % "1.7" % "compile",
+ {{/hasHttpSignatureMethods}}
+ "jakarta.annotation" % "jakarta.annotation-api" % "2.1.0" % "compile",
+ "org.junit.jupiter" % "junit-jupiter-api" % "5.8.2" % "test"
+ )
+ )
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/generatedAnnotation.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/generatedAnnotation.mustache
new file mode 100644
index 000000000000..e4f87495451d
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/generatedAnnotation.mustache
@@ -0,0 +1 @@
+@jakarta.annotation.Generated(value = "{{generatorClass}}"{{^hideGenerationTimestamp}}, date = "{{generatedDate}}"{{/hideGenerationTimestamp}})
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/model.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/model.mustache
new file mode 100644
index 000000000000..914e1eb1e29a
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/model.mustache
@@ -0,0 +1,64 @@
+{{>licenseInfo}}
+
+package {{package}};
+
+{{#useReflectionEqualsHashCode}}
+import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
+{{/useReflectionEqualsHashCode}}
+{{#models}}
+{{#model}}
+{{#additionalPropertiesType}}
+import java.util.Map;
+import java.util.HashMap;
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+{{/additionalPropertiesType}}
+{{/model}}
+{{/models}}
+import java.util.Objects;
+import java.util.Arrays;
+import java.util.Map;
+import java.util.HashMap;
+{{#imports}}
+import {{import}};
+{{/imports}}
+{{#serializableModel}}
+import java.io.Serializable;
+{{/serializableModel}}
+{{#jackson}}
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+{{#withXml}}
+import com.fasterxml.jackson.dataformat.xml.annotation.*;
+{{/withXml}}
+{{#vendorExtensions.x-has-readonly-properties}}
+import com.fasterxml.jackson.annotation.JsonCreator;
+{{/vendorExtensions.x-has-readonly-properties}}
+{{/jackson}}
+{{#withXml}}
+import javax.xml.bind.annotation.*;
+{{/withXml}}
+{{#parcelableModel}}
+import android.os.Parcelable;
+import android.os.Parcel;
+{{/parcelableModel}}
+{{#useBeanValidation}}
+import javax.validation.constraints.*;
+import javax.validation.Valid;
+{{/useBeanValidation}}
+{{#performBeanValidation}}
+import org.hibernate.validator.constraints.*;
+{{/performBeanValidation}}
+import {{invokerPackage}}.JSON;
+
+{{#models}}
+{{#model}}
+{{#oneOf}}
+{{#-first}}
+import com.fasterxml.jackson.core.type.TypeReference;
+{{/-first}}
+{{/oneOf}}
+
+{{#isEnum}}{{>modelEnum}}{{/isEnum}}{{^isEnum}}{{#oneOf}}{{#-first}}{{>oneof_model}}{{/-first}}{{/oneOf}}{{^oneOf}}{{#anyOf}}{{#-first}}{{>anyof_model}}{{/-first}}{{/anyOf}}{{^anyOf}}{{>pojo}}{{/anyOf}}{{/oneOf}}{{/isEnum}}
+{{/model}}
+{{/models}}
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/model_anyof_doc.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/model_anyof_doc.mustache
new file mode 100644
index 000000000000..e360aa56e6c3
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/model_anyof_doc.mustache
@@ -0,0 +1,38 @@
+# {{classname}}
+
+{{#description}}
+{{&description}}
+
+{{/description}}
+## anyOf schemas
+{{#anyOf}}
+* [{{{.}}}]({{{.}}}.md)
+{{/anyOf}}
+
+{{#isNullable}}
+NOTE: this class is nullable.
+
+{{/isNullable}}
+## Example
+```java
+// Import classes:
+import {{{package}}}.{{{classname}}};
+{{#anyOf}}
+import {{{package}}}.{{{.}}};
+{{/anyOf}}
+
+public class Example {
+ public static void main(String[] args) {
+ {{classname}} example{{classname}} = new {{classname}}();
+ {{#anyOf}}
+
+ // create a new {{{.}}}
+ {{{.}}} example{{{.}}} = new {{{.}}}();
+ // set {{{classname}}} to {{{.}}}
+ example{{classname}}.setActualInstance(example{{{.}}});
+ // to get back the {{{.}}} set earlier
+ {{{.}}} test{{{.}}} = ({{{.}}}) example{{classname}}.getActualInstance();
+ {{/anyOf}}
+ }
+}
+```
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/model_doc.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/model_doc.mustache
new file mode 100644
index 000000000000..be1aedcf2f31
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/model_doc.mustache
@@ -0,0 +1,19 @@
+{{#models}}{{#model}}
+
+{{#isEnum}}
+{{>enum_outer_doc}}
+{{/isEnum}}
+{{^isEnum}}
+{{^oneOf.isEmpty}}
+{{>model_oneof_doc}}
+{{/oneOf.isEmpty}}
+{{^anyOf.isEmpty}}
+{{>model_anyof_doc}}
+{{/anyOf.isEmpty}}
+{{^anyOf}}
+{{^oneOf}}
+{{>pojo_doc}}
+{{/oneOf}}
+{{/anyOf}}
+{{/isEnum}}
+{{/model}}{{/models}}
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/model_oneof_doc.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/model_oneof_doc.mustache
new file mode 100644
index 000000000000..5fff76c9efa0
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/model_oneof_doc.mustache
@@ -0,0 +1,38 @@
+# {{classname}}
+
+{{#description}}
+{{&description}}
+
+{{/description}}
+## oneOf schemas
+{{#oneOf}}
+* [{{{.}}}]({{{.}}}.md)
+{{/oneOf}}
+
+{{#isNullable}}
+NOTE: this class is nullable.
+
+{{/isNullable}}
+## Example
+```java
+// Import classes:
+import {{{package}}}.{{{classname}}};
+{{#oneOf}}
+import {{{package}}}.{{{.}}};
+{{/oneOf}}
+
+public class Example {
+ public static void main(String[] args) {
+ {{classname}} example{{classname}} = new {{classname}}();
+ {{#oneOf}}
+
+ // create a new {{{.}}}
+ {{{.}}} example{{{.}}} = new {{{.}}}();
+ // set {{{classname}}} to {{{.}}}
+ example{{classname}}.setActualInstance(example{{{.}}});
+ // to get back the {{{.}}} set earlier
+ {{{.}}} test{{{.}}} = ({{{.}}}) example{{classname}}.getActualInstance();
+ {{/oneOf}}
+ }
+}
+```
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/model_test.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/model_test.mustache
new file mode 100644
index 000000000000..2d4ccdd1a14f
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/model_test.mustache
@@ -0,0 +1,51 @@
+{{>licenseInfo}}
+
+package {{package}};
+
+{{#imports}}import {{import}};
+{{/imports}}
+
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
+
+{{#fullJavaUtil}}
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+{{/fullJavaUtil}}
+/**
+ * Model tests for {{classname}}
+ */
+public class {{classname}}Test {
+ {{#models}}
+ {{#model}}
+ {{^vendorExtensions.x-is-one-of-interface}}
+ {{^isEnum}}
+ private final {{classname}} model = new {{classname}}();
+
+ {{/isEnum}}
+ /**
+ * Model tests for {{classname}}
+ */
+ @Test
+ public void test{{classname}}() {
+ // TODO: test {{classname}}
+ }
+
+ {{#allVars}}
+ /**
+ * Test the property '{{name}}'
+ */
+ @Test
+ public void {{name}}Test() {
+ // TODO: test {{name}}
+ }
+
+ {{/allVars}}
+ {{/vendorExtensions.x-is-one-of-interface}}
+ {{/model}}
+ {{/models}}
+}
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/oneof_model.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/oneof_model.mustache
new file mode 100644
index 000000000000..e592998299a4
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/oneof_model.mustache
@@ -0,0 +1,235 @@
+import jakarta.ws.rs.core.GenericType;
+import jakarta.ws.rs.core.Response;
+import java.io.IOException;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashSet;
+
+import com.fasterxml.jackson.core.JsonGenerator;
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.core.JsonToken;
+import com.fasterxml.jackson.core.type.TypeReference;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import com.fasterxml.jackson.databind.JsonMappingException;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.MapperFeature;
+import com.fasterxml.jackson.databind.SerializerProvider;
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
+import com.fasterxml.jackson.databind.ser.std.StdSerializer;
+import {{invokerPackage}}.JSON;
+
+{{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{>xmlAnnotation}}
+@JsonDeserialize(using = {{classname}}.{{classname}}Deserializer.class)
+@JsonSerialize(using = {{classname}}.{{classname}}Serializer.class)
+public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-implements}}, {{{.}}}{{/vendorExtensions.x-implements}} {
+ private static final Logger log = Logger.getLogger({{classname}}.class.getName());
+
+ public static class {{classname}}Serializer extends StdSerializer<{{classname}}> {
+ public {{classname}}Serializer(Class<{{classname}}> t) {
+ super(t);
+ }
+
+ public {{classname}}Serializer() {
+ this(null);
+ }
+
+ @Override
+ public void serialize({{classname}} value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException {
+ jgen.writeObject(value.getActualInstance());
+ }
+ }
+
+ public static class {{classname}}Deserializer extends StdDeserializer<{{classname}}> {
+ public {{classname}}Deserializer() {
+ this({{classname}}.class);
+ }
+
+ public {{classname}}Deserializer(Class> vc) {
+ super(vc);
+ }
+
+ @Override
+ public {{classname}} deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException {
+ JsonNode tree = jp.readValueAsTree();
+ Object deserialized = null;
+ {{#useOneOfDiscriminatorLookup}}
+ {{#discriminator}}
+ {{classname}} new{{classname}} = new {{classname}}();
+ Map result2 = tree.traverse(jp.getCodec()).readValueAs(new TypeReference>() {});
+ String discriminatorValue = (String)result2.get("{{{propertyBaseName}}}");
+ switch (discriminatorValue) {
+ {{#mappedModels}}
+ case "{{{mappingName}}}":
+ deserialized = tree.traverse(jp.getCodec()).readValueAs({{{modelName}}}.class);
+ new{{classname}}.setActualInstance(deserialized);
+ return new{{classname}};
+ {{/mappedModels}}
+ default:
+ log.log(Level.WARNING, String.format("Failed to lookup discriminator value `%s` for {{classname}}. Possible values:{{#mappedModels}} {{{mappingName}}}{{/mappedModels}}", discriminatorValue));
+ }
+
+ {{/discriminator}}
+ {{/useOneOfDiscriminatorLookup}}
+ boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS);
+ int match = 0;
+ JsonToken token = tree.traverse(jp.getCodec()).nextToken();
+ {{#oneOf}}
+ // deserialize {{{.}}}
+ try {
+ boolean attemptParsing = true;
+ // ensure that we respect type coercion as set on the client ObjectMapper
+ if ({{{.}}}.class.equals(Integer.class) || {{{.}}}.class.equals(Long.class) || {{{.}}}.class.equals(Float.class) || {{{.}}}.class.equals(Double.class) || {{{.}}}.class.equals(Boolean.class) || {{{.}}}.class.equals(String.class)) {
+ attemptParsing = typeCoercion;
+ if (!attemptParsing) {
+ attemptParsing |= (({{{.}}}.class.equals(Integer.class) || {{{.}}}.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT);
+ attemptParsing |= (({{{.}}}.class.equals(Float.class) || {{{.}}}.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT);
+ attemptParsing |= ({{{.}}}.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE));
+ attemptParsing |= ({{{.}}}.class.equals(String.class) && token == JsonToken.VALUE_STRING);
+ {{#isNullable}}
+ attemptParsing |= (token == JsonToken.VALUE_NULL);
+ {{/isNullable}}
+ }
+ }
+ if (attemptParsing) {
+ deserialized = tree.traverse(jp.getCodec()).readValueAs({{{.}}}.class);
+ // TODO: there is no validation against JSON schema constraints
+ // (min, max, enum, pattern...), this does not perform a strict JSON
+ // validation, which means the 'match' count may be higher than it should be.
+ match++;
+ log.log(Level.FINER, "Input data matches schema '{{{.}}}'");
+ }
+ } catch (Exception e) {
+ // deserialization failed, continue
+ log.log(Level.FINER, "Input data does not match schema '{{{.}}}'", e);
+ }
+
+ {{/oneOf}}
+ if (match == 1) {
+ {{classname}} ret = new {{classname}}();
+ ret.setActualInstance(deserialized);
+ return ret;
+ }
+ throw new IOException(String.format("Failed deserialization for {{classname}}: %d classes match result, expected 1", match));
+ }
+
+ /**
+ * Handle deserialization of the 'null' value.
+ */
+ @Override
+ public {{classname}} getNullValue(DeserializationContext ctxt) throws JsonMappingException {
+ {{#isNullable}}
+ return null;
+ {{/isNullable}}
+ {{^isNullable}}
+ throw new JsonMappingException(ctxt.getParser(), "{{classname}} cannot be null");
+ {{/isNullable}}
+ }
+ }
+
+ // store a list of schema names defined in oneOf
+ public static final Map schemas = new HashMap();
+
+ public {{classname}}() {
+ super("oneOf", {{#isNullable}}Boolean.TRUE{{/isNullable}}{{^isNullable}}Boolean.FALSE{{/isNullable}});
+ }
+{{> libraries/jersey2/additional_properties }}
+ {{#additionalPropertiesType}}
+ /**
+ * Return true if this {{name}} object is equal to o.
+ */
+ @Override
+ public boolean equals(Object o) {
+ return super.equals(o) && Objects.equals(this.additionalProperties, (({{classname}})o).additionalProperties);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(getActualInstance(), isNullable(), getSchemaType(), additionalProperties);
+ }
+ {{/additionalPropertiesType}}
+ {{#oneOf}}
+ public {{classname}}({{{.}}} o) {
+ super("oneOf", {{#isNullable}}Boolean.TRUE{{/isNullable}}{{^isNullable}}Boolean.FALSE{{/isNullable}});
+ setActualInstance(o);
+ }
+
+ {{/oneOf}}
+ static {
+ {{#oneOf}}
+ schemas.put("{{{.}}}", new GenericType<{{{.}}}>() {
+ });
+ {{/oneOf}}
+ JSON.registerDescendants({{classname}}.class, Collections.unmodifiableMap(schemas));
+ {{#discriminator}}
+ // Initialize and register the discriminator mappings.
+ Map> mappings = new HashMap>();
+ {{#mappedModels}}
+ mappings.put("{{mappingName}}", {{modelName}}.class);
+ {{/mappedModels}}
+ mappings.put("{{name}}", {{classname}}.class);
+ JSON.registerDiscriminator({{classname}}.class, "{{propertyBaseName}}", mappings);
+ {{/discriminator}}
+ }
+
+ @Override
+ public Map getSchemas() {
+ return {{classname}}.schemas;
+ }
+
+ /**
+ * Set the instance that matches the oneOf child schema, check
+ * the instance parameter is valid against the oneOf child schemas:
+ * {{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}}
+ *
+ * It could be an instance of the 'oneOf' schemas.
+ * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf).
+ */
+ @Override
+ public void setActualInstance(Object instance) {
+ {{#isNullable}}
+ if (instance == null) {
+ super.setActualInstance(instance);
+ return;
+ }
+
+ {{/isNullable}}
+ {{#oneOf}}
+ if (JSON.isInstanceOf({{{.}}}.class, instance, new HashSet>())) {
+ super.setActualInstance(instance);
+ return;
+ }
+
+ {{/oneOf}}
+ throw new RuntimeException("Invalid instance type. Must be {{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}}");
+ }
+
+ /**
+ * Get the actual instance, which can be the following:
+ * {{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}}
+ *
+ * @return The actual instance ({{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}})
+ */
+ @Override
+ public Object getActualInstance() {
+ return super.getActualInstance();
+ }
+
+ {{#oneOf}}
+ /**
+ * Get the actual instance of `{{{.}}}`. If the actual instance is not `{{{.}}}`,
+ * the ClassCastException will be thrown.
+ *
+ * @return The actual instance of `{{{.}}}`
+ * @throws ClassCastException if the instance is not `{{{.}}}`
+ */
+ public {{{.}}} get{{{.}}}() throws ClassCastException {
+ return ({{{.}}})super.getActualInstance();
+ }
+
+ {{/oneOf}}
+}
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/pojo.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/pojo.mustache
new file mode 100644
index 000000000000..156cc4cd5ccb
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/pojo.mustache
@@ -0,0 +1,413 @@
+/**
+ * {{description}}{{^description}}{{classname}}{{/description}}{{#isDeprecated}}
+ * @deprecated{{/isDeprecated}}
+ */{{#isDeprecated}}
+@Deprecated{{/isDeprecated}}{{#description}}
+@ApiModel(description = "{{{.}}}"){{/description}}
+{{#jackson}}
+@JsonPropertyOrder({
+{{#vars}}
+ {{classname}}.JSON_PROPERTY_{{nameInSnakeCase}}{{^-last}},{{/-last}}
+{{/vars}}
+})
+{{#isClassnameSanitized}}
+@JsonTypeName("{{name}}")
+{{/isClassnameSanitized}}
+{{/jackson}}
+{{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}}{{>xmlAnnotation}}
+{{#vendorExtensions.x-class-extra-annotation}}
+{{{vendorExtensions.x-class-extra-annotation}}}
+{{/vendorExtensions.x-class-extra-annotation}}
+public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtensions.x-implements}}{{#-first}}implements {{{.}}}{{/-first}}{{^-first}}, {{{.}}}{{/-first}}{{#-last}} {{/-last}}{{/vendorExtensions.x-implements}}{
+{{#serializableModel}}
+ private static final long serialVersionUID = 1L;
+
+{{/serializableModel}}
+ {{#vars}}
+ {{#isEnum}}
+ {{^isContainer}}
+ {{^vendorExtensions.x-enum-as-string}}
+{{>modelInnerEnum}}
+ {{/vendorExtensions.x-enum-as-string}}
+ {{/isContainer}}
+ {{#isContainer}}
+ {{#mostInnerItems}}
+{{>modelInnerEnum}}
+ {{/mostInnerItems}}
+ {{/isContainer}}
+ {{/isEnum}}
+ {{#gson}}
+ public static final String SERIALIZED_NAME_{{nameInSnakeCase}} = "{{baseName}}";
+ {{/gson}}
+ {{#jackson}}
+ public static final String JSON_PROPERTY_{{nameInSnakeCase}} = "{{baseName}}";
+ {{/jackson}}
+ {{#withXml}}
+ {{#isXmlAttribute}}
+ @XmlAttribute(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}")
+ {{/isXmlAttribute}}
+ {{^isXmlAttribute}}
+ {{^isContainer}}
+ @XmlElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}")
+ {{/isContainer}}
+ {{#isContainer}}
+ // Is a container wrapped={{isXmlWrapped}}
+ {{#items}}
+ // items.name={{name}} items.baseName={{baseName}} items.xmlName={{xmlName}} items.xmlNamespace={{xmlNamespace}}
+ // items.example={{example}} items.type={{dataType}}
+ @XmlElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}")
+ {{/items}}
+ {{#isXmlWrapped}}
+ @XmlElementWrapper({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}")
+ {{/isXmlWrapped}}
+ {{/isContainer}}
+ {{/isXmlAttribute}}
+ {{/withXml}}
+ {{#gson}}
+ @SerializedName(SERIALIZED_NAME_{{nameInSnakeCase}})
+ {{/gson}}
+ {{#vendorExtensions.x-field-extra-annotation}}
+ {{{vendorExtensions.x-field-extra-annotation}}}
+ {{/vendorExtensions.x-field-extra-annotation}}
+ {{#vendorExtensions.x-is-jackson-optional-nullable}}
+ {{#isContainer}}
+ private JsonNullable<{{{datatypeWithEnum}}}> {{name}} = JsonNullable.<{{{datatypeWithEnum}}}>undefined();
+ {{/isContainer}}
+ {{^isContainer}}
+ private JsonNullable<{{{datatypeWithEnum}}}> {{name}} = JsonNullable.<{{{datatypeWithEnum}}}>{{#defaultValue}}of({{{.}}}){{/defaultValue}}{{^defaultValue}}undefined(){{/defaultValue}};
+ {{/isContainer}}
+ {{/vendorExtensions.x-is-jackson-optional-nullable}}
+ {{^vendorExtensions.x-is-jackson-optional-nullable}}
+ {{#isContainer}}
+ private {{{datatypeWithEnum}}} {{name}}{{#required}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}{{/required}}{{^required}} = null{{/required}};
+ {{/isContainer}}
+ {{^isContainer}}
+ private {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}};
+ {{/isContainer}}
+ {{/vendorExtensions.x-is-jackson-optional-nullable}}
+
+ {{/vars}}
+ public {{classname}}() { {{#parent}}{{#parcelableModel}}
+ super();{{/parcelableModel}}{{/parent}}{{#gson}}{{#discriminator}}
+ this.{{{discriminatorName}}} = this.getClass().getSimpleName();{{/discriminator}}{{/gson}}
+ }{{#vendorExtensions.x-has-readonly-properties}}{{^withXml}}{{#jackson}}
+
+ @JsonCreator
+ public {{classname}}(
+ {{#readOnlyVars}}
+ {{#jackson}}@JsonProperty(JSON_PROPERTY_{{nameInSnakeCase}}){{/jackson}} {{{datatypeWithEnum}}} {{name}}{{^-last}}, {{/-last}}
+ {{/readOnlyVars}}
+ ) {
+ this();
+ {{#readOnlyVars}}
+ this.{{name}} = {{name}};
+ {{/readOnlyVars}}
+ }{{/jackson}}{{/withXml}}{{/vendorExtensions.x-has-readonly-properties}}
+ {{#vars}}
+
+ {{^isReadOnly}}
+ {{#vendorExtensions.x-enum-as-string}}
+ public static final Set {{{nameInSnakeCase}}}_VALUES = new HashSet<>(Arrays.asList(
+ {{#allowableValues}}{{#enumVars}}{{{value}}}{{^-last}}, {{/-last}}{{/enumVars}}{{/allowableValues}}
+ ));
+
+ {{/vendorExtensions.x-enum-as-string}}
+ public {{classname}} {{name}}({{{datatypeWithEnum}}} {{name}}) {
+ {{#vendorExtensions.x-enum-as-string}}
+ if (!{{{nameInSnakeCase}}}_VALUES.contains({{name}})) {
+ throw new IllegalArgumentException({{name}} + " is invalid. Possible values for {{name}}: " + String.join(", ", {{{nameInSnakeCase}}}_VALUES));
+ }
+
+ {{/vendorExtensions.x-enum-as-string}}
+ {{#vendorExtensions.x-is-jackson-optional-nullable}}
+ this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{name}});
+ {{/vendorExtensions.x-is-jackson-optional-nullable}}
+ {{^vendorExtensions.x-is-jackson-optional-nullable}}
+ this.{{name}} = {{name}};
+ {{/vendorExtensions.x-is-jackson-optional-nullable}}
+ return this;
+ }
+ {{#isArray}}
+
+ public {{classname}} add{{nameInCamelCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) {
+ {{#vendorExtensions.x-is-jackson-optional-nullable}}
+ if (this.{{name}} == null || !this.{{name}}.isPresent()) {
+ this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}});
+ }
+ try {
+ this.{{name}}.get().add({{name}}Item);
+ } catch (java.util.NoSuchElementException e) {
+ // this can never happen, as we make sure above that the value is present
+ }
+ return this;
+ {{/vendorExtensions.x-is-jackson-optional-nullable}}
+ {{^vendorExtensions.x-is-jackson-optional-nullable}}
+ {{^required}}
+ if (this.{{name}} == null) {
+ this.{{name}} = {{{defaultValue}}};
+ }
+ {{/required}}
+ this.{{name}}.add({{name}}Item);
+ return this;
+ {{/vendorExtensions.x-is-jackson-optional-nullable}}
+ }
+ {{/isArray}}
+ {{#isMap}}
+
+ public {{classname}} put{{nameInCamelCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) {
+ {{#vendorExtensions.x-is-jackson-optional-nullable}}
+ if (this.{{name}} == null || !this.{{name}}.isPresent()) {
+ this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}});
+ }
+ try {
+ this.{{name}}.get().put(key, {{name}}Item);
+ } catch (java.util.NoSuchElementException e) {
+ // this can never happen, as we make sure above that the value is present
+ }
+ return this;
+ {{/vendorExtensions.x-is-jackson-optional-nullable}}
+ {{^vendorExtensions.x-is-jackson-optional-nullable}}
+ {{^required}}
+ if (this.{{name}} == null) {
+ this.{{name}} = {{{defaultValue}}};
+ }
+ {{/required}}
+ this.{{name}}.put(key, {{name}}Item);
+ return this;
+ {{/vendorExtensions.x-is-jackson-optional-nullable}}
+ }
+ {{/isMap}}
+
+ {{/isReadOnly}}
+ /**
+ {{#description}}
+ * {{.}}
+ {{/description}}
+ {{^description}}
+ * Get {{name}}
+ {{/description}}
+ {{#minimum}}
+ * minimum: {{.}}
+ {{/minimum}}
+ {{#maximum}}
+ * maximum: {{.}}
+ {{/maximum}}
+ * @return {{name}}
+ {{#deprecated}}
+ * @deprecated
+ {{/deprecated}}
+ **/
+{{#deprecated}}
+ @Deprecated
+{{/deprecated}}
+{{#required}}
+{{#isNullable}}
+ @jakarta.annotation.Nullable
+{{/isNullable}}
+{{^isNullable}}
+ @jakarta.annotation.Nonnull
+{{/isNullable}}
+{{/required}}
+{{^required}}
+ @jakarta.annotation.Nullable
+{{/required}}
+{{#useBeanValidation}}{{>beanValidation}}{{/useBeanValidation}} @ApiModelProperty({{#example}}example = "{{{.}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}")
+{{#vendorExtensions.x-extra-annotation}}
+ {{{vendorExtensions.x-extra-annotation}}}
+{{/vendorExtensions.x-extra-annotation}}
+{{#vendorExtensions.x-is-jackson-optional-nullable}}
+ {{!unannotated, Jackson would pick this up automatically and add it *in addition* to the _JsonNullable getter field}}
+ @JsonIgnore
+{{/vendorExtensions.x-is-jackson-optional-nullable}}
+{{^vendorExtensions.x-is-jackson-optional-nullable}}{{#jackson}}{{> jackson_annotations}}{{/jackson}}{{/vendorExtensions.x-is-jackson-optional-nullable}}
+ public {{{datatypeWithEnum}}} {{getter}}() {
+ {{#vendorExtensions.x-is-jackson-optional-nullable}}
+ {{#isReadOnly}}{{! A readonly attribute doesn't have setter => jackson will set null directly if explicitly returned by API, so make sure we have an empty JsonNullable}}
+ if ({{name}} == null) {
+ {{name}} = JsonNullable.<{{{datatypeWithEnum}}}>{{#defaultValue}}of({{{.}}}){{/defaultValue}}{{^defaultValue}}undefined(){{/defaultValue}};
+ }
+ {{/isReadOnly}}
+ return {{name}}.orElse(null);
+ {{/vendorExtensions.x-is-jackson-optional-nullable}}
+ {{^vendorExtensions.x-is-jackson-optional-nullable}}
+ return {{name}};
+ {{/vendorExtensions.x-is-jackson-optional-nullable}}
+ }
+
+ {{#vendorExtensions.x-is-jackson-optional-nullable}}
+{{> jackson_annotations}}
+ public JsonNullable<{{{datatypeWithEnum}}}> {{getter}}_JsonNullable() {
+ return {{name}};
+ }
+ {{/vendorExtensions.x-is-jackson-optional-nullable}}{{#vendorExtensions.x-is-jackson-optional-nullable}}
+ @JsonProperty(JSON_PROPERTY_{{nameInSnakeCase}})
+ {{#isReadOnly}}private{{/isReadOnly}}{{^isReadOnly}}public{{/isReadOnly}} void {{setter}}_JsonNullable(JsonNullable<{{{datatypeWithEnum}}}> {{name}}) {
+ {{! For getters/setters that have name differing from attribute name, we must include setter (albeit private) for jackson to be able to set the attribute}}
+ this.{{name}} = {{name}};
+ }
+ {{/vendorExtensions.x-is-jackson-optional-nullable}}
+
+ {{^isReadOnly}}
+{{#vendorExtensions.x-setter-extra-annotation}} {{{vendorExtensions.x-setter-extra-annotation}}}
+{{/vendorExtensions.x-setter-extra-annotation}}{{#jackson}}{{^vendorExtensions.x-is-jackson-optional-nullable}}{{> jackson_annotations}}{{/vendorExtensions.x-is-jackson-optional-nullable}}{{/jackson}} public void {{setter}}({{{datatypeWithEnum}}} {{name}}) {
+ {{#vendorExtensions.x-enum-as-string}}
+ if (!{{{nameInSnakeCase}}}_VALUES.contains({{name}})) {
+ throw new IllegalArgumentException({{name}} + " is invalid. Possible values for {{name}}: " + String.join(", ", {{{nameInSnakeCase}}}_VALUES));
+ }
+
+ {{/vendorExtensions.x-enum-as-string}}
+ {{#vendorExtensions.x-is-jackson-optional-nullable}}
+ this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{name}});
+ {{/vendorExtensions.x-is-jackson-optional-nullable}}
+ {{^vendorExtensions.x-is-jackson-optional-nullable}}
+ this.{{name}} = {{name}};
+ {{/vendorExtensions.x-is-jackson-optional-nullable}}
+ }
+ {{/isReadOnly}}
+
+ {{/vars}}
+{{>libraries/jersey2/additional_properties}}
+ /**
+ * Return true if this {{name}} object is equal to o.
+ */
+ @Override
+ public boolean equals(Object o) {
+ {{#useReflectionEqualsHashCode}}
+ return EqualsBuilder.reflectionEquals(this, o, false, null, true);
+ {{/useReflectionEqualsHashCode}}
+ {{^useReflectionEqualsHashCode}}
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }{{#hasVars}}
+ {{classname}} {{classVarName}} = ({{classname}}) o;
+ return {{#vars}}{{#vendorExtensions.x-is-jackson-optional-nullable}}equalsNullable(this.{{name}}, {{classVarName}}.{{name}}){{/vendorExtensions.x-is-jackson-optional-nullable}}{{^vendorExtensions.x-is-jackson-optional-nullable}}{{#isByteArray}}Arrays{{/isByteArray}}{{^isByteArray}}Objects{{/isByteArray}}.equals(this.{{name}}, {{classVarName}}.{{name}}){{/vendorExtensions.x-is-jackson-optional-nullable}}{{^-last}} &&
+ {{/-last}}{{/vars}}{{#additionalPropertiesType}}&&
+ Objects.equals(this.additionalProperties, {{classVarName}}.additionalProperties){{/additionalPropertiesType}}{{#parent}} &&
+ super.equals(o){{/parent}};{{/hasVars}}{{^hasVars}}
+ return {{#parent}}super.equals(o){{/parent}}{{^parent}}true{{/parent}};{{/hasVars}}
+ {{/useReflectionEqualsHashCode}}
+ }{{#vendorExtensions.x-jackson-optional-nullable-helpers}}
+
+ private static boolean equalsNullable(JsonNullable a, JsonNullable b) {
+ return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
+ }{{/vendorExtensions.x-jackson-optional-nullable-helpers}}
+
+ @Override
+ public int hashCode() {
+ {{#useReflectionEqualsHashCode}}
+ return HashCodeBuilder.reflectionHashCode(this);
+ {{/useReflectionEqualsHashCode}}
+ {{^useReflectionEqualsHashCode}}
+ return Objects.hash({{#vars}}{{#vendorExtensions.x-is-jackson-optional-nullable}}hashCodeNullable({{name}}){{/vendorExtensions.x-is-jackson-optional-nullable}}{{^vendorExtensions.x-is-jackson-optional-nullable}}{{^isByteArray}}{{name}}{{/isByteArray}}{{#isByteArray}}Arrays.hashCode({{name}}){{/isByteArray}}{{/vendorExtensions.x-is-jackson-optional-nullable}}{{^-last}}, {{/-last}}{{/vars}}{{#parent}}{{#hasVars}}, {{/hasVars}}super.hashCode(){{/parent}}{{#additionalPropertiesType}}{{#hasVars}}, {{/hasVars}}{{^hasVars}}{{#parent}}, {{/parent}}{{/hasVars}}additionalProperties{{/additionalPropertiesType}});
+ {{/useReflectionEqualsHashCode}}
+ }{{#vendorExtensions.x-jackson-optional-nullable-helpers}}
+
+ private static int hashCodeNullable(JsonNullable a) {
+ if (a == null) {
+ return 1;
+ }
+ return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
+ }{{/vendorExtensions.x-jackson-optional-nullable-helpers}}
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class {{classname}} {\n");
+ {{#parent}}
+ sb.append(" ").append(toIndentedString(super.toString())).append("\n");
+ {{/parent}}
+ {{#vars}}
+ sb.append(" {{name}}: ").append(toIndentedString({{name}})).append("\n");
+ {{/vars}}
+ {{#additionalPropertiesType}}
+ sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
+ {{/additionalPropertiesType}}
+ 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 ");
+ }
+
+{{#parcelableModel}}
+
+ public void writeToParcel(Parcel out, int flags) {
+{{#model}}
+{{#isArray}}
+ out.writeList(this);
+{{/isArray}}
+{{^isArray}}
+{{#parent}}
+ super.writeToParcel(out, flags);
+{{/parent}}
+{{#vars}}
+ out.writeValue({{name}});
+{{/vars}}
+{{/isArray}}
+{{/model}}
+ }
+
+ {{classname}}(Parcel in) {
+{{#isArray}}
+ in.readTypedList(this, {{arrayModelType}}.CREATOR);
+{{/isArray}}
+{{^isArray}}
+{{#parent}}
+ super(in);
+{{/parent}}
+{{#vars}}
+{{#isPrimitiveType}}
+ {{name}} = ({{{datatypeWithEnum}}})in.readValue(null);
+{{/isPrimitiveType}}
+{{^isPrimitiveType}}
+ {{name}} = ({{{datatypeWithEnum}}})in.readValue({{complexType}}.class.getClassLoader());
+{{/isPrimitiveType}}
+{{/vars}}
+{{/isArray}}
+ }
+
+ public int describeContents() {
+ return 0;
+ }
+
+ public static final Parcelable.Creator<{{classname}}> CREATOR = new Parcelable.Creator<{{classname}}>() {
+ public {{classname}} createFromParcel(Parcel in) {
+{{#model}}
+{{#isArray}}
+ {{classname}} result = new {{classname}}();
+ result.addAll(in.readArrayList({{arrayModelType}}.class.getClassLoader()));
+ return result;
+{{/isArray}}
+{{^isArray}}
+ return new {{classname}}(in);
+{{/isArray}}
+{{/model}}
+ }
+ public {{classname}}[] newArray(int size) {
+ return new {{classname}}[size];
+ }
+ };
+{{/parcelableModel}}
+{{#discriminator}}
+static {
+ // Initialize and register the discriminator mappings.
+ Map> mappings = new HashMap>();
+ {{#mappedModels}}
+ mappings.put("{{mappingName}}", {{modelName}}.class);
+ {{/mappedModels}}
+ mappings.put("{{name}}", {{classname}}.class);
+ JSON.registerDiscriminator({{classname}}.class, "{{propertyBaseName}}", mappings);
+}
+{{/discriminator}}
+}
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/pom.mustache
new file mode 100644
index 000000000000..a4701007b5fc
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/pom.mustache
@@ -0,0 +1,401 @@
+
+ 4.0.0
+ {{groupId}}
+ {{artifactId}}
+ jar
+ {{artifactId}}
+ {{artifactVersion}}
+ {{artifactUrl}}
+ {{artifactDescription}}
+
+ {{scmConnection}}
+ {{scmDeveloperConnection}}
+ {{scmUrl}}
+
+{{#parentOverridden}}
+
+ {{{parentGroupId}}}
+ {{{parentArtifactId}}}
+ {{{parentVersion}}}
+
+{{/parentOverridden}}
+
+
+
+ {{licenseName}}
+ {{licenseUrl}}
+ repo
+
+
+
+
+
+ {{developerName}}
+ {{developerEmail}}
+ {{developerOrganization}}
+ {{developerOrganizationUrl}}
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-enforcer-plugin
+ 3.0.0
+
+
+ enforce-maven
+
+ enforce
+
+
+
+
+ 2.2.0
+
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-surefire-plugin
+ 3.0.0-M5
+
+
+
+ loggerPath
+ conf/log4j.properties
+
+
+ -Xms512m -Xmx1500m
+ methods
+ 10
+ false
+
+
+
+ maven-dependency-plugin
+
+
+ package
+
+ copy-dependencies
+
+
+ ${project.build.directory}/lib
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-jar-plugin
+ 3.2.2
+
+
+
+ test-jar
+
+
+
+
+
+
+
+ org.codehaus.mojo
+ build-helper-maven-plugin
+ 3.3.0
+
+
+ add_sources
+ generate-sources
+
+ add-source
+
+
+
+ src/main/java
+
+
+
+
+ add_test_sources
+ generate-test-sources
+
+ add-test-source
+
+
+
+ src/test/java
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+ 3.10.1
+
+ 1.8
+ 1.8
+ true
+ 128m
+ 512m
+
+ -Xlint:all
+ -J-Xss4m
+
+
+
+
+ org.apache.maven.plugins
+ maven-javadoc-plugin
+ 3.3.2
+
+
+ attach-javadocs
+
+ jar
+
+
+
+
+ none
+ 1.8
+
+
+ http.response.details
+ a
+ Http Response Details:
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-source-plugin
+ 3.2.0
+
+
+ attach-sources
+
+ jar-no-fork
+
+
+
+
+
+
+ com.diffplug.spotless
+ spotless-maven-plugin
+ ${spotless.version}
+
+
+
+
+
+
+ .gitignore
+
+
+
+
+
+ true
+ 4
+
+
+
+
+
+
+
+
+
+ 1.8
+
+ true
+
+
+
+
+
+
+
+
+
+
+
+ sign-artifacts
+
+
+
+ org.apache.maven.plugins
+ maven-gpg-plugin
+ 3.0.1
+
+
+ sign-artifacts
+ verify
+
+ sign
+
+
+
+
+
+
+
+
+
+
+
+ io.swagger
+ swagger-annotations
+ ${swagger-annotations-version}
+
+
+
+
+ com.google.code.findbugs
+ jsr305
+ 3.0.2
+
+
+
+
+ org.glassfish.jersey.core
+ jersey-client
+ ${jersey-version}
+
+
+ org.glassfish.jersey.inject
+ jersey-hk2
+ ${jersey-version}
+
+
+ org.glassfish.jersey.media
+ jersey-media-multipart
+ ${jersey-version}
+
+
+ org.glassfish.jersey.media
+ jersey-media-json-jackson
+ ${jersey-version}
+
+
+
+
+ com.fasterxml.jackson.core
+ jackson-core
+ ${jackson-version}
+
+
+ com.fasterxml.jackson.core
+ jackson-annotations
+ ${jackson-version}
+
+
+ com.fasterxml.jackson.core
+ jackson-databind
+ ${jackson-databind-version}
+
+ {{#openApiNullable}}
+
+ org.openapitools
+ jackson-databind-nullable
+ ${jackson-databind-nullable-version}
+
+ {{/openApiNullable}}
+ {{#withXml}}
+
+
+ org.glassfish.jersey.media
+ jersey-media-jaxb
+ ${jersey-version}
+
+ {{/withXml}}
+ {{#joda}}
+
+ com.fasterxml.jackson.datatype
+ jackson-datatype-joda
+ ${jackson-version}
+
+ {{/joda}}
+
+ com.fasterxml.jackson.datatype
+ jackson-datatype-jsr310
+ ${jackson-version}
+
+ {{#hasHttpSignatureMethods}}
+
+ org.tomitribe
+ tomitribe-http-signatures
+ ${http-signature-version}
+
+ {{/hasHttpSignatureMethods}}
+ {{#hasOAuthMethods}}
+
+ com.github.scribejava
+ scribejava-apis
+ ${scribejava-apis-version}
+
+ {{/hasOAuthMethods}}
+ {{#useBeanValidation}}
+
+
+ jakarta.validation
+ jakarta.validation-api
+ ${beanvalidation-version}
+ provided
+
+ {{/useBeanValidation}}
+
+ jakarta.annotation
+ jakarta.annotation-api
+ ${jakarta-annotation-version}
+ provided
+
+
+ org.glassfish.jersey.connectors
+ jersey-apache-connector
+ ${jersey-version}
+
+
+
+ org.junit.jupiter
+ junit-jupiter-api
+ ${junit-version}
+ test
+
+
+
+ UTF-8
+ 1.6.5
+ 3.0.4
+ 2.13.2
+ 2.13.2
+ 0.2.2
+ 2.1.0
+ {{#useBeanValidation}}
+ 2.0.2
+ {{/useBeanValidation}}
+ 5.8.2
+ {{#hasHttpSignatureMethods}}
+ 1.7
+ {{/hasHttpSignatureMethods}}
+ {{#hasOAuthMethods}}
+ 8.3.1
+ {{/hasOAuthMethods}}
+ 2.21.0
+
+
diff --git a/pom.xml b/pom.xml
index c46e4824ccca..7072f67639a5 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1250,6 +1250,7 @@
samples/client/petstore/clojure
samples/client/petstore/java/jersey2-java8
samples/openapi3/client/petstore/java/jersey2-java8
+ samples/client/petstore/java/jersey3
samples/client/others/java/okhttp-gson-streaming
samples/client/petstore/java/okhttp-gson
diff --git a/samples/client/petstore/java/jersey3/.github/workflows/maven.yml b/samples/client/petstore/java/jersey3/.github/workflows/maven.yml
new file mode 100644
index 000000000000..89fbd4999bc1
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/.github/workflows/maven.yml
@@ -0,0 +1,30 @@
+# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
+# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
+#
+# This file is auto-generated by OpenAPI Generator (https://openapi-generator.tech)
+
+name: Java CI with Maven
+
+on:
+ push:
+ branches: [ main, master ]
+ pull_request:
+ branches: [ main, master ]
+
+jobs:
+ build:
+ name: Build OpenAPI Petstore
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ java: [ '8' ]
+ steps:
+ - uses: actions/checkout@v2
+ - name: Set up JDK
+ uses: actions/setup-java@v2
+ with:
+ java-version: ${{ matrix.java }}
+ distribution: 'temurin'
+ cache: maven
+ - name: Build with Maven
+ run: mvn -B package --no-transfer-progress --file pom.xml
diff --git a/samples/client/petstore/java/jersey3/.gitignore b/samples/client/petstore/java/jersey3/.gitignore
new file mode 100644
index 000000000000..a530464afa1b
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/.gitignore
@@ -0,0 +1,21 @@
+*.class
+
+# Mobile Tools for Java (J2ME)
+.mtj.tmp/
+
+# Package Files #
+*.jar
+*.war
+*.ear
+
+# exclude jar for gradle wrapper
+!gradle/wrapper/*.jar
+
+# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
+hs_err_pid*
+
+# build files
+**/target
+target
+.gradle
+build
diff --git a/samples/client/petstore/java/jersey3/.openapi-generator-ignore b/samples/client/petstore/java/jersey3/.openapi-generator-ignore
new file mode 100644
index 000000000000..16d6986fc2e5
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/.openapi-generator-ignore
@@ -0,0 +1,4 @@
+# OpenAPI Generator Ignore
+# These are "live" test files which should not be overwritten
+src/test/java/org/openapitools/client/JSONTest.java
+src/test/java/org/openapitools/client/JSONComposedSchemaTest.java
diff --git a/samples/client/petstore/java/jersey3/.openapi-generator/FILES b/samples/client/petstore/java/jersey3/.openapi-generator/FILES
new file mode 100644
index 000000000000..d9a7d4789da6
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/.openapi-generator/FILES
@@ -0,0 +1,201 @@
+.github/workflows/maven.yml
+.gitignore
+.travis.yml
+README.md
+api/openapi.yaml
+build.gradle
+build.sbt
+docs/AdditionalPropertiesClass.md
+docs/Animal.md
+docs/AnotherFakeApi.md
+docs/Apple.md
+docs/AppleReq.md
+docs/ArrayOfArrayOfNumberOnly.md
+docs/ArrayOfNumberOnly.md
+docs/ArrayTest.md
+docs/Banana.md
+docs/BananaReq.md
+docs/BasquePig.md
+docs/Capitalization.md
+docs/Cat.md
+docs/CatAllOf.md
+docs/Category.md
+docs/ChildCat.md
+docs/ChildCatAllOf.md
+docs/ClassModel.md
+docs/Client.md
+docs/ComplexQuadrilateral.md
+docs/DanishPig.md
+docs/DefaultApi.md
+docs/DeprecatedObject.md
+docs/Dog.md
+docs/DogAllOf.md
+docs/Drawing.md
+docs/EnumArrays.md
+docs/EnumClass.md
+docs/EnumTest.md
+docs/EquilateralTriangle.md
+docs/FakeApi.md
+docs/FakeClassnameTags123Api.md
+docs/FileSchemaTestClass.md
+docs/Foo.md
+docs/FormatTest.md
+docs/Fruit.md
+docs/FruitReq.md
+docs/GmFruit.md
+docs/GrandparentAnimal.md
+docs/HasOnlyReadOnly.md
+docs/HealthCheckResult.md
+docs/InlineResponseDefault.md
+docs/IsoscelesTriangle.md
+docs/Mammal.md
+docs/MapTest.md
+docs/MixedPropertiesAndAdditionalPropertiesClass.md
+docs/Model200Response.md
+docs/ModelApiResponse.md
+docs/ModelFile.md
+docs/ModelList.md
+docs/ModelReturn.md
+docs/Name.md
+docs/NullableClass.md
+docs/NullableShape.md
+docs/NumberOnly.md
+docs/ObjectWithDeprecatedFields.md
+docs/Order.md
+docs/OuterComposite.md
+docs/OuterEnum.md
+docs/OuterEnumDefaultValue.md
+docs/OuterEnumInteger.md
+docs/OuterEnumIntegerDefaultValue.md
+docs/ParentPet.md
+docs/Pet.md
+docs/PetApi.md
+docs/Pig.md
+docs/Quadrilateral.md
+docs/QuadrilateralInterface.md
+docs/ReadOnlyFirst.md
+docs/ScaleneTriangle.md
+docs/Shape.md
+docs/ShapeInterface.md
+docs/ShapeOrNull.md
+docs/SimpleQuadrilateral.md
+docs/SpecialModelName.md
+docs/StoreApi.md
+docs/Tag.md
+docs/Triangle.md
+docs/TriangleInterface.md
+docs/User.md
+docs/UserApi.md
+docs/Whale.md
+docs/Zebra.md
+git_push.sh
+gradle.properties
+gradle/wrapper/gradle-wrapper.jar
+gradle/wrapper/gradle-wrapper.properties
+gradlew
+gradlew.bat
+pom.xml
+settings.gradle
+src/main/AndroidManifest.xml
+src/main/java/org/openapitools/client/ApiClient.java
+src/main/java/org/openapitools/client/ApiException.java
+src/main/java/org/openapitools/client/ApiResponse.java
+src/main/java/org/openapitools/client/Configuration.java
+src/main/java/org/openapitools/client/JSON.java
+src/main/java/org/openapitools/client/JavaTimeFormatter.java
+src/main/java/org/openapitools/client/Pair.java
+src/main/java/org/openapitools/client/RFC3339DateFormat.java
+src/main/java/org/openapitools/client/ServerConfiguration.java
+src/main/java/org/openapitools/client/ServerVariable.java
+src/main/java/org/openapitools/client/StringUtil.java
+src/main/java/org/openapitools/client/api/AnotherFakeApi.java
+src/main/java/org/openapitools/client/api/DefaultApi.java
+src/main/java/org/openapitools/client/api/FakeApi.java
+src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java
+src/main/java/org/openapitools/client/api/PetApi.java
+src/main/java/org/openapitools/client/api/StoreApi.java
+src/main/java/org/openapitools/client/api/UserApi.java
+src/main/java/org/openapitools/client/auth/ApiKeyAuth.java
+src/main/java/org/openapitools/client/auth/Authentication.java
+src/main/java/org/openapitools/client/auth/HttpBasicAuth.java
+src/main/java/org/openapitools/client/auth/HttpBearerAuth.java
+src/main/java/org/openapitools/client/auth/HttpSignatureAuth.java
+src/main/java/org/openapitools/client/auth/OAuth.java
+src/main/java/org/openapitools/client/auth/OAuthFlow.java
+src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java
+src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java
+src/main/java/org/openapitools/client/model/Animal.java
+src/main/java/org/openapitools/client/model/Apple.java
+src/main/java/org/openapitools/client/model/AppleReq.java
+src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java
+src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java
+src/main/java/org/openapitools/client/model/ArrayTest.java
+src/main/java/org/openapitools/client/model/Banana.java
+src/main/java/org/openapitools/client/model/BananaReq.java
+src/main/java/org/openapitools/client/model/BasquePig.java
+src/main/java/org/openapitools/client/model/Capitalization.java
+src/main/java/org/openapitools/client/model/Cat.java
+src/main/java/org/openapitools/client/model/CatAllOf.java
+src/main/java/org/openapitools/client/model/Category.java
+src/main/java/org/openapitools/client/model/ChildCat.java
+src/main/java/org/openapitools/client/model/ChildCatAllOf.java
+src/main/java/org/openapitools/client/model/ClassModel.java
+src/main/java/org/openapitools/client/model/Client.java
+src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java
+src/main/java/org/openapitools/client/model/DanishPig.java
+src/main/java/org/openapitools/client/model/DeprecatedObject.java
+src/main/java/org/openapitools/client/model/Dog.java
+src/main/java/org/openapitools/client/model/DogAllOf.java
+src/main/java/org/openapitools/client/model/Drawing.java
+src/main/java/org/openapitools/client/model/EnumArrays.java
+src/main/java/org/openapitools/client/model/EnumClass.java
+src/main/java/org/openapitools/client/model/EnumTest.java
+src/main/java/org/openapitools/client/model/EquilateralTriangle.java
+src/main/java/org/openapitools/client/model/FileSchemaTestClass.java
+src/main/java/org/openapitools/client/model/Foo.java
+src/main/java/org/openapitools/client/model/FormatTest.java
+src/main/java/org/openapitools/client/model/Fruit.java
+src/main/java/org/openapitools/client/model/FruitReq.java
+src/main/java/org/openapitools/client/model/GmFruit.java
+src/main/java/org/openapitools/client/model/GrandparentAnimal.java
+src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java
+src/main/java/org/openapitools/client/model/HealthCheckResult.java
+src/main/java/org/openapitools/client/model/InlineResponseDefault.java
+src/main/java/org/openapitools/client/model/IsoscelesTriangle.java
+src/main/java/org/openapitools/client/model/Mammal.java
+src/main/java/org/openapitools/client/model/MapTest.java
+src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java
+src/main/java/org/openapitools/client/model/Model200Response.java
+src/main/java/org/openapitools/client/model/ModelApiResponse.java
+src/main/java/org/openapitools/client/model/ModelFile.java
+src/main/java/org/openapitools/client/model/ModelList.java
+src/main/java/org/openapitools/client/model/ModelReturn.java
+src/main/java/org/openapitools/client/model/Name.java
+src/main/java/org/openapitools/client/model/NullableClass.java
+src/main/java/org/openapitools/client/model/NullableShape.java
+src/main/java/org/openapitools/client/model/NumberOnly.java
+src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java
+src/main/java/org/openapitools/client/model/Order.java
+src/main/java/org/openapitools/client/model/OuterComposite.java
+src/main/java/org/openapitools/client/model/OuterEnum.java
+src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java
+src/main/java/org/openapitools/client/model/OuterEnumInteger.java
+src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java
+src/main/java/org/openapitools/client/model/ParentPet.java
+src/main/java/org/openapitools/client/model/Pet.java
+src/main/java/org/openapitools/client/model/Pig.java
+src/main/java/org/openapitools/client/model/Quadrilateral.java
+src/main/java/org/openapitools/client/model/QuadrilateralInterface.java
+src/main/java/org/openapitools/client/model/ReadOnlyFirst.java
+src/main/java/org/openapitools/client/model/ScaleneTriangle.java
+src/main/java/org/openapitools/client/model/Shape.java
+src/main/java/org/openapitools/client/model/ShapeInterface.java
+src/main/java/org/openapitools/client/model/ShapeOrNull.java
+src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java
+src/main/java/org/openapitools/client/model/SpecialModelName.java
+src/main/java/org/openapitools/client/model/Tag.java
+src/main/java/org/openapitools/client/model/Triangle.java
+src/main/java/org/openapitools/client/model/TriangleInterface.java
+src/main/java/org/openapitools/client/model/User.java
+src/main/java/org/openapitools/client/model/Whale.java
+src/main/java/org/openapitools/client/model/Zebra.java
diff --git a/samples/client/petstore/java/jersey3/.openapi-generator/VERSION b/samples/client/petstore/java/jersey3/.openapi-generator/VERSION
new file mode 100644
index 000000000000..5f68295fc196
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/.openapi-generator/VERSION
@@ -0,0 +1 @@
+6.0.0-SNAPSHOT
\ No newline at end of file
diff --git a/samples/client/petstore/java/jersey3/.travis.yml b/samples/client/petstore/java/jersey3/.travis.yml
new file mode 100644
index 000000000000..1b6741c083c7
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/.travis.yml
@@ -0,0 +1,22 @@
+#
+# Generated by OpenAPI Generator: https://openapi-generator.tech
+#
+# Ref: https://docs.travis-ci.com/user/languages/java/
+#
+language: java
+jdk:
+ - openjdk12
+ - openjdk11
+ - openjdk10
+ - openjdk9
+ - openjdk8
+before_install:
+ # ensure gradlew has proper permission
+ - chmod a+x ./gradlew
+script:
+ # test using maven
+ #- mvn test
+ # test using gradle
+ - gradle test
+ # test using sbt
+ # - sbt test
diff --git a/samples/client/petstore/java/jersey3/README.md b/samples/client/petstore/java/jersey3/README.md
new file mode 100644
index 000000000000..a03601a1c49f
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/README.md
@@ -0,0 +1,287 @@
+# petstore-jersey3
+
+OpenAPI Petstore
+
+- API version: 1.0.0
+
+This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+
+*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)*
+
+## Requirements
+
+Building the API client library requires:
+
+1. Java 1.8+
+2. Maven/Gradle
+
+## Installation
+
+To install the API client library to your local Maven repository, simply execute:
+
+```shell
+mvn clean install
+```
+
+To deploy it to a remote Maven repository instead, configure the settings of the repository and execute:
+
+```shell
+mvn clean deploy
+```
+
+Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information.
+
+### Maven users
+
+Add this dependency to your project's POM:
+
+```xml
+
+ org.openapitools
+ petstore-jersey3
+ 1.0.0
+ compile
+
+```
+
+### Gradle users
+
+Add this dependency to your project's build file:
+
+```groovy
+ repositories {
+ mavenCentral() // Needed if the 'petstore-jersey3' jar has been published to maven central.
+ mavenLocal() // Needed if the 'petstore-jersey3' jar has been published to the local maven repo.
+ }
+
+ dependencies {
+ implementation "org.openapitools:petstore-jersey3:1.0.0"
+ }
+```
+
+### Others
+
+At first generate the JAR by executing:
+
+```shell
+mvn clean package
+```
+
+Then manually install the following JARs:
+
+- `target/petstore-jersey3-1.0.0.jar`
+- `target/lib/*.jar`
+
+## Getting Started
+
+Please follow the [installation](#installation) instruction and execute the following Java code:
+
+```java
+
+import org.openapitools.client.*;
+import org.openapitools.client.auth.*;
+import org.openapitools.client.model.*;
+import org.openapitools.client.api.AnotherFakeApi;
+
+public class AnotherFakeApiExample {
+
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ AnotherFakeApi apiInstance = new AnotherFakeApi(defaultClient);
+ Client client = new Client(); // Client | client model
+ try {
+ Client result = apiInstance.call123testSpecialTags(client);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling AnotherFakeApi#call123testSpecialTags");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+
+```
+
+## Documentation for API Endpoints
+
+All URIs are relative to *http://petstore.swagger.io:80/v2*
+
+Class | Method | HTTP request | Description
+------------ | ------------- | ------------- | -------------
+*AnotherFakeApi* | [**call123testSpecialTags**](docs/AnotherFakeApi.md#call123testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags
+*DefaultApi* | [**fooGet**](docs/DefaultApi.md#fooGet) | **GET** /foo |
+*FakeApi* | [**fakeHealthGet**](docs/FakeApi.md#fakeHealthGet) | **GET** /fake/health | Health check endpoint
+*FakeApi* | [**fakeOuterBooleanSerialize**](docs/FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean |
+*FakeApi* | [**fakeOuterCompositeSerialize**](docs/FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite |
+*FakeApi* | [**fakeOuterNumberSerialize**](docs/FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number |
+*FakeApi* | [**fakeOuterStringSerialize**](docs/FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string |
+*FakeApi* | [**getArrayOfEnums**](docs/FakeApi.md#getArrayOfEnums) | **GET** /fake/array-of-enums | Array of Enums
+*FakeApi* | [**testBodyWithFileSchema**](docs/FakeApi.md#testBodyWithFileSchema) | **PUT** /fake/body-with-file-schema |
+*FakeApi* | [**testBodyWithQueryParams**](docs/FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params |
+*FakeApi* | [**testClientModel**](docs/FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model
+*FakeApi* | [**testEndpointParameters**](docs/FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
+*FakeApi* | [**testEnumParameters**](docs/FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters
+*FakeApi* | [**testGroupParameters**](docs/FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional)
+*FakeApi* | [**testInlineAdditionalProperties**](docs/FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties
+*FakeApi* | [**testJsonFormData**](docs/FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data
+*FakeApi* | [**testQueryParameterCollectionFormat**](docs/FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-parameters |
+*FakeClassnameTags123Api* | [**testClassname**](docs/FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case
+*PetApi* | [**addPet**](docs/PetApi.md#addPet) | **POST** /pet | Add a new pet to the store
+*PetApi* | [**deletePet**](docs/PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet
+*PetApi* | [**findPetsByStatus**](docs/PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status
+*PetApi* | [**findPetsByTags**](docs/PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags
+*PetApi* | [**getPetById**](docs/PetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID
+*PetApi* | [**updatePet**](docs/PetApi.md#updatePet) | **PUT** /pet | Update an existing pet
+*PetApi* | [**updatePetWithForm**](docs/PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data
+*PetApi* | [**uploadFile**](docs/PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image
+*PetApi* | [**uploadFileWithRequiredFile**](docs/PetApi.md#uploadFileWithRequiredFile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required)
+*StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID
+*StoreApi* | [**getInventory**](docs/StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status
+*StoreApi* | [**getOrderById**](docs/StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID
+*StoreApi* | [**placeOrder**](docs/StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet
+*UserApi* | [**createUser**](docs/UserApi.md#createUser) | **POST** /user | Create user
+*UserApi* | [**createUsersWithArrayInput**](docs/UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array
+*UserApi* | [**createUsersWithListInput**](docs/UserApi.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array
+*UserApi* | [**deleteUser**](docs/UserApi.md#deleteUser) | **DELETE** /user/{username} | Delete user
+*UserApi* | [**getUserByName**](docs/UserApi.md#getUserByName) | **GET** /user/{username} | Get user by user name
+*UserApi* | [**loginUser**](docs/UserApi.md#loginUser) | **GET** /user/login | Logs user into the system
+*UserApi* | [**logoutUser**](docs/UserApi.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session
+*UserApi* | [**updateUser**](docs/UserApi.md#updateUser) | **PUT** /user/{username} | Updated user
+
+
+## Documentation for Models
+
+ - [AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md)
+ - [Animal](docs/Animal.md)
+ - [Apple](docs/Apple.md)
+ - [AppleReq](docs/AppleReq.md)
+ - [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md)
+ - [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md)
+ - [ArrayTest](docs/ArrayTest.md)
+ - [Banana](docs/Banana.md)
+ - [BananaReq](docs/BananaReq.md)
+ - [BasquePig](docs/BasquePig.md)
+ - [Capitalization](docs/Capitalization.md)
+ - [Cat](docs/Cat.md)
+ - [CatAllOf](docs/CatAllOf.md)
+ - [Category](docs/Category.md)
+ - [ChildCat](docs/ChildCat.md)
+ - [ChildCatAllOf](docs/ChildCatAllOf.md)
+ - [ClassModel](docs/ClassModel.md)
+ - [Client](docs/Client.md)
+ - [ComplexQuadrilateral](docs/ComplexQuadrilateral.md)
+ - [DanishPig](docs/DanishPig.md)
+ - [DeprecatedObject](docs/DeprecatedObject.md)
+ - [Dog](docs/Dog.md)
+ - [DogAllOf](docs/DogAllOf.md)
+ - [Drawing](docs/Drawing.md)
+ - [EnumArrays](docs/EnumArrays.md)
+ - [EnumClass](docs/EnumClass.md)
+ - [EnumTest](docs/EnumTest.md)
+ - [EquilateralTriangle](docs/EquilateralTriangle.md)
+ - [FileSchemaTestClass](docs/FileSchemaTestClass.md)
+ - [Foo](docs/Foo.md)
+ - [FormatTest](docs/FormatTest.md)
+ - [Fruit](docs/Fruit.md)
+ - [FruitReq](docs/FruitReq.md)
+ - [GmFruit](docs/GmFruit.md)
+ - [GrandparentAnimal](docs/GrandparentAnimal.md)
+ - [HasOnlyReadOnly](docs/HasOnlyReadOnly.md)
+ - [HealthCheckResult](docs/HealthCheckResult.md)
+ - [InlineResponseDefault](docs/InlineResponseDefault.md)
+ - [IsoscelesTriangle](docs/IsoscelesTriangle.md)
+ - [Mammal](docs/Mammal.md)
+ - [MapTest](docs/MapTest.md)
+ - [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md)
+ - [Model200Response](docs/Model200Response.md)
+ - [ModelApiResponse](docs/ModelApiResponse.md)
+ - [ModelFile](docs/ModelFile.md)
+ - [ModelList](docs/ModelList.md)
+ - [ModelReturn](docs/ModelReturn.md)
+ - [Name](docs/Name.md)
+ - [NullableClass](docs/NullableClass.md)
+ - [NullableShape](docs/NullableShape.md)
+ - [NumberOnly](docs/NumberOnly.md)
+ - [ObjectWithDeprecatedFields](docs/ObjectWithDeprecatedFields.md)
+ - [Order](docs/Order.md)
+ - [OuterComposite](docs/OuterComposite.md)
+ - [OuterEnum](docs/OuterEnum.md)
+ - [OuterEnumDefaultValue](docs/OuterEnumDefaultValue.md)
+ - [OuterEnumInteger](docs/OuterEnumInteger.md)
+ - [OuterEnumIntegerDefaultValue](docs/OuterEnumIntegerDefaultValue.md)
+ - [ParentPet](docs/ParentPet.md)
+ - [Pet](docs/Pet.md)
+ - [Pig](docs/Pig.md)
+ - [Quadrilateral](docs/Quadrilateral.md)
+ - [QuadrilateralInterface](docs/QuadrilateralInterface.md)
+ - [ReadOnlyFirst](docs/ReadOnlyFirst.md)
+ - [ScaleneTriangle](docs/ScaleneTriangle.md)
+ - [Shape](docs/Shape.md)
+ - [ShapeInterface](docs/ShapeInterface.md)
+ - [ShapeOrNull](docs/ShapeOrNull.md)
+ - [SimpleQuadrilateral](docs/SimpleQuadrilateral.md)
+ - [SpecialModelName](docs/SpecialModelName.md)
+ - [Tag](docs/Tag.md)
+ - [Triangle](docs/Triangle.md)
+ - [TriangleInterface](docs/TriangleInterface.md)
+ - [User](docs/User.md)
+ - [Whale](docs/Whale.md)
+ - [Zebra](docs/Zebra.md)
+
+
+## Documentation for Authorization
+
+Authentication schemes defined for the API:
+### api_key
+
+
+- **Type**: API key
+- **API key parameter name**: api_key
+- **Location**: HTTP header
+
+### api_key_query
+
+
+- **Type**: API key
+- **API key parameter name**: api_key_query
+- **Location**: URL query string
+
+### bearer_test
+
+
+- **Type**: HTTP basic authentication
+
+### http_basic_test
+
+
+- **Type**: HTTP basic authentication
+
+### http_signature_test
+
+
+- **Type**: HTTP basic authentication
+
+### petstore_auth
+
+
+- **Type**: OAuth
+- **Flow**: implicit
+- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog
+- **Scopes**:
+ - write:pets: modify pets in your account
+ - read:pets: read your pets
+
+
+## Recommendation
+
+It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues.
+
+## Author
+
+
+
diff --git a/samples/client/petstore/java/jersey3/api/openapi.yaml b/samples/client/petstore/java/jersey3/api/openapi.yaml
new file mode 100644
index 000000000000..6e508514df84
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/api/openapi.yaml
@@ -0,0 +1,2493 @@
+openapi: 3.0.0
+info:
+ description: "This spec is mainly for testing Petstore server and contains fake\
+ \ endpoints, models. Please do not use this for any other purpose. Special characters:\
+ \ \" \\"
+ license:
+ name: Apache-2.0
+ url: https://www.apache.org/licenses/LICENSE-2.0.html
+ title: OpenAPI Petstore
+ version: 1.0.0
+servers:
+- description: petstore server
+ url: "http://{server}.swagger.io:{port}/v2"
+ variables:
+ server:
+ default: petstore
+ enum:
+ - petstore
+ - qa-petstore
+ - dev-petstore
+ port:
+ default: "80"
+ enum:
+ - "80"
+ - "8080"
+- description: The local server
+ url: "https://localhost:8080/{version}"
+ variables:
+ version:
+ default: v2
+ enum:
+ - v1
+ - v2
+- description: The local server without variables
+ url: https://127.0.0.1/no_variable
+tags:
+- description: Everything about your Pets
+ name: pet
+- description: Access to Petstore orders
+ name: store
+- description: Operations about user
+ name: user
+paths:
+ /foo:
+ get:
+ responses:
+ default:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/inline_response_default'
+ description: response
+ x-accepts: application/json
+ /pet:
+ post:
+ description: ""
+ operationId: addPet
+ requestBody:
+ $ref: '#/components/requestBodies/Pet'
+ responses:
+ "405":
+ description: Invalid input
+ security:
+ - http_signature_test: []
+ - petstore_auth:
+ - write:pets
+ - read:pets
+ summary: Add a new pet to the store
+ tags:
+ - pet
+ x-content-type: application/json
+ x-accepts: application/json
+ put:
+ description: ""
+ operationId: updatePet
+ requestBody:
+ $ref: '#/components/requestBodies/Pet'
+ responses:
+ "400":
+ description: Invalid ID supplied
+ "404":
+ description: Pet not found
+ "405":
+ description: Validation exception
+ security:
+ - http_signature_test: []
+ - petstore_auth:
+ - write:pets
+ - read:pets
+ summary: Update an existing pet
+ tags:
+ - pet
+ x-content-type: application/json
+ x-accepts: application/json
+ servers:
+ - url: http://petstore.swagger.io/v2
+ - url: http://path-server-test.petstore.local/v2
+ /pet/findByStatus:
+ get:
+ description: Multiple status values can be provided with comma separated strings
+ operationId: findPetsByStatus
+ parameters:
+ - deprecated: true
+ description: Status values that need to be considered for filter
+ explode: false
+ in: query
+ name: status
+ required: true
+ schema:
+ items:
+ default: available
+ enum:
+ - available
+ - pending
+ - sold
+ type: string
+ type: array
+ style: form
+ responses:
+ "200":
+ content:
+ application/xml:
+ schema:
+ items:
+ $ref: '#/components/schemas/Pet'
+ type: array
+ application/json:
+ schema:
+ items:
+ $ref: '#/components/schemas/Pet'
+ type: array
+ description: successful operation
+ "400":
+ description: Invalid status value
+ security:
+ - http_signature_test: []
+ - petstore_auth:
+ - write:pets
+ - read:pets
+ summary: Finds Pets by status
+ tags:
+ - pet
+ x-accepts: application/json
+ /pet/findByTags:
+ get:
+ deprecated: true
+ description: "Multiple tags can be provided with comma separated strings. Use\
+ \ tag1, tag2, tag3 for testing."
+ operationId: findPetsByTags
+ parameters:
+ - description: Tags to filter by
+ explode: false
+ in: query
+ name: tags
+ required: true
+ schema:
+ items:
+ type: string
+ type: array
+ style: form
+ responses:
+ "200":
+ content:
+ application/xml:
+ schema:
+ items:
+ $ref: '#/components/schemas/Pet'
+ type: array
+ application/json:
+ schema:
+ items:
+ $ref: '#/components/schemas/Pet'
+ type: array
+ description: successful operation
+ "400":
+ description: Invalid tag value
+ security:
+ - http_signature_test: []
+ - petstore_auth:
+ - write:pets
+ - read:pets
+ summary: Finds Pets by tags
+ tags:
+ - pet
+ x-accepts: application/json
+ /pet/{petId}:
+ delete:
+ description: ""
+ operationId: deletePet
+ parameters:
+ - explode: false
+ in: header
+ name: api_key
+ required: false
+ schema:
+ type: string
+ style: simple
+ - description: Pet id to delete
+ explode: false
+ in: path
+ name: petId
+ required: true
+ schema:
+ format: int64
+ type: integer
+ style: simple
+ responses:
+ "400":
+ description: Invalid pet value
+ security:
+ - petstore_auth:
+ - write:pets
+ - read:pets
+ summary: Deletes a pet
+ tags:
+ - pet
+ x-accepts: application/json
+ get:
+ description: Returns a single pet
+ operationId: getPetById
+ parameters:
+ - description: ID of pet to return
+ explode: false
+ in: path
+ name: petId
+ required: true
+ schema:
+ format: int64
+ type: integer
+ style: simple
+ responses:
+ "200":
+ content:
+ application/xml:
+ schema:
+ $ref: '#/components/schemas/Pet'
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Pet'
+ description: successful operation
+ "400":
+ description: Invalid ID supplied
+ "404":
+ description: Pet not found
+ security:
+ - api_key: []
+ summary: Find pet by ID
+ tags:
+ - pet
+ x-accepts: application/json
+ post:
+ description: ""
+ operationId: updatePetWithForm
+ parameters:
+ - description: ID of pet that needs to be updated
+ explode: false
+ in: path
+ name: petId
+ required: true
+ schema:
+ format: int64
+ type: integer
+ style: simple
+ requestBody:
+ $ref: '#/components/requestBodies/inline_object'
+ content:
+ application/x-www-form-urlencoded:
+ schema:
+ properties:
+ name:
+ description: Updated name of the pet
+ type: string
+ status:
+ description: Updated status of the pet
+ type: string
+ type: object
+ responses:
+ "405":
+ description: Invalid input
+ security:
+ - petstore_auth:
+ - write:pets
+ - read:pets
+ summary: Updates a pet in the store with form data
+ tags:
+ - pet
+ x-content-type: application/x-www-form-urlencoded
+ x-accepts: application/json
+ /pet/{petId}/uploadImage:
+ post:
+ description: ""
+ operationId: uploadFile
+ parameters:
+ - description: ID of pet to update
+ explode: false
+ in: path
+ name: petId
+ required: true
+ schema:
+ format: int64
+ type: integer
+ style: simple
+ requestBody:
+ $ref: '#/components/requestBodies/inline_object_1'
+ content:
+ multipart/form-data:
+ schema:
+ properties:
+ additionalMetadata:
+ description: Additional data to pass to server
+ type: string
+ file:
+ description: file to upload
+ format: binary
+ type: string
+ type: object
+ responses:
+ "200":
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiResponse'
+ description: successful operation
+ security:
+ - petstore_auth:
+ - write:pets
+ - read:pets
+ summary: uploads an image
+ tags:
+ - pet
+ x-content-type: multipart/form-data
+ x-accepts: application/json
+ /store/inventory:
+ get:
+ description: Returns a map of status codes to quantities
+ operationId: getInventory
+ responses:
+ "200":
+ content:
+ application/json:
+ schema:
+ additionalProperties:
+ format: int32
+ type: integer
+ type: object
+ description: successful operation
+ security:
+ - api_key: []
+ summary: Returns pet inventories by status
+ tags:
+ - store
+ x-accepts: application/json
+ /store/order:
+ post:
+ description: ""
+ operationId: placeOrder
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Order'
+ description: order placed for purchasing the pet
+ required: true
+ responses:
+ "200":
+ content:
+ application/xml:
+ schema:
+ $ref: '#/components/schemas/Order'
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Order'
+ description: successful operation
+ "400":
+ description: Invalid Order
+ summary: Place an order for a pet
+ tags:
+ - store
+ x-content-type: application/json
+ x-accepts: application/json
+ /store/order/{order_id}:
+ delete:
+ description: For valid response try integer IDs with value < 1000. Anything
+ above 1000 or nonintegers will generate API errors
+ operationId: deleteOrder
+ parameters:
+ - description: ID of the order that needs to be deleted
+ explode: false
+ in: path
+ name: order_id
+ required: true
+ schema:
+ type: string
+ style: simple
+ responses:
+ "400":
+ description: Invalid ID supplied
+ "404":
+ description: Order not found
+ summary: Delete purchase order by ID
+ tags:
+ - store
+ x-accepts: application/json
+ get:
+ description: For valid response try integer IDs with value <= 5 or > 10. Other
+ values will generated exceptions
+ operationId: getOrderById
+ parameters:
+ - description: ID of pet that needs to be fetched
+ explode: false
+ in: path
+ name: order_id
+ required: true
+ schema:
+ format: int64
+ maximum: 5
+ minimum: 1
+ type: integer
+ style: simple
+ responses:
+ "200":
+ content:
+ application/xml:
+ schema:
+ $ref: '#/components/schemas/Order'
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Order'
+ description: successful operation
+ "400":
+ description: Invalid ID supplied
+ "404":
+ description: Order not found
+ summary: Find purchase order by ID
+ tags:
+ - store
+ x-accepts: application/json
+ /user:
+ post:
+ description: This can only be done by the logged in user.
+ operationId: createUser
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/User'
+ description: Created user object
+ required: true
+ responses:
+ default:
+ description: successful operation
+ summary: Create user
+ tags:
+ - user
+ x-content-type: application/json
+ x-accepts: application/json
+ /user/createWithArray:
+ post:
+ description: ""
+ operationId: createUsersWithArrayInput
+ requestBody:
+ $ref: '#/components/requestBodies/UserArray'
+ responses:
+ default:
+ description: successful operation
+ summary: Creates list of users with given input array
+ tags:
+ - user
+ x-content-type: application/json
+ x-accepts: application/json
+ /user/createWithList:
+ post:
+ description: ""
+ operationId: createUsersWithListInput
+ requestBody:
+ $ref: '#/components/requestBodies/UserArray'
+ responses:
+ default:
+ description: successful operation
+ summary: Creates list of users with given input array
+ tags:
+ - user
+ x-content-type: application/json
+ x-accepts: application/json
+ /user/login:
+ get:
+ description: ""
+ operationId: loginUser
+ parameters:
+ - description: The user name for login
+ explode: true
+ in: query
+ name: username
+ required: true
+ schema:
+ type: string
+ style: form
+ - description: The password for login in clear text
+ explode: true
+ in: query
+ name: password
+ required: true
+ schema:
+ type: string
+ style: form
+ responses:
+ "200":
+ content:
+ application/xml:
+ schema:
+ type: string
+ application/json:
+ schema:
+ type: string
+ description: successful operation
+ headers:
+ X-Rate-Limit:
+ description: calls per hour allowed by the user
+ explode: false
+ schema:
+ format: int32
+ type: integer
+ style: simple
+ X-Expires-After:
+ description: date in UTC when token expires
+ explode: false
+ schema:
+ format: date-time
+ type: string
+ style: simple
+ "400":
+ description: Invalid username/password supplied
+ summary: Logs user into the system
+ tags:
+ - user
+ x-accepts: application/json
+ /user/logout:
+ get:
+ description: ""
+ operationId: logoutUser
+ responses:
+ default:
+ description: successful operation
+ summary: Logs out current logged in user session
+ tags:
+ - user
+ x-accepts: application/json
+ /user/{username}:
+ delete:
+ description: This can only be done by the logged in user.
+ operationId: deleteUser
+ parameters:
+ - description: The name that needs to be deleted
+ explode: false
+ in: path
+ name: username
+ required: true
+ schema:
+ type: string
+ style: simple
+ responses:
+ "400":
+ description: Invalid username supplied
+ "404":
+ description: User not found
+ summary: Delete user
+ tags:
+ - user
+ x-accepts: application/json
+ get:
+ description: ""
+ operationId: getUserByName
+ parameters:
+ - description: The name that needs to be fetched. Use user1 for testing.
+ explode: false
+ in: path
+ name: username
+ required: true
+ schema:
+ type: string
+ style: simple
+ responses:
+ "200":
+ content:
+ application/xml:
+ schema:
+ $ref: '#/components/schemas/User'
+ application/json:
+ schema:
+ $ref: '#/components/schemas/User'
+ description: successful operation
+ "400":
+ description: Invalid username supplied
+ "404":
+ description: User not found
+ summary: Get user by user name
+ tags:
+ - user
+ x-accepts: application/json
+ put:
+ description: This can only be done by the logged in user.
+ operationId: updateUser
+ parameters:
+ - description: name that need to be deleted
+ explode: false
+ in: path
+ name: username
+ required: true
+ schema:
+ type: string
+ style: simple
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/User'
+ description: Updated user object
+ required: true
+ responses:
+ "400":
+ description: Invalid user supplied
+ "404":
+ description: User not found
+ summary: Updated user
+ tags:
+ - user
+ x-content-type: application/json
+ x-accepts: application/json
+ /fake_classname_test:
+ patch:
+ description: To test class name in snake case
+ operationId: testClassname
+ requestBody:
+ $ref: '#/components/requestBodies/Client'
+ responses:
+ "200":
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Client'
+ description: successful operation
+ security:
+ - api_key_query: []
+ summary: To test class name in snake case
+ tags:
+ - fake_classname_tags 123#$%^
+ x-content-type: application/json
+ x-accepts: application/json
+ /fake:
+ delete:
+ description: Fake endpoint to test group parameters (optional)
+ operationId: testGroupParameters
+ parameters:
+ - description: Required String in group parameters
+ explode: true
+ in: query
+ name: required_string_group
+ required: true
+ schema:
+ type: integer
+ style: form
+ - description: Required Boolean in group parameters
+ explode: false
+ in: header
+ name: required_boolean_group
+ required: true
+ schema:
+ type: boolean
+ style: simple
+ - description: Required Integer in group parameters
+ explode: true
+ in: query
+ name: required_int64_group
+ required: true
+ schema:
+ format: int64
+ type: integer
+ style: form
+ - description: String in group parameters
+ explode: true
+ in: query
+ name: string_group
+ required: false
+ schema:
+ type: integer
+ style: form
+ - description: Boolean in group parameters
+ explode: false
+ in: header
+ name: boolean_group
+ required: false
+ schema:
+ type: boolean
+ style: simple
+ - description: Integer in group parameters
+ explode: true
+ in: query
+ name: int64_group
+ required: false
+ schema:
+ format: int64
+ type: integer
+ style: form
+ responses:
+ "400":
+ description: Someting wrong
+ security:
+ - bearer_test: []
+ summary: Fake endpoint to test group parameters (optional)
+ tags:
+ - fake
+ x-group-parameters: true
+ x-accepts: application/json
+ get:
+ description: To test enum parameters
+ operationId: testEnumParameters
+ parameters:
+ - description: Header parameter enum test (string array)
+ explode: false
+ in: header
+ name: enum_header_string_array
+ required: false
+ schema:
+ items:
+ default: $
+ enum:
+ - '>'
+ - $
+ type: string
+ type: array
+ style: simple
+ - description: Header parameter enum test (string)
+ explode: false
+ in: header
+ name: enum_header_string
+ required: false
+ schema:
+ default: -efg
+ enum:
+ - _abc
+ - -efg
+ - (xyz)
+ type: string
+ style: simple
+ - description: Query parameter enum test (string array)
+ explode: true
+ in: query
+ name: enum_query_string_array
+ required: false
+ schema:
+ items:
+ default: $
+ enum:
+ - '>'
+ - $
+ type: string
+ type: array
+ style: form
+ - description: Query parameter enum test (string)
+ explode: true
+ in: query
+ name: enum_query_string
+ required: false
+ schema:
+ default: -efg
+ enum:
+ - _abc
+ - -efg
+ - (xyz)
+ type: string
+ style: form
+ - description: Query parameter enum test (double)
+ explode: true
+ in: query
+ name: enum_query_integer
+ required: false
+ schema:
+ enum:
+ - 1
+ - -2
+ format: int32
+ type: integer
+ style: form
+ - description: Query parameter enum test (double)
+ explode: true
+ in: query
+ name: enum_query_double
+ required: false
+ schema:
+ enum:
+ - 1.1
+ - -1.2
+ format: double
+ type: number
+ style: form
+ requestBody:
+ $ref: '#/components/requestBodies/inline_object_2'
+ content:
+ application/x-www-form-urlencoded:
+ schema:
+ properties:
+ enum_form_string_array:
+ description: Form parameter enum test (string array)
+ items:
+ default: $
+ enum:
+ - '>'
+ - $
+ type: string
+ type: array
+ enum_form_string:
+ default: -efg
+ description: Form parameter enum test (string)
+ enum:
+ - _abc
+ - -efg
+ - (xyz)
+ type: string
+ type: object
+ responses:
+ "400":
+ description: Invalid request
+ "404":
+ description: Not found
+ summary: To test enum parameters
+ tags:
+ - fake
+ x-content-type: application/x-www-form-urlencoded
+ x-accepts: application/json
+ patch:
+ description: To test "client" model
+ operationId: testClientModel
+ requestBody:
+ $ref: '#/components/requestBodies/Client'
+ responses:
+ "200":
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Client'
+ description: successful operation
+ summary: To test "client" model
+ tags:
+ - fake
+ x-content-type: application/json
+ x-accepts: application/json
+ post:
+ description: |
+ Fake endpoint for testing various parameters
+ 假端點
+ 偽のエンドポイント
+ 가짜 엔드 포인트
+ operationId: testEndpointParameters
+ requestBody:
+ $ref: '#/components/requestBodies/inline_object_3'
+ content:
+ application/x-www-form-urlencoded:
+ schema:
+ properties:
+ integer:
+ description: None
+ maximum: 100
+ minimum: 10
+ type: integer
+ int32:
+ description: None
+ format: int32
+ maximum: 200
+ minimum: 20
+ type: integer
+ int64:
+ description: None
+ format: int64
+ type: integer
+ number:
+ description: None
+ maximum: 543.2
+ minimum: 32.1
+ type: number
+ float:
+ description: None
+ format: float
+ maximum: 987.6
+ type: number
+ double:
+ description: None
+ format: double
+ maximum: 123.4
+ minimum: 67.8
+ type: number
+ string:
+ description: None
+ pattern: "/[a-z]/i"
+ type: string
+ pattern_without_delimiter:
+ description: None
+ pattern: "^[A-Z].*"
+ type: string
+ byte:
+ description: None
+ format: byte
+ type: string
+ binary:
+ description: None
+ format: binary
+ type: string
+ date:
+ description: None
+ format: date
+ type: string
+ dateTime:
+ default: 2010-02-01T10:20:10.11111+01:00
+ description: None
+ example: 2020-02-02T20:20:20.22222Z
+ format: date-time
+ type: string
+ password:
+ description: None
+ format: password
+ maxLength: 64
+ minLength: 10
+ type: string
+ callback:
+ description: None
+ type: string
+ required:
+ - byte
+ - double
+ - number
+ - pattern_without_delimiter
+ type: object
+ responses:
+ "400":
+ description: Invalid username supplied
+ "404":
+ description: User not found
+ security:
+ - http_basic_test: []
+ summary: |
+ Fake endpoint for testing various parameters
+ 假端點
+ 偽のエンドポイント
+ 가짜 엔드 포인트
+ tags:
+ - fake
+ x-content-type: application/x-www-form-urlencoded
+ x-accepts: application/json
+ /fake/outer/number:
+ post:
+ description: Test serialization of outer number types
+ operationId: fakeOuterNumberSerialize
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OuterNumber'
+ description: Input number as post body
+ responses:
+ "200":
+ content:
+ '*/*':
+ schema:
+ $ref: '#/components/schemas/OuterNumber'
+ description: Output number
+ tags:
+ - fake
+ x-content-type: application/json
+ x-accepts: '*/*'
+ /fake/outer/string:
+ post:
+ description: Test serialization of outer string types
+ operationId: fakeOuterStringSerialize
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OuterString'
+ description: Input string as post body
+ responses:
+ "200":
+ content:
+ '*/*':
+ schema:
+ $ref: '#/components/schemas/OuterString'
+ description: Output string
+ tags:
+ - fake
+ x-content-type: application/json
+ x-accepts: '*/*'
+ /fake/outer/boolean:
+ post:
+ description: Test serialization of outer boolean types
+ operationId: fakeOuterBooleanSerialize
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OuterBoolean'
+ description: Input boolean as post body
+ responses:
+ "200":
+ content:
+ '*/*':
+ schema:
+ $ref: '#/components/schemas/OuterBoolean'
+ description: Output boolean
+ tags:
+ - fake
+ x-content-type: application/json
+ x-accepts: '*/*'
+ /fake/outer/composite:
+ post:
+ description: Test serialization of object with outer number type
+ operationId: fakeOuterCompositeSerialize
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/OuterComposite'
+ description: Input composite as post body
+ responses:
+ "200":
+ content:
+ '*/*':
+ schema:
+ $ref: '#/components/schemas/OuterComposite'
+ description: Output composite
+ tags:
+ - fake
+ x-content-type: application/json
+ x-accepts: '*/*'
+ /fake/jsonFormData:
+ get:
+ description: ""
+ operationId: testJsonFormData
+ requestBody:
+ $ref: '#/components/requestBodies/inline_object_4'
+ content:
+ application/x-www-form-urlencoded:
+ schema:
+ properties:
+ param:
+ description: field1
+ type: string
+ param2:
+ description: field2
+ type: string
+ required:
+ - param
+ - param2
+ type: object
+ responses:
+ "200":
+ description: successful operation
+ summary: test json serialization of form data
+ tags:
+ - fake
+ x-content-type: application/x-www-form-urlencoded
+ x-accepts: application/json
+ /fake/inline-additionalProperties:
+ post:
+ description: ""
+ operationId: testInlineAdditionalProperties
+ requestBody:
+ content:
+ application/json:
+ schema:
+ additionalProperties:
+ type: string
+ type: object
+ description: request body
+ required: true
+ responses:
+ "200":
+ description: successful operation
+ summary: test inline additionalProperties
+ tags:
+ - fake
+ x-content-type: application/json
+ x-accepts: application/json
+ /fake/body-with-query-params:
+ put:
+ operationId: testBodyWithQueryParams
+ parameters:
+ - explode: true
+ in: query
+ name: query
+ required: true
+ schema:
+ type: string
+ style: form
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/User'
+ required: true
+ responses:
+ "200":
+ description: Success
+ tags:
+ - fake
+ x-content-type: application/json
+ x-accepts: application/json
+ /another-fake/dummy:
+ patch:
+ description: To test special tags and operation ID starting with number
+ operationId: 123_test_@#$%_special_tags
+ requestBody:
+ $ref: '#/components/requestBodies/Client'
+ responses:
+ "200":
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Client'
+ description: successful operation
+ summary: To test special tags
+ tags:
+ - $another-fake?
+ x-content-type: application/json
+ x-accepts: application/json
+ /fake/body-with-file-schema:
+ put:
+ description: "For this test, the body for this request much reference a schema\
+ \ named `File`."
+ operationId: testBodyWithFileSchema
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/FileSchemaTestClass'
+ required: true
+ responses:
+ "200":
+ description: Success
+ tags:
+ - fake
+ x-content-type: application/json
+ x-accepts: application/json
+ /fake/test-query-parameters:
+ put:
+ description: To test the collection format in query parameters
+ operationId: testQueryParameterCollectionFormat
+ parameters:
+ - explode: true
+ in: query
+ name: pipe
+ required: true
+ schema:
+ items:
+ type: string
+ type: array
+ style: form
+ - explode: false
+ in: query
+ name: ioutil
+ required: true
+ schema:
+ items:
+ type: string
+ type: array
+ style: form
+ - explode: false
+ in: query
+ name: http
+ required: true
+ schema:
+ items:
+ type: string
+ type: array
+ style: spaceDelimited
+ - explode: false
+ in: query
+ name: url
+ required: true
+ schema:
+ items:
+ type: string
+ type: array
+ style: form
+ - explode: true
+ in: query
+ name: context
+ required: true
+ schema:
+ items:
+ type: string
+ type: array
+ style: form
+ responses:
+ "200":
+ description: Success
+ tags:
+ - fake
+ x-accepts: application/json
+ /fake/{petId}/uploadImageWithRequiredFile:
+ post:
+ description: ""
+ operationId: uploadFileWithRequiredFile
+ parameters:
+ - description: ID of pet to update
+ explode: false
+ in: path
+ name: petId
+ required: true
+ schema:
+ format: int64
+ type: integer
+ style: simple
+ requestBody:
+ $ref: '#/components/requestBodies/inline_object_5'
+ content:
+ multipart/form-data:
+ schema:
+ properties:
+ additionalMetadata:
+ description: Additional data to pass to server
+ type: string
+ requiredFile:
+ description: file to upload
+ format: binary
+ type: string
+ required:
+ - requiredFile
+ type: object
+ responses:
+ "200":
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiResponse'
+ description: successful operation
+ security:
+ - petstore_auth:
+ - write:pets
+ - read:pets
+ summary: uploads an image (required)
+ tags:
+ - pet
+ x-content-type: multipart/form-data
+ x-accepts: application/json
+ /fake/health:
+ get:
+ responses:
+ "200":
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/HealthCheckResult'
+ description: The instance started successfully
+ summary: Health check endpoint
+ tags:
+ - fake
+ x-accepts: application/json
+ /fake/array-of-enums:
+ get:
+ operationId: getArrayOfEnums
+ responses:
+ "200":
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ArrayOfEnums'
+ description: Got named array of enums
+ summary: Array of Enums
+ tags:
+ - fake
+ x-accepts: application/json
+components:
+ requestBodies:
+ UserArray:
+ content:
+ application/json:
+ examples:
+ simple-list:
+ description: Should not get into code examples
+ summary: Simple list example
+ value:
+ - username: foo
+ - username: bar
+ schema:
+ items:
+ $ref: '#/components/schemas/User'
+ type: array
+ description: List of user object
+ required: true
+ Client:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Client'
+ description: client model
+ required: true
+ Pet:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Pet'
+ application/xml:
+ schema:
+ $ref: '#/components/schemas/Pet'
+ description: Pet object that needs to be added to the store
+ required: true
+ inline_object:
+ content:
+ application/x-www-form-urlencoded:
+ schema:
+ $ref: '#/components/schemas/inline_object'
+ inline_object_1:
+ content:
+ multipart/form-data:
+ schema:
+ $ref: '#/components/schemas/inline_object_1'
+ inline_object_2:
+ content:
+ application/x-www-form-urlencoded:
+ schema:
+ $ref: '#/components/schemas/inline_object_2'
+ inline_object_3:
+ content:
+ application/x-www-form-urlencoded:
+ schema:
+ $ref: '#/components/schemas/inline_object_3'
+ inline_object_4:
+ content:
+ application/x-www-form-urlencoded:
+ schema:
+ $ref: '#/components/schemas/inline_object_4'
+ inline_object_5:
+ content:
+ multipart/form-data:
+ schema:
+ $ref: '#/components/schemas/inline_object_5'
+ schemas:
+ Foo:
+ example:
+ bar: bar
+ properties:
+ bar:
+ default: bar
+ type: string
+ type: object
+ Bar:
+ default: bar
+ type: string
+ Order:
+ example:
+ petId: 6
+ quantity: 1
+ id: 0
+ shipDate: 2020-02-02T20:20:20.000222Z
+ complete: false
+ status: placed
+ properties:
+ id:
+ format: int64
+ type: integer
+ petId:
+ format: int64
+ type: integer
+ quantity:
+ format: int32
+ type: integer
+ shipDate:
+ example: 2020-02-02T20:20:20.000222Z
+ format: date-time
+ type: string
+ status:
+ description: Order Status
+ enum:
+ - placed
+ - approved
+ - delivered
+ type: string
+ complete:
+ default: false
+ type: boolean
+ type: object
+ xml:
+ name: Order
+ Category:
+ example:
+ name: default-name
+ id: 6
+ properties:
+ id:
+ format: int64
+ type: integer
+ name:
+ default: default-name
+ type: string
+ required:
+ - name
+ type: object
+ xml:
+ name: Category
+ User:
+ example:
+ firstName: firstName
+ lastName: lastName
+ password: password
+ userStatus: 6
+ objectWithNoDeclaredPropsNullable: "{}"
+ phone: phone
+ objectWithNoDeclaredProps: "{}"
+ id: 0
+ anyTypePropNullable: ""
+ email: email
+ anyTypeProp: ""
+ username: username
+ properties:
+ id:
+ format: int64
+ type: integer
+ x-is-unique: true
+ username:
+ type: string
+ firstName:
+ type: string
+ lastName:
+ type: string
+ email:
+ type: string
+ password:
+ type: string
+ phone:
+ type: string
+ userStatus:
+ description: User Status
+ format: int32
+ type: integer
+ objectWithNoDeclaredProps:
+ description: test code generation for objects Value must be a map of strings
+ to values. It cannot be the 'null' value.
+ type: object
+ objectWithNoDeclaredPropsNullable:
+ description: test code generation for nullable objects. Value must be a
+ map of strings to values or the 'null' value.
+ nullable: true
+ type: object
+ anyTypeProp:
+ description: "test code generation for any type Here the 'type' attribute\
+ \ is not specified, which means the value can be anything, including the\
+ \ null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389"
+ anyTypePropNullable:
+ description: "test code generation for any type Here the 'type' attribute\
+ \ is not specified, which means the value can be anything, including the\
+ \ null value, string, number, boolean, array or object. The 'nullable'\
+ \ attribute does not change the allowed values."
+ nullable: true
+ type: object
+ xml:
+ name: User
+ Tag:
+ example:
+ name: name
+ id: 1
+ properties:
+ id:
+ format: int64
+ type: integer
+ name:
+ type: string
+ type: object
+ xml:
+ name: Tag
+ Pet:
+ example:
+ photoUrls:
+ - photoUrls
+ - photoUrls
+ name: doggie
+ id: 0
+ category:
+ name: default-name
+ id: 6
+ tags:
+ - name: name
+ id: 1
+ - name: name
+ id: 1
+ status: available
+ properties:
+ id:
+ format: int64
+ type: integer
+ x-is-unique: true
+ category:
+ $ref: '#/components/schemas/Category'
+ name:
+ example: doggie
+ type: string
+ photoUrls:
+ items:
+ type: string
+ type: array
+ xml:
+ name: photoUrl
+ wrapped: true
+ tags:
+ items:
+ $ref: '#/components/schemas/Tag'
+ type: array
+ xml:
+ name: tag
+ wrapped: true
+ status:
+ description: pet status in the store
+ enum:
+ - available
+ - pending
+ - sold
+ type: string
+ required:
+ - name
+ - photoUrls
+ type: object
+ xml:
+ name: Pet
+ ApiResponse:
+ example:
+ code: 0
+ type: type
+ message: message
+ properties:
+ code:
+ format: int32
+ type: integer
+ type:
+ type: string
+ message:
+ type: string
+ type: object
+ Return:
+ description: Model for testing reserved words
+ properties:
+ return:
+ format: int32
+ type: integer
+ xml:
+ name: Return
+ Name:
+ description: Model for testing model name same as property name
+ properties:
+ name:
+ format: int32
+ type: integer
+ snake_case:
+ format: int32
+ readOnly: true
+ type: integer
+ property:
+ type: string
+ "123Number":
+ readOnly: true
+ type: integer
+ required:
+ - name
+ xml:
+ name: Name
+ "200_response":
+ description: Model for testing model name starting with number
+ properties:
+ name:
+ format: int32
+ type: integer
+ class:
+ type: string
+ xml:
+ name: Name
+ ClassModel:
+ description: Model for testing model with "_class" property
+ properties:
+ _class:
+ type: string
+ Dog:
+ allOf:
+ - $ref: '#/components/schemas/Animal'
+ - $ref: '#/components/schemas/Dog_allOf'
+ Cat:
+ allOf:
+ - $ref: '#/components/schemas/Animal'
+ - $ref: '#/components/schemas/Address'
+ - $ref: '#/components/schemas/Cat_allOf'
+ Address:
+ additionalProperties:
+ type: integer
+ type: object
+ Animal:
+ discriminator:
+ propertyName: className
+ properties:
+ className:
+ type: string
+ color:
+ default: red
+ type: string
+ required:
+ - className
+ type: object
+ AnimalFarm:
+ items:
+ $ref: '#/components/schemas/Animal'
+ type: array
+ format_test:
+ properties:
+ integer:
+ maximum: 100
+ minimum: 10
+ multipleOf: 2
+ type: integer
+ int32:
+ format: int32
+ maximum: 200
+ minimum: 20
+ type: integer
+ int64:
+ format: int64
+ type: integer
+ number:
+ maximum: 543.2
+ minimum: 32.1
+ multipleOf: 32.5
+ type: number
+ float:
+ format: float
+ maximum: 987.6
+ minimum: 54.3
+ type: number
+ double:
+ format: double
+ maximum: 123.4
+ minimum: 67.8
+ type: number
+ decimal:
+ format: number
+ type: string
+ string:
+ pattern: "/[a-z]/i"
+ type: string
+ byte:
+ format: byte
+ type: string
+ binary:
+ format: binary
+ type: string
+ date:
+ example: 2020-02-02
+ format: date
+ type: string
+ dateTime:
+ example: 2007-12-03T10:15:30+01:00
+ format: date-time
+ type: string
+ uuid:
+ example: 72f98069-206d-4f12-9f12-3d1e525a8e84
+ format: uuid
+ type: string
+ password:
+ format: password
+ maxLength: 64
+ minLength: 10
+ type: string
+ pattern_with_digits:
+ description: A string that is a 10 digit number. Can have leading zeros.
+ pattern: "^\\d{10}$"
+ type: string
+ pattern_with_digits_and_delimiter:
+ description: A string starting with 'image_' (case insensitive) and one
+ to three digits following i.e. Image_01.
+ pattern: "/^image_\\d{1,3}$/i"
+ type: string
+ required:
+ - byte
+ - date
+ - number
+ - password
+ type: object
+ EnumClass:
+ default: -efg
+ enum:
+ - _abc
+ - -efg
+ - (xyz)
+ type: string
+ Enum_Test:
+ properties:
+ enum_string:
+ enum:
+ - UPPER
+ - lower
+ - ""
+ type: string
+ enum_string_required:
+ enum:
+ - UPPER
+ - lower
+ - ""
+ type: string
+ enum_integer:
+ enum:
+ - 1
+ - -1
+ format: int32
+ type: integer
+ enum_integer_only:
+ enum:
+ - 2
+ - -2
+ type: integer
+ enum_number:
+ enum:
+ - 1.1
+ - -1.2
+ format: double
+ type: number
+ outerEnum:
+ $ref: '#/components/schemas/OuterEnum'
+ outerEnumInteger:
+ $ref: '#/components/schemas/OuterEnumInteger'
+ outerEnumDefaultValue:
+ $ref: '#/components/schemas/OuterEnumDefaultValue'
+ outerEnumIntegerDefaultValue:
+ $ref: '#/components/schemas/OuterEnumIntegerDefaultValue'
+ required:
+ - enum_string_required
+ type: object
+ AdditionalPropertiesClass:
+ properties:
+ map_property:
+ additionalProperties:
+ type: string
+ type: object
+ map_of_map_property:
+ additionalProperties:
+ additionalProperties:
+ type: string
+ type: object
+ type: object
+ anytype_1: {}
+ map_with_undeclared_properties_anytype_1:
+ type: object
+ map_with_undeclared_properties_anytype_2:
+ properties: {}
+ type: object
+ map_with_undeclared_properties_anytype_3:
+ additionalProperties: true
+ type: object
+ empty_map:
+ additionalProperties: false
+ description: "an object with no declared properties and no undeclared properties,\
+ \ hence it's an empty map."
+ type: object
+ map_with_undeclared_properties_string:
+ additionalProperties:
+ type: string
+ type: object
+ type: object
+ MixedPropertiesAndAdditionalPropertiesClass:
+ properties:
+ uuid:
+ format: uuid
+ type: string
+ dateTime:
+ format: date-time
+ type: string
+ map:
+ additionalProperties:
+ $ref: '#/components/schemas/Animal'
+ type: object
+ type: object
+ List:
+ properties:
+ "123-list":
+ type: string
+ type: object
+ Client:
+ example:
+ client: client
+ properties:
+ client:
+ type: string
+ type: object
+ ReadOnlyFirst:
+ properties:
+ bar:
+ readOnly: true
+ type: string
+ baz:
+ type: string
+ type: object
+ hasOnlyReadOnly:
+ properties:
+ bar:
+ readOnly: true
+ type: string
+ foo:
+ readOnly: true
+ type: string
+ type: object
+ Capitalization:
+ properties:
+ smallCamel:
+ type: string
+ CapitalCamel:
+ type: string
+ small_Snake:
+ type: string
+ Capital_Snake:
+ type: string
+ SCA_ETH_Flow_Points:
+ type: string
+ ATT_NAME:
+ description: |
+ Name of the pet
+ type: string
+ type: object
+ MapTest:
+ properties:
+ map_map_of_string:
+ additionalProperties:
+ additionalProperties:
+ type: string
+ type: object
+ type: object
+ map_of_enum_string:
+ additionalProperties:
+ enum:
+ - UPPER
+ - lower
+ type: string
+ type: object
+ direct_map:
+ additionalProperties:
+ type: boolean
+ type: object
+ indirect_map:
+ additionalProperties:
+ type: boolean
+ type: object
+ type: object
+ ArrayTest:
+ properties:
+ array_of_string:
+ items:
+ type: string
+ type: array
+ array_array_of_integer:
+ items:
+ items:
+ format: int64
+ type: integer
+ type: array
+ type: array
+ array_array_of_model:
+ items:
+ items:
+ $ref: '#/components/schemas/ReadOnlyFirst'
+ type: array
+ type: array
+ type: object
+ NumberOnly:
+ properties:
+ JustNumber:
+ type: number
+ type: object
+ ArrayOfNumberOnly:
+ properties:
+ ArrayNumber:
+ items:
+ type: number
+ type: array
+ type: object
+ ArrayOfArrayOfNumberOnly:
+ properties:
+ ArrayArrayNumber:
+ items:
+ items:
+ type: number
+ type: array
+ type: array
+ type: object
+ EnumArrays:
+ properties:
+ just_symbol:
+ enum:
+ - '>='
+ - $
+ type: string
+ array_enum:
+ items:
+ enum:
+ - fish
+ - crab
+ type: string
+ type: array
+ type: object
+ OuterEnum:
+ enum:
+ - placed
+ - approved
+ - delivered
+ nullable: true
+ type: string
+ OuterEnumInteger:
+ enum:
+ - 0
+ - 1
+ - 2
+ type: integer
+ OuterEnumDefaultValue:
+ default: placed
+ enum:
+ - placed
+ - approved
+ - delivered
+ type: string
+ OuterEnumIntegerDefaultValue:
+ default: 0
+ enum:
+ - 0
+ - 1
+ - 2
+ type: integer
+ OuterComposite:
+ example:
+ my_string: my_string
+ my_number: 0.8008281904610115
+ my_boolean: true
+ properties:
+ my_number:
+ type: number
+ my_string:
+ type: string
+ my_boolean:
+ type: boolean
+ x-codegen-body-parameter-name: boolean_post_body
+ type: object
+ OuterNumber:
+ type: number
+ OuterString:
+ type: string
+ OuterBoolean:
+ type: boolean
+ x-codegen-body-parameter-name: boolean_post_body
+ StringBooleanMap:
+ additionalProperties:
+ type: boolean
+ type: object
+ FileSchemaTestClass:
+ example:
+ file:
+ sourceURI: sourceURI
+ files:
+ - sourceURI: sourceURI
+ - sourceURI: sourceURI
+ properties:
+ file:
+ $ref: '#/components/schemas/File'
+ files:
+ items:
+ $ref: '#/components/schemas/File'
+ type: array
+ type: object
+ File:
+ description: Must be named `File` for test.
+ example:
+ sourceURI: sourceURI
+ properties:
+ sourceURI:
+ description: Test capitalization
+ type: string
+ type: object
+ _special_model.name_:
+ properties:
+ $special[property.name]:
+ format: int64
+ type: integer
+ _special_model.name_:
+ type: string
+ xml:
+ name: "$special[model.name]"
+ HealthCheckResult:
+ description: Just a string to inform instance is up and running. Make it nullable
+ in hope to get it as pointer in generated model.
+ example:
+ NullableMessage: NullableMessage
+ properties:
+ NullableMessage:
+ nullable: true
+ type: string
+ type: object
+ NullableClass:
+ additionalProperties:
+ nullable: true
+ type: object
+ properties:
+ integer_prop:
+ nullable: true
+ type: integer
+ number_prop:
+ nullable: true
+ type: number
+ boolean_prop:
+ nullable: true
+ type: boolean
+ string_prop:
+ nullable: true
+ type: string
+ date_prop:
+ format: date
+ nullable: true
+ type: string
+ datetime_prop:
+ format: date-time
+ nullable: true
+ type: string
+ array_nullable_prop:
+ items:
+ type: object
+ nullable: true
+ type: array
+ array_and_items_nullable_prop:
+ items:
+ nullable: true
+ type: object
+ nullable: true
+ type: array
+ array_items_nullable:
+ items:
+ nullable: true
+ type: object
+ type: array
+ object_nullable_prop:
+ additionalProperties:
+ type: object
+ nullable: true
+ type: object
+ object_and_items_nullable_prop:
+ additionalProperties:
+ nullable: true
+ type: object
+ nullable: true
+ type: object
+ object_items_nullable:
+ additionalProperties:
+ nullable: true
+ type: object
+ type: object
+ type: object
+ fruit:
+ additionalProperties: false
+ oneOf:
+ - $ref: '#/components/schemas/apple'
+ - $ref: '#/components/schemas/banana'
+ properties:
+ color:
+ type: string
+ apple:
+ nullable: true
+ properties:
+ cultivar:
+ pattern: "^[a-zA-Z\\s]*$"
+ type: string
+ origin:
+ pattern: "/^[A-Z\\s]*$/i"
+ type: string
+ type: object
+ banana:
+ properties:
+ lengthCm:
+ type: number
+ type: object
+ mammal:
+ discriminator:
+ propertyName: className
+ oneOf:
+ - $ref: '#/components/schemas/whale'
+ - $ref: '#/components/schemas/zebra'
+ - $ref: '#/components/schemas/Pig'
+ whale:
+ properties:
+ hasBaleen:
+ type: boolean
+ hasTeeth:
+ type: boolean
+ className:
+ type: string
+ required:
+ - className
+ type: object
+ zebra:
+ additionalProperties: true
+ properties:
+ type:
+ enum:
+ - plains
+ - mountain
+ - grevys
+ type: string
+ className:
+ type: string
+ required:
+ - className
+ type: object
+ Pig:
+ discriminator:
+ propertyName: className
+ oneOf:
+ - $ref: '#/components/schemas/BasquePig'
+ - $ref: '#/components/schemas/DanishPig'
+ BasquePig:
+ properties:
+ className:
+ type: string
+ required:
+ - className
+ type: object
+ DanishPig:
+ properties:
+ className:
+ type: string
+ required:
+ - className
+ type: object
+ gmFruit:
+ additionalProperties: false
+ anyOf:
+ - $ref: '#/components/schemas/apple'
+ - $ref: '#/components/schemas/banana'
+ properties:
+ color:
+ type: string
+ fruitReq:
+ additionalProperties: false
+ oneOf:
+ - type: "null"
+ - $ref: '#/components/schemas/appleReq'
+ - $ref: '#/components/schemas/bananaReq'
+ appleReq:
+ additionalProperties: false
+ properties:
+ cultivar:
+ type: string
+ mealy:
+ type: boolean
+ required:
+ - cultivar
+ type: object
+ bananaReq:
+ additionalProperties: false
+ properties:
+ lengthCm:
+ type: number
+ sweet:
+ type: boolean
+ required:
+ - lengthCm
+ type: object
+ Drawing:
+ additionalProperties:
+ $ref: '#/components/schemas/fruit'
+ properties:
+ mainShape:
+ $ref: '#/components/schemas/Shape'
+ shapeOrNull:
+ $ref: '#/components/schemas/ShapeOrNull'
+ nullableShape:
+ $ref: '#/components/schemas/NullableShape'
+ shapes:
+ items:
+ $ref: '#/components/schemas/Shape'
+ type: array
+ type: object
+ Shape:
+ discriminator:
+ propertyName: shapeType
+ oneOf:
+ - $ref: '#/components/schemas/Triangle'
+ - $ref: '#/components/schemas/Quadrilateral'
+ ShapeOrNull:
+ description: The value may be a shape or the 'null' value. This is introduced
+ in OAS schema >= 3.1.
+ discriminator:
+ propertyName: shapeType
+ oneOf:
+ - type: "null"
+ - $ref: '#/components/schemas/Triangle'
+ - $ref: '#/components/schemas/Quadrilateral'
+ NullableShape:
+ description: The value may be a shape or the 'null' value. The 'nullable' attribute
+ was introduced in OAS schema >= 3.0 and has been deprecated in OAS schema
+ >= 3.1.
+ discriminator:
+ propertyName: shapeType
+ nullable: true
+ oneOf:
+ - $ref: '#/components/schemas/Triangle'
+ - $ref: '#/components/schemas/Quadrilateral'
+ ShapeInterface:
+ properties:
+ shapeType:
+ type: string
+ required:
+ - shapeType
+ TriangleInterface:
+ properties:
+ triangleType:
+ type: string
+ required:
+ - triangleType
+ Triangle:
+ discriminator:
+ propertyName: triangleType
+ oneOf:
+ - $ref: '#/components/schemas/EquilateralTriangle'
+ - $ref: '#/components/schemas/IsoscelesTriangle'
+ - $ref: '#/components/schemas/ScaleneTriangle'
+ EquilateralTriangle:
+ allOf:
+ - $ref: '#/components/schemas/ShapeInterface'
+ - $ref: '#/components/schemas/TriangleInterface'
+ IsoscelesTriangle:
+ additionalProperties: false
+ allOf:
+ - $ref: '#/components/schemas/ShapeInterface'
+ - $ref: '#/components/schemas/TriangleInterface'
+ ScaleneTriangle:
+ allOf:
+ - $ref: '#/components/schemas/ShapeInterface'
+ - $ref: '#/components/schemas/TriangleInterface'
+ QuadrilateralInterface:
+ properties:
+ quadrilateralType:
+ type: string
+ required:
+ - quadrilateralType
+ Quadrilateral:
+ discriminator:
+ propertyName: quadrilateralType
+ oneOf:
+ - $ref: '#/components/schemas/SimpleQuadrilateral'
+ - $ref: '#/components/schemas/ComplexQuadrilateral'
+ SimpleQuadrilateral:
+ allOf:
+ - $ref: '#/components/schemas/ShapeInterface'
+ - $ref: '#/components/schemas/QuadrilateralInterface'
+ ComplexQuadrilateral:
+ allOf:
+ - $ref: '#/components/schemas/ShapeInterface'
+ - $ref: '#/components/schemas/QuadrilateralInterface'
+ GrandparentAnimal:
+ discriminator:
+ propertyName: pet_type
+ properties:
+ pet_type:
+ type: string
+ required:
+ - pet_type
+ type: object
+ ParentPet:
+ allOf:
+ - $ref: '#/components/schemas/GrandparentAnimal'
+ type: object
+ ChildCat:
+ allOf:
+ - $ref: '#/components/schemas/ParentPet'
+ - $ref: '#/components/schemas/ChildCat_allOf'
+ ArrayOfEnums:
+ items:
+ $ref: '#/components/schemas/OuterEnum'
+ type: array
+ DateTimeTest:
+ default: 2010-01-01T10:10:10.000111+01:00
+ example: 2010-01-01T10:10:10.000111+01:00
+ format: date-time
+ type: string
+ DeprecatedObject:
+ deprecated: true
+ properties:
+ name:
+ type: string
+ type: object
+ ObjectWithDeprecatedFields:
+ properties:
+ uuid:
+ type: string
+ id:
+ deprecated: true
+ type: number
+ deprecatedRef:
+ $ref: '#/components/schemas/DeprecatedObject'
+ bars:
+ deprecated: true
+ items:
+ $ref: '#/components/schemas/Bar'
+ type: array
+ type: object
+ inline_response_default:
+ example:
+ string:
+ bar: bar
+ properties:
+ string:
+ $ref: '#/components/schemas/Foo'
+ type: object
+ inline_object:
+ properties:
+ name:
+ description: Updated name of the pet
+ type: string
+ status:
+ description: Updated status of the pet
+ type: string
+ type: object
+ inline_object_1:
+ properties:
+ additionalMetadata:
+ description: Additional data to pass to server
+ type: string
+ file:
+ description: file to upload
+ format: binary
+ type: string
+ type: object
+ inline_object_2:
+ properties:
+ enum_form_string_array:
+ description: Form parameter enum test (string array)
+ items:
+ default: $
+ enum:
+ - '>'
+ - $
+ type: string
+ type: array
+ enum_form_string:
+ default: -efg
+ description: Form parameter enum test (string)
+ enum:
+ - _abc
+ - -efg
+ - (xyz)
+ type: string
+ type: object
+ inline_object_3:
+ properties:
+ integer:
+ description: None
+ maximum: 100
+ minimum: 10
+ type: integer
+ int32:
+ description: None
+ format: int32
+ maximum: 200
+ minimum: 20
+ type: integer
+ int64:
+ description: None
+ format: int64
+ type: integer
+ number:
+ description: None
+ maximum: 543.2
+ minimum: 32.1
+ type: number
+ float:
+ description: None
+ format: float
+ maximum: 987.6
+ type: number
+ double:
+ description: None
+ format: double
+ maximum: 123.4
+ minimum: 67.8
+ type: number
+ string:
+ description: None
+ pattern: "/[a-z]/i"
+ type: string
+ pattern_without_delimiter:
+ description: None
+ pattern: "^[A-Z].*"
+ type: string
+ byte:
+ description: None
+ format: byte
+ type: string
+ binary:
+ description: None
+ format: binary
+ type: string
+ date:
+ description: None
+ format: date
+ type: string
+ dateTime:
+ default: 2010-02-01T10:20:10.11111+01:00
+ description: None
+ example: 2020-02-02T20:20:20.22222Z
+ format: date-time
+ type: string
+ password:
+ description: None
+ format: password
+ maxLength: 64
+ minLength: 10
+ type: string
+ callback:
+ description: None
+ type: string
+ required:
+ - byte
+ - double
+ - number
+ - pattern_without_delimiter
+ type: object
+ inline_object_4:
+ properties:
+ param:
+ description: field1
+ type: string
+ param2:
+ description: field2
+ type: string
+ required:
+ - param
+ - param2
+ type: object
+ inline_object_5:
+ properties:
+ additionalMetadata:
+ description: Additional data to pass to server
+ type: string
+ requiredFile:
+ description: file to upload
+ format: binary
+ type: string
+ required:
+ - requiredFile
+ type: object
+ Dog_allOf:
+ properties:
+ breed:
+ type: string
+ type: object
+ Cat_allOf:
+ properties:
+ declawed:
+ type: boolean
+ type: object
+ ChildCat_allOf:
+ properties:
+ name:
+ type: string
+ pet_type:
+ default: ChildCat
+ enum:
+ - ChildCat
+ type: string
+ x-enum-as-string: true
+ type: object
+ securitySchemes:
+ petstore_auth:
+ flows:
+ implicit:
+ authorizationUrl: http://petstore.swagger.io/api/oauth/dialog
+ scopes:
+ write:pets: modify pets in your account
+ read:pets: read your pets
+ type: oauth2
+ api_key:
+ in: header
+ name: api_key
+ type: apiKey
+ api_key_query:
+ in: query
+ name: api_key_query
+ type: apiKey
+ http_basic_test:
+ scheme: basic
+ type: http
+ bearer_test:
+ bearerFormat: JWT
+ scheme: bearer
+ type: http
+ http_signature_test:
+ scheme: signature
+ type: http
+
diff --git a/samples/client/petstore/java/jersey3/build.gradle b/samples/client/petstore/java/jersey3/build.gradle
new file mode 100644
index 000000000000..d0be177a0eb5
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/build.gradle
@@ -0,0 +1,162 @@
+apply plugin: 'idea'
+apply plugin: 'eclipse'
+apply plugin: 'com.diffplug.spotless'
+
+group = 'org.openapitools'
+version = '1.0.0'
+
+buildscript {
+ repositories {
+ mavenCentral()
+ }
+ dependencies {
+ classpath 'com.android.tools.build:gradle:2.3.+'
+ classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
+ classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.3.0'
+ }
+}
+
+repositories {
+ mavenCentral()
+}
+
+if(hasProperty('target') && target == 'android') {
+
+ apply plugin: 'com.android.library'
+ apply plugin: 'com.github.dcendents.android-maven'
+
+ android {
+ compileSdkVersion 25
+ buildToolsVersion '25.0.2'
+ defaultConfig {
+ minSdkVersion 14
+ targetSdkVersion 25
+ }
+ compileOptions {
+ sourceCompatibility JavaVersion.VERSION_1_8
+ targetCompatibility JavaVersion.VERSION_1_8
+ }
+
+ // Rename the aar correctly
+ libraryVariants.all { variant ->
+ variant.outputs.each { output ->
+ def outputFile = output.outputFile
+ if (outputFile != null && outputFile.name.endsWith('.aar')) {
+ def fileName = "${project.name}-${variant.baseName}-${version}.aar"
+ output.outputFile = new File(outputFile.parent, fileName)
+ }
+ }
+ }
+
+ dependencies {
+ provided "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version"
+ }
+ }
+
+ afterEvaluate {
+ android.libraryVariants.all { variant ->
+ def task = project.tasks.create "jar${variant.name.capitalize()}", Jar
+ task.description = "Create jar artifact for ${variant.name}"
+ task.dependsOn variant.javaCompile
+ task.from variant.javaCompile.destinationDir
+ task.destinationDir = project.file("${project.buildDir}/outputs/jar")
+ task.archiveName = "${project.name}-${variant.baseName}-${version}.jar"
+ artifacts.add('archives', task);
+ }
+ }
+
+ task sourcesJar(type: Jar) {
+ from android.sourceSets.main.java.srcDirs
+ classifier = 'sources'
+ }
+
+ artifacts {
+ archives sourcesJar
+ }
+
+} else {
+
+ apply plugin: 'java'
+ apply plugin: 'maven-publish'
+ sourceCompatibility = JavaVersion.VERSION_1_8
+ targetCompatibility = JavaVersion.VERSION_1_8
+
+ publishing {
+ publications {
+ maven(MavenPublication) {
+ artifactId = 'petstore-jersey3'
+
+ from components.java
+ }
+ }
+ }
+
+ task execute(type:JavaExec) {
+ main = System.getProperty('mainClass')
+ classpath = sourceSets.main.runtimeClasspath
+ }
+}
+
+ext {
+ swagger_annotations_version = "1.6.5"
+ jackson_version = "2.13.2"
+ jackson_databind_version = "2.13.2"
+ jackson_databind_nullable_version = "0.2.2"
+ jakarta_annotation_version = "2.1.0"
+ jersey_version = "3.0.4"
+ junit_version = "5.8.2"
+ scribejava_apis_version = "8.3.1"
+ tomitribe_http_signatures_version = "1.7"
+}
+
+dependencies {
+ implementation "io.swagger:swagger-annotations:$swagger_annotations_version"
+ implementation "com.google.code.findbugs:jsr305:3.0.2"
+ implementation "org.glassfish.jersey.core:jersey-client:$jersey_version"
+ implementation "org.glassfish.jersey.inject:jersey-hk2:$jersey_version"
+ implementation "org.glassfish.jersey.media:jersey-media-multipart:$jersey_version"
+ implementation "org.glassfish.jersey.media:jersey-media-json-jackson:$jersey_version"
+ implementation "org.glassfish.jersey.connectors:jersey-apache-connector:$jersey_version"
+ implementation "com.fasterxml.jackson.core:jackson-core:$jackson_version"
+ implementation "com.fasterxml.jackson.core:jackson-annotations:$jackson_version"
+ implementation "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version"
+ implementation "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version"
+ implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version"
+ implementation "com.github.scribejava:scribejava-apis:$scribejava_apis_version"
+ implementation "org.tomitribe:tomitribe-http-signatures:$tomitribe_http_signatures_version"
+ implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version"
+ testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version"
+ testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit_version"
+}
+
+test {
+ useJUnitPlatform()
+}
+
+javadoc {
+ options.tags = [ "http.response.details:a:Http Response Details" ]
+}
+
+// Use spotless plugin to automatically format code, remove unused import, etc
+// To apply changes directly to the file, run `gradlew spotlessApply`
+// Ref: https://github.com/diffplug/spotless/tree/main/plugin-gradle
+spotless {
+ // comment out below to run spotless as part of the `check` task
+ enforceCheck false
+
+ format 'misc', {
+ // define the files (e.g. '*.gradle', '*.md') to apply `misc` to
+ target '.gitignore'
+ // define the steps to apply to those files
+ trimTrailingWhitespace()
+ indentWithSpaces() // Takes an integer argument if you don't like 4
+ endWithNewline()
+ }
+ java {
+ // don't need to set target, it is inferred from java
+ // apply a specific flavor of google-java-format
+ googleJavaFormat('1.8').aosp().reflowLongStrings()
+ removeUnusedImports()
+ importOrder()
+ }
+}
diff --git a/samples/client/petstore/java/jersey3/build.sbt b/samples/client/petstore/java/jersey3/build.sbt
new file mode 100644
index 000000000000..02d8f9eb294b
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/build.sbt
@@ -0,0 +1,29 @@
+lazy val root = (project in file(".")).
+ settings(
+ organization := "org.openapitools",
+ name := "petstore-jersey3",
+ version := "1.0.0",
+ scalaVersion := "2.11.4",
+ scalacOptions ++= Seq("-feature"),
+ Compile / javacOptions ++= Seq("-Xlint:deprecation"),
+ Compile / packageDoc / publishArtifact := false,
+ resolvers += Resolver.mavenLocal,
+ libraryDependencies ++= Seq(
+ "com.google.code.findbugs" % "jsr305" % "3.0.0",
+ "io.swagger" % "swagger-annotations" % "1.6.5",
+ "org.glassfish.jersey.core" % "jersey-client" % "3.0.4",
+ "org.glassfish.jersey.inject" % "jersey-hk2" % "3.0.4",
+ "org.glassfish.jersey.media" % "jersey-media-multipart" % "3.0.4",
+ "org.glassfish.jersey.media" % "jersey-media-json-jackson" % "3.0.4",
+ "org.glassfish.jersey.connectors" % "jersey-apache-connector" % "3.0.4",
+ "com.fasterxml.jackson.core" % "jackson-core" % "2.13.2" % "compile",
+ "com.fasterxml.jackson.core" % "jackson-annotations" % "2.13.2" % "compile",
+ "com.fasterxml.jackson.core" % "jackson-databind" % "2.13.2" % "compile",
+ "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.13.0" % "compile",
+ "org.openapitools" % "jackson-databind-nullable" % "0.2.2" % "compile",
+ "com.github.scribejava" % "scribejava-apis" % "8.3.1" % "compile",
+ "org.tomitribe" % "tomitribe-http-signatures" % "1.7" % "compile",
+ "jakarta.annotation" % "jakarta.annotation-api" % "2.1.0" % "compile",
+ "org.junit.jupiter" % "junit-jupiter-api" % "5.8.2" % "test"
+ )
+ )
diff --git a/samples/client/petstore/java/jersey3/docs/AdditionalPropertiesClass.md b/samples/client/petstore/java/jersey3/docs/AdditionalPropertiesClass.md
new file mode 100644
index 000000000000..83051d9be44b
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/docs/AdditionalPropertiesClass.md
@@ -0,0 +1,20 @@
+
+
+# AdditionalPropertiesClass
+
+
+## Properties
+
+| Name | Type | Description | Notes |
+|------------ | ------------- | ------------- | -------------|
+|**mapProperty** | **Map<String, String>** | | [optional] |
+|**mapOfMapProperty** | **Map<String, Map<String, String>>** | | [optional] |
+|**anytype1** | **Object** | | [optional] |
+|**mapWithUndeclaredPropertiesAnytype1** | **Object** | | [optional] |
+|**mapWithUndeclaredPropertiesAnytype2** | **Object** | | [optional] |
+|**mapWithUndeclaredPropertiesAnytype3** | **Map<String, Object>** | | [optional] |
+|**emptyMap** | **Object** | an object with no declared properties and no undeclared properties, hence it's an empty map. | [optional] |
+|**mapWithUndeclaredPropertiesString** | **Map<String, String>** | | [optional] |
+
+
+
diff --git a/samples/client/petstore/java/jersey3/docs/Animal.md b/samples/client/petstore/java/jersey3/docs/Animal.md
new file mode 100644
index 000000000000..d9b32f14c88a
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/docs/Animal.md
@@ -0,0 +1,14 @@
+
+
+# Animal
+
+
+## Properties
+
+| Name | Type | Description | Notes |
+|------------ | ------------- | ------------- | -------------|
+|**className** | **String** | | |
+|**color** | **String** | | [optional] |
+
+
+
diff --git a/samples/client/petstore/java/jersey3/docs/AnotherFakeApi.md b/samples/client/petstore/java/jersey3/docs/AnotherFakeApi.md
new file mode 100644
index 000000000000..3cd7cd99f71f
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/docs/AnotherFakeApi.md
@@ -0,0 +1,74 @@
+# AnotherFakeApi
+
+All URIs are relative to *http://petstore.swagger.io:80/v2*
+
+| Method | HTTP request | Description |
+|------------- | ------------- | -------------|
+| [**call123testSpecialTags**](AnotherFakeApi.md#call123testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags |
+
+
+
+## call123testSpecialTags
+
+> Client call123testSpecialTags(client)
+
+To test special tags
+
+To test special tags and operation ID starting with number
+
+### Example
+
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.model.*;
+import org.openapitools.client.api.AnotherFakeApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ AnotherFakeApi apiInstance = new AnotherFakeApi(defaultClient);
+ Client client = new Client(); // Client | client model
+ try {
+ Client result = apiInstance.call123testSpecialTags(client);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling AnotherFakeApi#call123testSpecialTags");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+| Name | Type | Description | Notes |
+|------------- | ------------- | ------------- | -------------|
+| **client** | [**Client**](Client.md)| client model | |
+
+### Return type
+
+[**Client**](Client.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: application/json
+- **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **200** | successful operation | - |
+
diff --git a/samples/client/petstore/java/jersey3/docs/Apple.md b/samples/client/petstore/java/jersey3/docs/Apple.md
new file mode 100644
index 000000000000..0ef7a92c74d6
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/docs/Apple.md
@@ -0,0 +1,14 @@
+
+
+# Apple
+
+
+## Properties
+
+| Name | Type | Description | Notes |
+|------------ | ------------- | ------------- | -------------|
+|**cultivar** | **String** | | [optional] |
+|**origin** | **String** | | [optional] |
+
+
+
diff --git a/samples/client/petstore/java/jersey3/docs/AppleReq.md b/samples/client/petstore/java/jersey3/docs/AppleReq.md
new file mode 100644
index 000000000000..989e1cfedd1e
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/docs/AppleReq.md
@@ -0,0 +1,14 @@
+
+
+# AppleReq
+
+
+## Properties
+
+| Name | Type | Description | Notes |
+|------------ | ------------- | ------------- | -------------|
+|**cultivar** | **String** | | |
+|**mealy** | **Boolean** | | [optional] |
+
+
+
diff --git a/samples/client/petstore/java/jersey3/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/java/jersey3/docs/ArrayOfArrayOfNumberOnly.md
new file mode 100644
index 000000000000..0188db3eb131
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/docs/ArrayOfArrayOfNumberOnly.md
@@ -0,0 +1,13 @@
+
+
+# ArrayOfArrayOfNumberOnly
+
+
+## Properties
+
+| Name | Type | Description | Notes |
+|------------ | ------------- | ------------- | -------------|
+|**arrayArrayNumber** | **List<List<BigDecimal>>** | | [optional] |
+
+
+
diff --git a/samples/client/petstore/java/jersey3/docs/ArrayOfNumberOnly.md b/samples/client/petstore/java/jersey3/docs/ArrayOfNumberOnly.md
new file mode 100644
index 000000000000..a5753530aada
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/docs/ArrayOfNumberOnly.md
@@ -0,0 +1,13 @@
+
+
+# ArrayOfNumberOnly
+
+
+## Properties
+
+| Name | Type | Description | Notes |
+|------------ | ------------- | ------------- | -------------|
+|**arrayNumber** | **List<BigDecimal>** | | [optional] |
+
+
+
diff --git a/samples/client/petstore/java/jersey3/docs/ArrayTest.md b/samples/client/petstore/java/jersey3/docs/ArrayTest.md
new file mode 100644
index 000000000000..36077c9df300
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/docs/ArrayTest.md
@@ -0,0 +1,15 @@
+
+
+# ArrayTest
+
+
+## Properties
+
+| Name | Type | Description | Notes |
+|------------ | ------------- | ------------- | -------------|
+|**arrayOfString** | **List<String>** | | [optional] |
+|**arrayArrayOfInteger** | **List<List<Long>>** | | [optional] |
+|**arrayArrayOfModel** | **List<List<ReadOnlyFirst>>** | | [optional] |
+
+
+
diff --git a/samples/client/petstore/java/jersey3/docs/Banana.md b/samples/client/petstore/java/jersey3/docs/Banana.md
new file mode 100644
index 000000000000..5356d17ee700
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/docs/Banana.md
@@ -0,0 +1,13 @@
+
+
+# Banana
+
+
+## Properties
+
+| Name | Type | Description | Notes |
+|------------ | ------------- | ------------- | -------------|
+|**lengthCm** | **BigDecimal** | | [optional] |
+
+
+
diff --git a/samples/client/petstore/java/jersey3/docs/BananaReq.md b/samples/client/petstore/java/jersey3/docs/BananaReq.md
new file mode 100644
index 000000000000..22ebe1a7105f
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/docs/BananaReq.md
@@ -0,0 +1,14 @@
+
+
+# BananaReq
+
+
+## Properties
+
+| Name | Type | Description | Notes |
+|------------ | ------------- | ------------- | -------------|
+|**lengthCm** | **BigDecimal** | | |
+|**sweet** | **Boolean** | | [optional] |
+
+
+
diff --git a/samples/client/petstore/java/jersey3/docs/BasquePig.md b/samples/client/petstore/java/jersey3/docs/BasquePig.md
new file mode 100644
index 000000000000..160cb71c321f
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/docs/BasquePig.md
@@ -0,0 +1,13 @@
+
+
+# BasquePig
+
+
+## Properties
+
+| Name | Type | Description | Notes |
+|------------ | ------------- | ------------- | -------------|
+|**className** | **String** | | |
+
+
+
diff --git a/samples/client/petstore/java/jersey3/docs/Capitalization.md b/samples/client/petstore/java/jersey3/docs/Capitalization.md
new file mode 100644
index 000000000000..82a812711de2
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/docs/Capitalization.md
@@ -0,0 +1,18 @@
+
+
+# Capitalization
+
+
+## Properties
+
+| Name | Type | Description | Notes |
+|------------ | ------------- | ------------- | -------------|
+|**smallCamel** | **String** | | [optional] |
+|**capitalCamel** | **String** | | [optional] |
+|**smallSnake** | **String** | | [optional] |
+|**capitalSnake** | **String** | | [optional] |
+|**scAETHFlowPoints** | **String** | | [optional] |
+|**ATT_NAME** | **String** | Name of the pet | [optional] |
+
+
+
diff --git a/samples/client/petstore/java/jersey3/docs/Cat.md b/samples/client/petstore/java/jersey3/docs/Cat.md
new file mode 100644
index 000000000000..390dd519c8ce
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/docs/Cat.md
@@ -0,0 +1,13 @@
+
+
+# Cat
+
+
+## Properties
+
+| Name | Type | Description | Notes |
+|------------ | ------------- | ------------- | -------------|
+|**declawed** | **Boolean** | | [optional] |
+
+
+
diff --git a/samples/client/petstore/java/jersey3/docs/CatAllOf.md b/samples/client/petstore/java/jersey3/docs/CatAllOf.md
new file mode 100644
index 000000000000..926bc0abd78f
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/docs/CatAllOf.md
@@ -0,0 +1,13 @@
+
+
+# CatAllOf
+
+
+## Properties
+
+| Name | Type | Description | Notes |
+|------------ | ------------- | ------------- | -------------|
+|**declawed** | **Boolean** | | [optional] |
+
+
+
diff --git a/samples/client/petstore/java/jersey3/docs/Category.md b/samples/client/petstore/java/jersey3/docs/Category.md
new file mode 100644
index 000000000000..ab6d1ec334dc
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/docs/Category.md
@@ -0,0 +1,14 @@
+
+
+# Category
+
+
+## Properties
+
+| Name | Type | Description | Notes |
+|------------ | ------------- | ------------- | -------------|
+|**id** | **Long** | | [optional] |
+|**name** | **String** | | |
+
+
+
diff --git a/samples/client/petstore/java/jersey3/docs/ChildCat.md b/samples/client/petstore/java/jersey3/docs/ChildCat.md
new file mode 100644
index 000000000000..6a114cc4ffb3
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/docs/ChildCat.md
@@ -0,0 +1,22 @@
+
+
+# ChildCat
+
+
+## Properties
+
+| Name | Type | Description | Notes |
+|------------ | ------------- | ------------- | -------------|
+|**name** | **String** | | [optional] |
+|**petType** | [**String**](#String) | | |
+
+
+
+## Enum: String
+
+| Name | Value |
+|---- | -----|
+| CHILDCAT | "ChildCat" |
+
+
+
diff --git a/samples/client/petstore/java/jersey3/docs/ChildCatAllOf.md b/samples/client/petstore/java/jersey3/docs/ChildCatAllOf.md
new file mode 100644
index 000000000000..35fac5c5f09f
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/docs/ChildCatAllOf.md
@@ -0,0 +1,22 @@
+
+
+# ChildCatAllOf
+
+
+## Properties
+
+| Name | Type | Description | Notes |
+|------------ | ------------- | ------------- | -------------|
+|**name** | **String** | | [optional] |
+|**petType** | [**String**](#String) | | [optional] |
+
+
+
+## Enum: String
+
+| Name | Value |
+|---- | -----|
+| CHILDCAT | "ChildCat" |
+
+
+
diff --git a/samples/client/petstore/java/jersey3/docs/ClassModel.md b/samples/client/petstore/java/jersey3/docs/ClassModel.md
new file mode 100644
index 000000000000..af46dea1f6c8
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/docs/ClassModel.md
@@ -0,0 +1,14 @@
+
+
+# ClassModel
+
+Model for testing model with \"_class\" property
+
+## Properties
+
+| Name | Type | Description | Notes |
+|------------ | ------------- | ------------- | -------------|
+|**propertyClass** | **String** | | [optional] |
+
+
+
diff --git a/samples/client/petstore/java/jersey3/docs/Client.md b/samples/client/petstore/java/jersey3/docs/Client.md
new file mode 100644
index 000000000000..ef07b4ab8b9d
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/docs/Client.md
@@ -0,0 +1,13 @@
+
+
+# Client
+
+
+## Properties
+
+| Name | Type | Description | Notes |
+|------------ | ------------- | ------------- | -------------|
+|**client** | **String** | | [optional] |
+
+
+
diff --git a/samples/client/petstore/java/jersey3/docs/ComplexQuadrilateral.md b/samples/client/petstore/java/jersey3/docs/ComplexQuadrilateral.md
new file mode 100644
index 000000000000..d0a4b1a0a758
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/docs/ComplexQuadrilateral.md
@@ -0,0 +1,14 @@
+
+
+# ComplexQuadrilateral
+
+
+## Properties
+
+| Name | Type | Description | Notes |
+|------------ | ------------- | ------------- | -------------|
+|**shapeType** | **String** | | |
+|**quadrilateralType** | **String** | | |
+
+
+
diff --git a/samples/client/petstore/java/jersey3/docs/DanishPig.md b/samples/client/petstore/java/jersey3/docs/DanishPig.md
new file mode 100644
index 000000000000..0b366d3cf2ff
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/docs/DanishPig.md
@@ -0,0 +1,13 @@
+
+
+# DanishPig
+
+
+## Properties
+
+| Name | Type | Description | Notes |
+|------------ | ------------- | ------------- | -------------|
+|**className** | **String** | | |
+
+
+
diff --git a/samples/client/petstore/java/jersey3/docs/DefaultApi.md b/samples/client/petstore/java/jersey3/docs/DefaultApi.md
new file mode 100644
index 000000000000..00a8ac2ac24d
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/docs/DefaultApi.md
@@ -0,0 +1,68 @@
+# DefaultApi
+
+All URIs are relative to *http://petstore.swagger.io:80/v2*
+
+| Method | HTTP request | Description |
+|------------- | ------------- | -------------|
+| [**fooGet**](DefaultApi.md#fooGet) | **GET** /foo | |
+
+
+
+## fooGet
+
+> InlineResponseDefault fooGet()
+
+
+
+### Example
+
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.model.*;
+import org.openapitools.client.api.DefaultApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ DefaultApi apiInstance = new DefaultApi(defaultClient);
+ try {
+ InlineResponseDefault result = apiInstance.fooGet();
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling DefaultApi#fooGet");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+This endpoint does not need any parameter.
+
+### Return type
+
+[**InlineResponseDefault**](InlineResponseDefault.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **0** | response | - |
+
diff --git a/samples/client/petstore/java/jersey3/docs/DeprecatedObject.md b/samples/client/petstore/java/jersey3/docs/DeprecatedObject.md
new file mode 100644
index 000000000000..48de1d624425
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/docs/DeprecatedObject.md
@@ -0,0 +1,13 @@
+
+
+# DeprecatedObject
+
+
+## Properties
+
+| Name | Type | Description | Notes |
+|------------ | ------------- | ------------- | -------------|
+|**name** | **String** | | [optional] |
+
+
+
diff --git a/samples/client/petstore/java/jersey3/docs/Dog.md b/samples/client/petstore/java/jersey3/docs/Dog.md
new file mode 100644
index 000000000000..972c981c0d05
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/docs/Dog.md
@@ -0,0 +1,13 @@
+
+
+# Dog
+
+
+## Properties
+
+| Name | Type | Description | Notes |
+|------------ | ------------- | ------------- | -------------|
+|**breed** | **String** | | [optional] |
+
+
+
diff --git a/samples/client/petstore/java/jersey3/docs/DogAllOf.md b/samples/client/petstore/java/jersey3/docs/DogAllOf.md
new file mode 100644
index 000000000000..d4e4ea0d548c
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/docs/DogAllOf.md
@@ -0,0 +1,13 @@
+
+
+# DogAllOf
+
+
+## Properties
+
+| Name | Type | Description | Notes |
+|------------ | ------------- | ------------- | -------------|
+|**breed** | **String** | | [optional] |
+
+
+
diff --git a/samples/client/petstore/java/jersey3/docs/Drawing.md b/samples/client/petstore/java/jersey3/docs/Drawing.md
new file mode 100644
index 000000000000..6b815fc4131b
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/docs/Drawing.md
@@ -0,0 +1,16 @@
+
+
+# Drawing
+
+
+## Properties
+
+| Name | Type | Description | Notes |
+|------------ | ------------- | ------------- | -------------|
+|**mainShape** | [**Shape**](Shape.md) | | [optional] |
+|**shapeOrNull** | [**ShapeOrNull**](ShapeOrNull.md) | | [optional] |
+|**nullableShape** | [**NullableShape**](NullableShape.md) | | [optional] |
+|**shapes** | [**List<Shape>**](Shape.md) | | [optional] |
+
+
+
diff --git a/samples/client/petstore/java/jersey3/docs/EnumArrays.md b/samples/client/petstore/java/jersey3/docs/EnumArrays.md
new file mode 100644
index 000000000000..b2222d5beb25
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/docs/EnumArrays.md
@@ -0,0 +1,32 @@
+
+
+# EnumArrays
+
+
+## Properties
+
+| Name | Type | Description | Notes |
+|------------ | ------------- | ------------- | -------------|
+|**justSymbol** | [**JustSymbolEnum**](#JustSymbolEnum) | | [optional] |
+|**arrayEnum** | [**List<ArrayEnumEnum>**](#List<ArrayEnumEnum>) | | [optional] |
+
+
+
+## Enum: JustSymbolEnum
+
+| Name | Value |
+|---- | -----|
+| GREATER_THAN_OR_EQUAL_TO | ">=" |
+| DOLLAR | "$" |
+
+
+
+## Enum: List<ArrayEnumEnum>
+
+| Name | Value |
+|---- | -----|
+| FISH | "fish" |
+| CRAB | "crab" |
+
+
+
diff --git a/samples/client/petstore/java/jersey3/docs/EnumClass.md b/samples/client/petstore/java/jersey3/docs/EnumClass.md
new file mode 100644
index 000000000000..b314590a7591
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/docs/EnumClass.md
@@ -0,0 +1,15 @@
+
+
+# EnumClass
+
+## Enum
+
+
+* `_ABC` (value: `"_abc"`)
+
+* `_EFG` (value: `"-efg"`)
+
+* `_XYZ_` (value: `"(xyz)"`)
+
+
+
diff --git a/samples/client/petstore/java/jersey3/docs/EnumTest.md b/samples/client/petstore/java/jersey3/docs/EnumTest.md
new file mode 100644
index 000000000000..3e226e18b50b
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/docs/EnumTest.md
@@ -0,0 +1,68 @@
+
+
+# EnumTest
+
+
+## Properties
+
+| Name | Type | Description | Notes |
+|------------ | ------------- | ------------- | -------------|
+|**enumString** | [**EnumStringEnum**](#EnumStringEnum) | | [optional] |
+|**enumStringRequired** | [**EnumStringRequiredEnum**](#EnumStringRequiredEnum) | | |
+|**enumInteger** | [**EnumIntegerEnum**](#EnumIntegerEnum) | | [optional] |
+|**enumIntegerOnly** | [**EnumIntegerOnlyEnum**](#EnumIntegerOnlyEnum) | | [optional] |
+|**enumNumber** | [**EnumNumberEnum**](#EnumNumberEnum) | | [optional] |
+|**outerEnum** | **OuterEnum** | | [optional] |
+|**outerEnumInteger** | **OuterEnumInteger** | | [optional] |
+|**outerEnumDefaultValue** | **OuterEnumDefaultValue** | | [optional] |
+|**outerEnumIntegerDefaultValue** | **OuterEnumIntegerDefaultValue** | | [optional] |
+
+
+
+## Enum: EnumStringEnum
+
+| Name | Value |
+|---- | -----|
+| UPPER | "UPPER" |
+| LOWER | "lower" |
+| EMPTY | "" |
+
+
+
+## Enum: EnumStringRequiredEnum
+
+| Name | Value |
+|---- | -----|
+| UPPER | "UPPER" |
+| LOWER | "lower" |
+| EMPTY | "" |
+
+
+
+## Enum: EnumIntegerEnum
+
+| Name | Value |
+|---- | -----|
+| NUMBER_1 | 1 |
+| NUMBER_MINUS_1 | -1 |
+
+
+
+## Enum: EnumIntegerOnlyEnum
+
+| Name | Value |
+|---- | -----|
+| NUMBER_2 | 2 |
+| NUMBER_MINUS_2 | -2 |
+
+
+
+## Enum: EnumNumberEnum
+
+| Name | Value |
+|---- | -----|
+| NUMBER_1_DOT_1 | 1.1 |
+| NUMBER_MINUS_1_DOT_2 | -1.2 |
+
+
+
diff --git a/samples/client/petstore/java/jersey3/docs/EquilateralTriangle.md b/samples/client/petstore/java/jersey3/docs/EquilateralTriangle.md
new file mode 100644
index 000000000000..eade817feb3e
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/docs/EquilateralTriangle.md
@@ -0,0 +1,14 @@
+
+
+# EquilateralTriangle
+
+
+## Properties
+
+| Name | Type | Description | Notes |
+|------------ | ------------- | ------------- | -------------|
+|**shapeType** | **String** | | |
+|**triangleType** | **String** | | |
+
+
+
diff --git a/samples/client/petstore/java/jersey3/docs/FakeApi.md b/samples/client/petstore/java/jersey3/docs/FakeApi.md
new file mode 100644
index 000000000000..00365edeae97
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/docs/FakeApi.md
@@ -0,0 +1,1067 @@
+# FakeApi
+
+All URIs are relative to *http://petstore.swagger.io:80/v2*
+
+| Method | HTTP request | Description |
+|------------- | ------------- | -------------|
+| [**fakeHealthGet**](FakeApi.md#fakeHealthGet) | **GET** /fake/health | Health check endpoint |
+| [**fakeOuterBooleanSerialize**](FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | |
+| [**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | |
+| [**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | |
+| [**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | |
+| [**getArrayOfEnums**](FakeApi.md#getArrayOfEnums) | **GET** /fake/array-of-enums | Array of Enums |
+| [**testBodyWithFileSchema**](FakeApi.md#testBodyWithFileSchema) | **PUT** /fake/body-with-file-schema | |
+| [**testBodyWithQueryParams**](FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params | |
+| [**testClientModel**](FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model |
+| [**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 |
+| [**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters |
+| [**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) |
+| [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties |
+| [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data |
+| [**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-parameters | |
+
+
+
+## fakeHealthGet
+
+> HealthCheckResult fakeHealthGet()
+
+Health check endpoint
+
+### Example
+
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.model.*;
+import org.openapitools.client.api.FakeApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ FakeApi apiInstance = new FakeApi(defaultClient);
+ try {
+ HealthCheckResult result = apiInstance.fakeHealthGet();
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling FakeApi#fakeHealthGet");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+This endpoint does not need any parameter.
+
+### Return type
+
+[**HealthCheckResult**](HealthCheckResult.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **200** | The instance started successfully | - |
+
+
+## fakeOuterBooleanSerialize
+
+> Boolean fakeOuterBooleanSerialize(body)
+
+
+
+Test serialization of outer boolean types
+
+### Example
+
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.model.*;
+import org.openapitools.client.api.FakeApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ FakeApi apiInstance = new FakeApi(defaultClient);
+ Boolean body = true; // Boolean | Input boolean as post body
+ try {
+ Boolean result = apiInstance.fakeOuterBooleanSerialize(body);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling FakeApi#fakeOuterBooleanSerialize");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+| Name | Type | Description | Notes |
+|------------- | ------------- | ------------- | -------------|
+| **body** | **Boolean**| Input boolean as post body | [optional] |
+
+### Return type
+
+**Boolean**
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: application/json
+- **Accept**: */*
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **200** | Output boolean | - |
+
+
+## fakeOuterCompositeSerialize
+
+> OuterComposite fakeOuterCompositeSerialize(outerComposite)
+
+
+
+Test serialization of object with outer number type
+
+### Example
+
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.model.*;
+import org.openapitools.client.api.FakeApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ FakeApi apiInstance = new FakeApi(defaultClient);
+ OuterComposite outerComposite = new OuterComposite(); // OuterComposite | Input composite as post body
+ try {
+ OuterComposite result = apiInstance.fakeOuterCompositeSerialize(outerComposite);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling FakeApi#fakeOuterCompositeSerialize");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+| Name | Type | Description | Notes |
+|------------- | ------------- | ------------- | -------------|
+| **outerComposite** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] |
+
+### Return type
+
+[**OuterComposite**](OuterComposite.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: application/json
+- **Accept**: */*
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **200** | Output composite | - |
+
+
+## fakeOuterNumberSerialize
+
+> BigDecimal fakeOuterNumberSerialize(body)
+
+
+
+Test serialization of outer number types
+
+### Example
+
+```java
+import java.math.BigDecimal;
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.model.*;
+import org.openapitools.client.api.FakeApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ FakeApi apiInstance = new FakeApi(defaultClient);
+ BigDecimal body = new BigDecimal(78); // BigDecimal | Input number as post body
+ try {
+ BigDecimal result = apiInstance.fakeOuterNumberSerialize(body);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling FakeApi#fakeOuterNumberSerialize");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+| Name | Type | Description | Notes |
+|------------- | ------------- | ------------- | -------------|
+| **body** | **BigDecimal**| Input number as post body | [optional] |
+
+### Return type
+
+[**BigDecimal**](BigDecimal.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: application/json
+- **Accept**: */*
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **200** | Output number | - |
+
+
+## fakeOuterStringSerialize
+
+> String fakeOuterStringSerialize(body)
+
+
+
+Test serialization of outer string types
+
+### Example
+
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.model.*;
+import org.openapitools.client.api.FakeApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ FakeApi apiInstance = new FakeApi(defaultClient);
+ String body = "body_example"; // String | Input string as post body
+ try {
+ String result = apiInstance.fakeOuterStringSerialize(body);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling FakeApi#fakeOuterStringSerialize");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+| Name | Type | Description | Notes |
+|------------- | ------------- | ------------- | -------------|
+| **body** | **String**| Input string as post body | [optional] |
+
+### Return type
+
+**String**
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: application/json
+- **Accept**: */*
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **200** | Output string | - |
+
+
+## getArrayOfEnums
+
+> List<OuterEnum> getArrayOfEnums()
+
+Array of Enums
+
+### Example
+
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.model.*;
+import org.openapitools.client.api.FakeApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ FakeApi apiInstance = new FakeApi(defaultClient);
+ try {
+ List result = apiInstance.getArrayOfEnums();
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling FakeApi#getArrayOfEnums");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+This endpoint does not need any parameter.
+
+### Return type
+
+[**List<OuterEnum>**](OuterEnum.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **200** | Got named array of enums | - |
+
+
+## testBodyWithFileSchema
+
+> testBodyWithFileSchema(fileSchemaTestClass)
+
+
+
+For this test, the body for this request much reference a schema named `File`.
+
+### Example
+
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.model.*;
+import org.openapitools.client.api.FakeApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ FakeApi apiInstance = new FakeApi(defaultClient);
+ FileSchemaTestClass fileSchemaTestClass = new FileSchemaTestClass(); // FileSchemaTestClass |
+ try {
+ apiInstance.testBodyWithFileSchema(fileSchemaTestClass);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling FakeApi#testBodyWithFileSchema");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+| Name | Type | Description | Notes |
+|------------- | ------------- | ------------- | -------------|
+| **fileSchemaTestClass** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| | |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: application/json
+- **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **200** | Success | - |
+
+
+## testBodyWithQueryParams
+
+> testBodyWithQueryParams(query, user)
+
+
+
+### Example
+
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.model.*;
+import org.openapitools.client.api.FakeApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ FakeApi apiInstance = new FakeApi(defaultClient);
+ String query = "query_example"; // String |
+ User user = new User(); // User |
+ try {
+ apiInstance.testBodyWithQueryParams(query, user);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling FakeApi#testBodyWithQueryParams");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+| Name | Type | Description | Notes |
+|------------- | ------------- | ------------- | -------------|
+| **query** | **String**| | |
+| **user** | [**User**](User.md)| | |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: application/json
+- **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **200** | Success | - |
+
+
+## testClientModel
+
+> Client testClientModel(client)
+
+To test \"client\" model
+
+To test "client" model
+
+### Example
+
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.model.*;
+import org.openapitools.client.api.FakeApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ FakeApi apiInstance = new FakeApi(defaultClient);
+ Client client = new Client(); // Client | client model
+ try {
+ Client result = apiInstance.testClientModel(client);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling FakeApi#testClientModel");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+| Name | Type | Description | Notes |
+|------------- | ------------- | ------------- | -------------|
+| **client** | [**Client**](Client.md)| client model | |
+
+### Return type
+
+[**Client**](Client.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: application/json
+- **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **200** | successful operation | - |
+
+
+## testEndpointParameters
+
+> testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback)
+
+Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
+
+Fake endpoint for testing various parameters
+假端點
+偽のエンドポイント
+가짜 엔드 포인트
+
+
+### Example
+
+```java
+import java.io.File;
+import java.math.BigDecimal;
+import java.time.LocalDate;
+import java.time.OffsetDateTime;
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.auth.*;
+import org.openapitools.client.model.*;
+import org.openapitools.client.api.FakeApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ // Configure HTTP basic authorization: http_basic_test
+ HttpBasicAuth http_basic_test = (HttpBasicAuth) defaultClient.getAuthentication("http_basic_test");
+ http_basic_test.setUsername("YOUR USERNAME");
+ http_basic_test.setPassword("YOUR PASSWORD");
+
+ FakeApi apiInstance = new FakeApi(defaultClient);
+ BigDecimal number = new BigDecimal(78); // BigDecimal | None
+ Double _double = 3.4D; // Double | None
+ String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None
+ byte[] _byte = null; // byte[] | None
+ Integer integer = 56; // Integer | None
+ Integer int32 = 56; // Integer | None
+ Long int64 = 56L; // Long | None
+ Float _float = 3.4F; // Float | None
+ String string = "string_example"; // String | None
+ File binary = new File("/path/to/file"); // File | None
+ LocalDate date = LocalDate.now(); // LocalDate | None
+ OffsetDateTime dateTime = OffsetDateTime.parse("2010-02-01T10:20:10.111110+01:00"); // OffsetDateTime | None
+ String password = "password_example"; // String | None
+ String paramCallback = "paramCallback_example"; // String | None
+ try {
+ apiInstance.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling FakeApi#testEndpointParameters");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+| Name | Type | Description | Notes |
+|------------- | ------------- | ------------- | -------------|
+| **number** | **BigDecimal**| None | |
+| **_double** | **Double**| None | |
+| **patternWithoutDelimiter** | **String**| None | |
+| **_byte** | **byte[]**| None | |
+| **integer** | **Integer**| None | [optional] |
+| **int32** | **Integer**| None | [optional] |
+| **int64** | **Long**| None | [optional] |
+| **_float** | **Float**| None | [optional] |
+| **string** | **String**| None | [optional] |
+| **binary** | **File**| None | [optional] |
+| **date** | **LocalDate**| None | [optional] |
+| **dateTime** | **OffsetDateTime**| None | [optional] [default to 2010-02-01T10:20:10.111110+01:00] |
+| **password** | **String**| None | [optional] |
+| **paramCallback** | **String**| None | [optional] |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+[http_basic_test](../README.md#http_basic_test)
+
+### HTTP request headers
+
+- **Content-Type**: application/x-www-form-urlencoded
+- **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **400** | Invalid username supplied | - |
+| **404** | User not found | - |
+
+
+## testEnumParameters
+
+> testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString)
+
+To test enum parameters
+
+To test enum parameters
+
+### Example
+
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.model.*;
+import org.openapitools.client.api.FakeApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ FakeApi apiInstance = new FakeApi(defaultClient);
+ List enumHeaderStringArray = Arrays.asList("$"); // List | Header parameter enum test (string array)
+ String enumHeaderString = "_abc"; // String | Header parameter enum test (string)
+ List enumQueryStringArray = Arrays.asList("$"); // List | Query parameter enum test (string array)
+ String enumQueryString = "_abc"; // String | Query parameter enum test (string)
+ Integer enumQueryInteger = 1; // Integer | Query parameter enum test (double)
+ Double enumQueryDouble = 1.1D; // Double | Query parameter enum test (double)
+ List enumFormStringArray = Arrays.asList("$"); // List | Form parameter enum test (string array)
+ String enumFormString = "_abc"; // String | Form parameter enum test (string)
+ try {
+ apiInstance.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling FakeApi#testEnumParameters");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+| Name | Type | Description | Notes |
+|------------- | ------------- | ------------- | -------------|
+| **enumHeaderStringArray** | **List<String>**| Header parameter enum test (string array) | [optional] [enum: >, $] |
+| **enumHeaderString** | **String**| Header parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] |
+| **enumQueryStringArray** | **List<String>**| Query parameter enum test (string array) | [optional] [enum: >, $] |
+| **enumQueryString** | **String**| Query parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] |
+| **enumQueryInteger** | **Integer**| Query parameter enum test (double) | [optional] [enum: 1, -2] |
+| **enumQueryDouble** | **Double**| Query parameter enum test (double) | [optional] [enum: 1.1, -1.2] |
+| **enumFormStringArray** | **List<String>**| Form parameter enum test (string array) | [optional] [enum: >, $] |
+| **enumFormString** | **String**| Form parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: application/x-www-form-urlencoded
+- **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **400** | Invalid request | - |
+| **404** | Not found | - |
+
+
+## testGroupParameters
+
+> testGroupParameters().requiredStringGroup(requiredStringGroup).requiredBooleanGroup(requiredBooleanGroup).requiredInt64Group(requiredInt64Group).stringGroup(stringGroup).booleanGroup(booleanGroup).int64Group(int64Group).execute();
+
+Fake endpoint to test group parameters (optional)
+
+Fake endpoint to test group parameters (optional)
+
+### Example
+
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.auth.*;
+import org.openapitools.client.model.*;
+import org.openapitools.client.api.FakeApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ // Configure HTTP bearer authorization: bearer_test
+ HttpBearerAuth bearer_test = (HttpBearerAuth) defaultClient.getAuthentication("bearer_test");
+ bearer_test.setBearerToken("BEARER TOKEN");
+
+ FakeApi apiInstance = new FakeApi(defaultClient);
+ Integer requiredStringGroup = 56; // Integer | Required String in group parameters
+ Boolean requiredBooleanGroup = true; // Boolean | Required Boolean in group parameters
+ Long requiredInt64Group = 56L; // Long | Required Integer in group parameters
+ Integer stringGroup = 56; // Integer | String in group parameters
+ Boolean booleanGroup = true; // Boolean | Boolean in group parameters
+ Long int64Group = 56L; // Long | Integer in group parameters
+ try {
+ api.testGroupParameters()
+ .requiredStringGroup(requiredStringGroup)
+ .requiredBooleanGroup(requiredBooleanGroup)
+ .requiredInt64Group(requiredInt64Group)
+ .stringGroup(stringGroup)
+ .booleanGroup(booleanGroup)
+ .int64Group(int64Group)
+ .execute();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling FakeApi#testGroupParameters");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+| Name | Type | Description | Notes |
+|------------- | ------------- | ------------- | -------------|
+| **requiredStringGroup** | **Integer**| Required String in group parameters | |
+| **requiredBooleanGroup** | **Boolean**| Required Boolean in group parameters | |
+| **requiredInt64Group** | **Long**| Required Integer in group parameters | |
+| **stringGroup** | **Integer**| String in group parameters | [optional] |
+| **booleanGroup** | **Boolean**| Boolean in group parameters | [optional] |
+| **int64Group** | **Long**| Integer in group parameters | [optional] |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+[bearer_test](../README.md#bearer_test)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **400** | Someting wrong | - |
+
+
+## testInlineAdditionalProperties
+
+> testInlineAdditionalProperties(requestBody)
+
+test inline additionalProperties
+
+
+
+### Example
+
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.model.*;
+import org.openapitools.client.api.FakeApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ FakeApi apiInstance = new FakeApi(defaultClient);
+ Map requestBody = new HashMap(); // Map | request body
+ try {
+ apiInstance.testInlineAdditionalProperties(requestBody);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling FakeApi#testInlineAdditionalProperties");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+| Name | Type | Description | Notes |
+|------------- | ------------- | ------------- | -------------|
+| **requestBody** | **Map<String,String>**| request body | |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: application/json
+- **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **200** | successful operation | - |
+
+
+## testJsonFormData
+
+> testJsonFormData(param, param2)
+
+test json serialization of form data
+
+
+
+### Example
+
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.model.*;
+import org.openapitools.client.api.FakeApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ FakeApi apiInstance = new FakeApi(defaultClient);
+ String param = "param_example"; // String | field1
+ String param2 = "param2_example"; // String | field2
+ try {
+ apiInstance.testJsonFormData(param, param2);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling FakeApi#testJsonFormData");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+| Name | Type | Description | Notes |
+|------------- | ------------- | ------------- | -------------|
+| **param** | **String**| field1 | |
+| **param2** | **String**| field2 | |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: application/x-www-form-urlencoded
+- **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **200** | successful operation | - |
+
+
+## testQueryParameterCollectionFormat
+
+> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context)
+
+
+
+To test the collection format in query parameters
+
+### Example
+
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.model.*;
+import org.openapitools.client.api.FakeApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ FakeApi apiInstance = new FakeApi(defaultClient);
+ List pipe = Arrays.asList(); // List |
+ List ioutil = Arrays.asList(); // List |
+ List http = Arrays.asList(); // List |
+ List url = Arrays.asList(); // List |
+ List context = Arrays.asList(); // List |
+ try {
+ apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling FakeApi#testQueryParameterCollectionFormat");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+| Name | Type | Description | Notes |
+|------------- | ------------- | ------------- | -------------|
+| **pipe** | **List<String>**| | |
+| **ioutil** | **List<String>**| | |
+| **http** | **List<String>**| | |
+| **url** | **List<String>**| | |
+| **context** | **List<String>**| | |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **200** | Success | - |
+
diff --git a/samples/client/petstore/java/jersey3/docs/FakeClassnameTags123Api.md b/samples/client/petstore/java/jersey3/docs/FakeClassnameTags123Api.md
new file mode 100644
index 000000000000..c0534bcf0439
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/docs/FakeClassnameTags123Api.md
@@ -0,0 +1,81 @@
+# FakeClassnameTags123Api
+
+All URIs are relative to *http://petstore.swagger.io:80/v2*
+
+| Method | HTTP request | Description |
+|------------- | ------------- | -------------|
+| [**testClassname**](FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case |
+
+
+
+## testClassname
+
+> Client testClassname(client)
+
+To test class name in snake case
+
+To test class name in snake case
+
+### Example
+
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.auth.*;
+import org.openapitools.client.model.*;
+import org.openapitools.client.api.FakeClassnameTags123Api;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ // Configure API key authorization: api_key_query
+ ApiKeyAuth api_key_query = (ApiKeyAuth) defaultClient.getAuthentication("api_key_query");
+ api_key_query.setApiKey("YOUR API KEY");
+ // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
+ //api_key_query.setApiKeyPrefix("Token");
+
+ FakeClassnameTags123Api apiInstance = new FakeClassnameTags123Api(defaultClient);
+ Client client = new Client(); // Client | client model
+ try {
+ Client result = apiInstance.testClassname(client);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling FakeClassnameTags123Api#testClassname");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+| Name | Type | Description | Notes |
+|------------- | ------------- | ------------- | -------------|
+| **client** | [**Client**](Client.md)| client model | |
+
+### Return type
+
+[**Client**](Client.md)
+
+### Authorization
+
+[api_key_query](../README.md#api_key_query)
+
+### HTTP request headers
+
+- **Content-Type**: application/json
+- **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **200** | successful operation | - |
+
diff --git a/samples/client/petstore/java/jersey3/docs/FileSchemaTestClass.md b/samples/client/petstore/java/jersey3/docs/FileSchemaTestClass.md
new file mode 100644
index 000000000000..85d1a0636694
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/docs/FileSchemaTestClass.md
@@ -0,0 +1,14 @@
+
+
+# FileSchemaTestClass
+
+
+## Properties
+
+| Name | Type | Description | Notes |
+|------------ | ------------- | ------------- | -------------|
+|**_file** | [**ModelFile**](ModelFile.md) | | [optional] |
+|**files** | [**List<ModelFile>**](ModelFile.md) | | [optional] |
+
+
+
diff --git a/samples/client/petstore/java/jersey3/docs/Foo.md b/samples/client/petstore/java/jersey3/docs/Foo.md
new file mode 100644
index 000000000000..6b3f0556528a
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/docs/Foo.md
@@ -0,0 +1,13 @@
+
+
+# Foo
+
+
+## Properties
+
+| Name | Type | Description | Notes |
+|------------ | ------------- | ------------- | -------------|
+|**bar** | **String** | | [optional] |
+
+
+
diff --git a/samples/client/petstore/java/jersey3/docs/FormatTest.md b/samples/client/petstore/java/jersey3/docs/FormatTest.md
new file mode 100644
index 000000000000..01b8c777ae06
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/docs/FormatTest.md
@@ -0,0 +1,28 @@
+
+
+# FormatTest
+
+
+## Properties
+
+| Name | Type | Description | Notes |
+|------------ | ------------- | ------------- | -------------|
+|**integer** | **Integer** | | [optional] |
+|**int32** | **Integer** | | [optional] |
+|**int64** | **Long** | | [optional] |
+|**number** | **BigDecimal** | | |
+|**_float** | **Float** | | [optional] |
+|**_double** | **Double** | | [optional] |
+|**decimal** | **BigDecimal** | | [optional] |
+|**string** | **String** | | [optional] |
+|**_byte** | **byte[]** | | |
+|**binary** | **File** | | [optional] |
+|**date** | **LocalDate** | | |
+|**dateTime** | **OffsetDateTime** | | [optional] |
+|**uuid** | **UUID** | | [optional] |
+|**password** | **String** | | |
+|**patternWithDigits** | **String** | A string that is a 10 digit number. Can have leading zeros. | [optional] |
+|**patternWithDigitsAndDelimiter** | **String** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] |
+
+
+
diff --git a/samples/client/petstore/java/jersey3/docs/Fruit.md b/samples/client/petstore/java/jersey3/docs/Fruit.md
new file mode 100644
index 000000000000..41b3152250e1
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/docs/Fruit.md
@@ -0,0 +1,37 @@
+
+
+# Fruit
+
+## oneOf schemas
+* [Apple](Apple.md)
+* [Banana](Banana.md)
+
+## Example
+```java
+// Import classes:
+import org.openapitools.client.model.Fruit;
+import org.openapitools.client.model.Apple;
+import org.openapitools.client.model.Banana;
+
+public class Example {
+ public static void main(String[] args) {
+ Fruit exampleFruit = new Fruit();
+
+ // create a new Apple
+ Apple exampleApple = new Apple();
+ // set Fruit to Apple
+ exampleFruit.setActualInstance(exampleApple);
+ // to get back the Apple set earlier
+ Apple testApple = (Apple) exampleFruit.getActualInstance();
+
+ // create a new Banana
+ Banana exampleBanana = new Banana();
+ // set Fruit to Banana
+ exampleFruit.setActualInstance(exampleBanana);
+ // to get back the Banana set earlier
+ Banana testBanana = (Banana) exampleFruit.getActualInstance();
+ }
+}
+```
+
+
diff --git a/samples/client/petstore/java/jersey3/docs/FruitReq.md b/samples/client/petstore/java/jersey3/docs/FruitReq.md
new file mode 100644
index 000000000000..9d9c875cd39a
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/docs/FruitReq.md
@@ -0,0 +1,39 @@
+
+
+# FruitReq
+
+## oneOf schemas
+* [AppleReq](AppleReq.md)
+* [BananaReq](BananaReq.md)
+
+NOTE: this class is nullable.
+
+## Example
+```java
+// Import classes:
+import org.openapitools.client.model.FruitReq;
+import org.openapitools.client.model.AppleReq;
+import org.openapitools.client.model.BananaReq;
+
+public class Example {
+ public static void main(String[] args) {
+ FruitReq exampleFruitReq = new FruitReq();
+
+ // create a new AppleReq
+ AppleReq exampleAppleReq = new AppleReq();
+ // set FruitReq to AppleReq
+ exampleFruitReq.setActualInstance(exampleAppleReq);
+ // to get back the AppleReq set earlier
+ AppleReq testAppleReq = (AppleReq) exampleFruitReq.getActualInstance();
+
+ // create a new BananaReq
+ BananaReq exampleBananaReq = new BananaReq();
+ // set FruitReq to BananaReq
+ exampleFruitReq.setActualInstance(exampleBananaReq);
+ // to get back the BananaReq set earlier
+ BananaReq testBananaReq = (BananaReq) exampleFruitReq.getActualInstance();
+ }
+}
+```
+
+
diff --git a/samples/client/petstore/java/jersey3/docs/GmFruit.md b/samples/client/petstore/java/jersey3/docs/GmFruit.md
new file mode 100644
index 000000000000..c9dc50b92cb7
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/docs/GmFruit.md
@@ -0,0 +1,37 @@
+
+
+# GmFruit
+
+## anyOf schemas
+* [Apple](Apple.md)
+* [Banana](Banana.md)
+
+## Example
+```java
+// Import classes:
+import org.openapitools.client.model.GmFruit;
+import org.openapitools.client.model.Apple;
+import org.openapitools.client.model.Banana;
+
+public class Example {
+ public static void main(String[] args) {
+ GmFruit exampleGmFruit = new GmFruit();
+
+ // create a new Apple
+ Apple exampleApple = new Apple();
+ // set GmFruit to Apple
+ exampleGmFruit.setActualInstance(exampleApple);
+ // to get back the Apple set earlier
+ Apple testApple = (Apple) exampleGmFruit.getActualInstance();
+
+ // create a new Banana
+ Banana exampleBanana = new Banana();
+ // set GmFruit to Banana
+ exampleGmFruit.setActualInstance(exampleBanana);
+ // to get back the Banana set earlier
+ Banana testBanana = (Banana) exampleGmFruit.getActualInstance();
+ }
+}
+```
+
+
diff --git a/samples/client/petstore/java/jersey3/docs/GrandparentAnimal.md b/samples/client/petstore/java/jersey3/docs/GrandparentAnimal.md
new file mode 100644
index 000000000000..9737408f2724
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/docs/GrandparentAnimal.md
@@ -0,0 +1,13 @@
+
+
+# GrandparentAnimal
+
+
+## Properties
+
+| Name | Type | Description | Notes |
+|------------ | ------------- | ------------- | -------------|
+|**petType** | **String** | | |
+
+
+
diff --git a/samples/client/petstore/java/jersey3/docs/HasOnlyReadOnly.md b/samples/client/petstore/java/jersey3/docs/HasOnlyReadOnly.md
new file mode 100644
index 000000000000..29da5205dbba
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/docs/HasOnlyReadOnly.md
@@ -0,0 +1,14 @@
+
+
+# HasOnlyReadOnly
+
+
+## Properties
+
+| Name | Type | Description | Notes |
+|------------ | ------------- | ------------- | -------------|
+|**bar** | **String** | | [optional] [readonly] |
+|**foo** | **String** | | [optional] [readonly] |
+
+
+
diff --git a/samples/client/petstore/java/jersey3/docs/HealthCheckResult.md b/samples/client/petstore/java/jersey3/docs/HealthCheckResult.md
new file mode 100644
index 000000000000..4885e6f1cada
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/docs/HealthCheckResult.md
@@ -0,0 +1,14 @@
+
+
+# HealthCheckResult
+
+Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model.
+
+## Properties
+
+| Name | Type | Description | Notes |
+|------------ | ------------- | ------------- | -------------|
+|**nullableMessage** | **String** | | [optional] |
+
+
+
diff --git a/samples/client/petstore/java/jersey3/docs/InlineObject.md b/samples/client/petstore/java/jersey3/docs/InlineObject.md
new file mode 100644
index 000000000000..999fe3ef00ad
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/docs/InlineObject.md
@@ -0,0 +1,13 @@
+
+
+# InlineObject
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **String** | Updated name of the pet | [optional]
+**status** | **String** | Updated status of the pet | [optional]
+
+
+
diff --git a/samples/client/petstore/java/jersey3/docs/InlineObject1.md b/samples/client/petstore/java/jersey3/docs/InlineObject1.md
new file mode 100644
index 000000000000..10cc19ce03ce
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/docs/InlineObject1.md
@@ -0,0 +1,13 @@
+
+
+# InlineObject1
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**additionalMetadata** | **String** | Additional data to pass to server | [optional]
+**file** | **File** | file to upload | [optional]
+
+
+
diff --git a/samples/client/petstore/java/jersey3/docs/InlineObject2.md b/samples/client/petstore/java/jersey3/docs/InlineObject2.md
new file mode 100644
index 000000000000..7e4ed7591c2a
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/docs/InlineObject2.md
@@ -0,0 +1,32 @@
+
+
+# InlineObject2
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**enumFormStringArray** | [**List<EnumFormStringArrayEnum>**](#List<EnumFormStringArrayEnum>) | Form parameter enum test (string array) | [optional]
+**enumFormString** | [**EnumFormStringEnum**](#EnumFormStringEnum) | Form parameter enum test (string) | [optional]
+
+
+
+## Enum: List<EnumFormStringArrayEnum>
+
+Name | Value
+---- | -----
+GREATER_THAN | ">"
+DOLLAR | "$"
+
+
+
+## Enum: EnumFormStringEnum
+
+Name | Value
+---- | -----
+_ABC | "_abc"
+_EFG | "-efg"
+_XYZ_ | "(xyz)"
+
+
+
diff --git a/samples/client/petstore/java/jersey3/docs/InlineObject3.md b/samples/client/petstore/java/jersey3/docs/InlineObject3.md
new file mode 100644
index 000000000000..fef7fdf80327
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/docs/InlineObject3.md
@@ -0,0 +1,25 @@
+
+
+# InlineObject3
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**integer** | **Integer** | None | [optional]
+**int32** | **Integer** | None | [optional]
+**int64** | **Long** | None | [optional]
+**number** | **BigDecimal** | None |
+**_float** | **Float** | None | [optional]
+**_double** | **Double** | None |
+**string** | **String** | None | [optional]
+**patternWithoutDelimiter** | **String** | None |
+**_byte** | **byte[]** | None |
+**binary** | **File** | None | [optional]
+**date** | **LocalDate** | None | [optional]
+**dateTime** | **OffsetDateTime** | None | [optional]
+**password** | **String** | None | [optional]
+**callback** | **String** | None | [optional]
+
+
+
diff --git a/samples/client/petstore/java/jersey3/docs/InlineObject4.md b/samples/client/petstore/java/jersey3/docs/InlineObject4.md
new file mode 100644
index 000000000000..5ebef872403a
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/docs/InlineObject4.md
@@ -0,0 +1,13 @@
+
+
+# InlineObject4
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**param** | **String** | field1 |
+**param2** | **String** | field2 |
+
+
+
diff --git a/samples/client/petstore/java/jersey3/docs/InlineObject5.md b/samples/client/petstore/java/jersey3/docs/InlineObject5.md
new file mode 100644
index 000000000000..ec5d4309f4d0
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/docs/InlineObject5.md
@@ -0,0 +1,13 @@
+
+
+# InlineObject5
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**additionalMetadata** | **String** | Additional data to pass to server | [optional]
+**requiredFile** | **File** | file to upload |
+
+
+
diff --git a/samples/client/petstore/java/jersey3/docs/InlineResponseDefault.md b/samples/client/petstore/java/jersey3/docs/InlineResponseDefault.md
new file mode 100644
index 000000000000..41cadb0373c2
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/docs/InlineResponseDefault.md
@@ -0,0 +1,13 @@
+
+
+# InlineResponseDefault
+
+
+## Properties
+
+| Name | Type | Description | Notes |
+|------------ | ------------- | ------------- | -------------|
+|**string** | [**Foo**](Foo.md) | | [optional] |
+
+
+
diff --git a/samples/client/petstore/java/jersey3/docs/IsoscelesTriangle.md b/samples/client/petstore/java/jersey3/docs/IsoscelesTriangle.md
new file mode 100644
index 000000000000..0bd5045bc68f
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/docs/IsoscelesTriangle.md
@@ -0,0 +1,14 @@
+
+
+# IsoscelesTriangle
+
+
+## Properties
+
+| Name | Type | Description | Notes |
+|------------ | ------------- | ------------- | -------------|
+|**shapeType** | **String** | | |
+|**triangleType** | **String** | | |
+
+
+
diff --git a/samples/client/petstore/java/jersey3/docs/Mammal.md b/samples/client/petstore/java/jersey3/docs/Mammal.md
new file mode 100644
index 000000000000..11bbff5e2ba9
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/docs/Mammal.md
@@ -0,0 +1,46 @@
+
+
+# Mammal
+
+## oneOf schemas
+* [Pig](Pig.md)
+* [Whale](Whale.md)
+* [Zebra](Zebra.md)
+
+## Example
+```java
+// Import classes:
+import org.openapitools.client.model.Mammal;
+import org.openapitools.client.model.Pig;
+import org.openapitools.client.model.Whale;
+import org.openapitools.client.model.Zebra;
+
+public class Example {
+ public static void main(String[] args) {
+ Mammal exampleMammal = new Mammal();
+
+ // create a new Pig
+ Pig examplePig = new Pig();
+ // set Mammal to Pig
+ exampleMammal.setActualInstance(examplePig);
+ // to get back the Pig set earlier
+ Pig testPig = (Pig) exampleMammal.getActualInstance();
+
+ // create a new Whale
+ Whale exampleWhale = new Whale();
+ // set Mammal to Whale
+ exampleMammal.setActualInstance(exampleWhale);
+ // to get back the Whale set earlier
+ Whale testWhale = (Whale) exampleMammal.getActualInstance();
+
+ // create a new Zebra
+ Zebra exampleZebra = new Zebra();
+ // set Mammal to Zebra
+ exampleMammal.setActualInstance(exampleZebra);
+ // to get back the Zebra set earlier
+ Zebra testZebra = (Zebra) exampleMammal.getActualInstance();
+ }
+}
+```
+
+
diff --git a/samples/client/petstore/java/jersey3/docs/MapTest.md b/samples/client/petstore/java/jersey3/docs/MapTest.md
new file mode 100644
index 000000000000..54380188e1d6
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/docs/MapTest.md
@@ -0,0 +1,25 @@
+
+
+# MapTest
+
+
+## Properties
+
+| Name | Type | Description | Notes |
+|------------ | ------------- | ------------- | -------------|
+|**mapMapOfString** | **Map<String, Map<String, String>>** | | [optional] |
+|**mapOfEnumString** | [**Map<String, InnerEnum>**](#Map<String, InnerEnum>) | | [optional] |
+|**directMap** | **Map<String, Boolean>** | | [optional] |
+|**indirectMap** | **Map<String, Boolean>** | | [optional] |
+
+
+
+## Enum: Map<String, InnerEnum>
+
+| Name | Value |
+|---- | -----|
+| UPPER | "UPPER" |
+| LOWER | "lower" |
+
+
+
diff --git a/samples/client/petstore/java/jersey3/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/java/jersey3/docs/MixedPropertiesAndAdditionalPropertiesClass.md
new file mode 100644
index 000000000000..a5ddf0faa6a9
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/docs/MixedPropertiesAndAdditionalPropertiesClass.md
@@ -0,0 +1,15 @@
+
+
+# MixedPropertiesAndAdditionalPropertiesClass
+
+
+## Properties
+
+| Name | Type | Description | Notes |
+|------------ | ------------- | ------------- | -------------|
+|**uuid** | **UUID** | | [optional] |
+|**dateTime** | **OffsetDateTime** | | [optional] |
+|**map** | [**Map<String, Animal>**](Animal.md) | | [optional] |
+
+
+
diff --git a/samples/client/petstore/java/jersey3/docs/Model200Response.md b/samples/client/petstore/java/jersey3/docs/Model200Response.md
new file mode 100644
index 000000000000..109411580c62
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/docs/Model200Response.md
@@ -0,0 +1,15 @@
+
+
+# Model200Response
+
+Model for testing model name starting with number
+
+## Properties
+
+| Name | Type | Description | Notes |
+|------------ | ------------- | ------------- | -------------|
+|**name** | **Integer** | | [optional] |
+|**propertyClass** | **String** | | [optional] |
+
+
+
diff --git a/samples/client/petstore/java/jersey3/docs/ModelApiResponse.md b/samples/client/petstore/java/jersey3/docs/ModelApiResponse.md
new file mode 100644
index 000000000000..e374c2dd2dec
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/docs/ModelApiResponse.md
@@ -0,0 +1,15 @@
+
+
+# ModelApiResponse
+
+
+## Properties
+
+| Name | Type | Description | Notes |
+|------------ | ------------- | ------------- | -------------|
+|**code** | **Integer** | | [optional] |
+|**type** | **String** | | [optional] |
+|**message** | **String** | | [optional] |
+
+
+
diff --git a/samples/client/petstore/java/jersey3/docs/ModelFile.md b/samples/client/petstore/java/jersey3/docs/ModelFile.md
new file mode 100644
index 000000000000..adcde984f527
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/docs/ModelFile.md
@@ -0,0 +1,14 @@
+
+
+# ModelFile
+
+Must be named `File` for test.
+
+## Properties
+
+| Name | Type | Description | Notes |
+|------------ | ------------- | ------------- | -------------|
+|**sourceURI** | **String** | Test capitalization | [optional] |
+
+
+
diff --git a/samples/client/petstore/java/jersey3/docs/ModelList.md b/samples/client/petstore/java/jersey3/docs/ModelList.md
new file mode 100644
index 000000000000..f93ab7dde8d4
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/docs/ModelList.md
@@ -0,0 +1,13 @@
+
+
+# ModelList
+
+
+## Properties
+
+| Name | Type | Description | Notes |
+|------------ | ------------- | ------------- | -------------|
+|**_123list** | **String** | | [optional] |
+
+
+
diff --git a/samples/client/petstore/java/jersey3/docs/ModelReturn.md b/samples/client/petstore/java/jersey3/docs/ModelReturn.md
new file mode 100644
index 000000000000..0bd356861eb7
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/docs/ModelReturn.md
@@ -0,0 +1,14 @@
+
+
+# ModelReturn
+
+Model for testing reserved words
+
+## Properties
+
+| Name | Type | Description | Notes |
+|------------ | ------------- | ------------- | -------------|
+|**_return** | **Integer** | | [optional] |
+
+
+
diff --git a/samples/client/petstore/java/jersey3/docs/Name.md b/samples/client/petstore/java/jersey3/docs/Name.md
new file mode 100644
index 000000000000..c901d9435309
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/docs/Name.md
@@ -0,0 +1,17 @@
+
+
+# Name
+
+Model for testing model name same as property name
+
+## Properties
+
+| Name | Type | Description | Notes |
+|------------ | ------------- | ------------- | -------------|
+|**name** | **Integer** | | |
+|**snakeCase** | **Integer** | | [optional] [readonly] |
+|**property** | **String** | | [optional] |
+|**_123number** | **Integer** | | [optional] [readonly] |
+
+
+
diff --git a/samples/client/petstore/java/jersey3/docs/NullableClass.md b/samples/client/petstore/java/jersey3/docs/NullableClass.md
new file mode 100644
index 000000000000..fa98c5c6d984
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/docs/NullableClass.md
@@ -0,0 +1,24 @@
+
+
+# NullableClass
+
+
+## Properties
+
+| Name | Type | Description | Notes |
+|------------ | ------------- | ------------- | -------------|
+|**integerProp** | **Integer** | | [optional] |
+|**numberProp** | **BigDecimal** | | [optional] |
+|**booleanProp** | **Boolean** | | [optional] |
+|**stringProp** | **String** | | [optional] |
+|**dateProp** | **LocalDate** | | [optional] |
+|**datetimeProp** | **OffsetDateTime** | | [optional] |
+|**arrayNullableProp** | **List<Object>** | | [optional] |
+|**arrayAndItemsNullableProp** | **List<Object>** | | [optional] |
+|**arrayItemsNullable** | **List<Object>** | | [optional] |
+|**objectNullableProp** | **Map<String, Object>** | | [optional] |
+|**objectAndItemsNullableProp** | **Map<String, Object>** | | [optional] |
+|**objectItemsNullable** | **Map<String, Object>** | | [optional] |
+
+
+
diff --git a/samples/client/petstore/java/jersey3/docs/NullableShape.md b/samples/client/petstore/java/jersey3/docs/NullableShape.md
new file mode 100644
index 000000000000..60c45b268406
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/docs/NullableShape.md
@@ -0,0 +1,41 @@
+
+
+# NullableShape
+
+The value may be a shape or the 'null' value. The 'nullable' attribute was introduced in OAS schema >= 3.0 and has been deprecated in OAS schema >= 3.1.
+
+## oneOf schemas
+* [Quadrilateral](Quadrilateral.md)
+* [Triangle](Triangle.md)
+
+NOTE: this class is nullable.
+
+## Example
+```java
+// Import classes:
+import org.openapitools.client.model.NullableShape;
+import org.openapitools.client.model.Quadrilateral;
+import org.openapitools.client.model.Triangle;
+
+public class Example {
+ public static void main(String[] args) {
+ NullableShape exampleNullableShape = new NullableShape();
+
+ // create a new Quadrilateral
+ Quadrilateral exampleQuadrilateral = new Quadrilateral();
+ // set NullableShape to Quadrilateral
+ exampleNullableShape.setActualInstance(exampleQuadrilateral);
+ // to get back the Quadrilateral set earlier
+ Quadrilateral testQuadrilateral = (Quadrilateral) exampleNullableShape.getActualInstance();
+
+ // create a new Triangle
+ Triangle exampleTriangle = new Triangle();
+ // set NullableShape to Triangle
+ exampleNullableShape.setActualInstance(exampleTriangle);
+ // to get back the Triangle set earlier
+ Triangle testTriangle = (Triangle) exampleNullableShape.getActualInstance();
+ }
+}
+```
+
+
diff --git a/samples/client/petstore/java/jersey3/docs/NumberOnly.md b/samples/client/petstore/java/jersey3/docs/NumberOnly.md
new file mode 100644
index 000000000000..b8ed1a4cfae1
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/docs/NumberOnly.md
@@ -0,0 +1,13 @@
+
+
+# NumberOnly
+
+
+## Properties
+
+| Name | Type | Description | Notes |
+|------------ | ------------- | ------------- | -------------|
+|**justNumber** | **BigDecimal** | | [optional] |
+
+
+
diff --git a/samples/client/petstore/java/jersey3/docs/ObjectWithDeprecatedFields.md b/samples/client/petstore/java/jersey3/docs/ObjectWithDeprecatedFields.md
new file mode 100644
index 000000000000..f1cf571f4c09
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/docs/ObjectWithDeprecatedFields.md
@@ -0,0 +1,16 @@
+
+
+# ObjectWithDeprecatedFields
+
+
+## Properties
+
+| Name | Type | Description | Notes |
+|------------ | ------------- | ------------- | -------------|
+|**uuid** | **String** | | [optional] |
+|**id** | **BigDecimal** | | [optional] |
+|**deprecatedRef** | [**DeprecatedObject**](DeprecatedObject.md) | | [optional] |
+|**bars** | **List<String>** | | [optional] |
+
+
+
diff --git a/samples/client/petstore/java/jersey3/docs/Order.md b/samples/client/petstore/java/jersey3/docs/Order.md
new file mode 100644
index 000000000000..27af32855c5c
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/docs/Order.md
@@ -0,0 +1,28 @@
+
+
+# Order
+
+
+## Properties
+
+| Name | Type | Description | Notes |
+|------------ | ------------- | ------------- | -------------|
+|**id** | **Long** | | [optional] |
+|**petId** | **Long** | | [optional] |
+|**quantity** | **Integer** | | [optional] |
+|**shipDate** | **OffsetDateTime** | | [optional] |
+|**status** | [**StatusEnum**](#StatusEnum) | Order Status | [optional] |
+|**complete** | **Boolean** | | [optional] |
+
+
+
+## Enum: StatusEnum
+
+| Name | Value |
+|---- | -----|
+| PLACED | "placed" |
+| APPROVED | "approved" |
+| DELIVERED | "delivered" |
+
+
+
diff --git a/samples/client/petstore/java/jersey3/docs/OuterComposite.md b/samples/client/petstore/java/jersey3/docs/OuterComposite.md
new file mode 100644
index 000000000000..98b56e0763ff
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/docs/OuterComposite.md
@@ -0,0 +1,15 @@
+
+
+# OuterComposite
+
+
+## Properties
+
+| Name | Type | Description | Notes |
+|------------ | ------------- | ------------- | -------------|
+|**myNumber** | **BigDecimal** | | [optional] |
+|**myString** | **String** | | [optional] |
+|**myBoolean** | **Boolean** | | [optional] |
+
+
+
diff --git a/samples/client/petstore/java/jersey3/docs/OuterEnum.md b/samples/client/petstore/java/jersey3/docs/OuterEnum.md
new file mode 100644
index 000000000000..1f9b723eb8e7
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/docs/OuterEnum.md
@@ -0,0 +1,15 @@
+
+
+# OuterEnum
+
+## Enum
+
+
+* `PLACED` (value: `"placed"`)
+
+* `APPROVED` (value: `"approved"`)
+
+* `DELIVERED` (value: `"delivered"`)
+
+
+
diff --git a/samples/client/petstore/java/jersey3/docs/OuterEnumDefaultValue.md b/samples/client/petstore/java/jersey3/docs/OuterEnumDefaultValue.md
new file mode 100644
index 000000000000..cbc7f4ba54d2
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/docs/OuterEnumDefaultValue.md
@@ -0,0 +1,15 @@
+
+
+# OuterEnumDefaultValue
+
+## Enum
+
+
+* `PLACED` (value: `"placed"`)
+
+* `APPROVED` (value: `"approved"`)
+
+* `DELIVERED` (value: `"delivered"`)
+
+
+
diff --git a/samples/client/petstore/java/jersey3/docs/OuterEnumInteger.md b/samples/client/petstore/java/jersey3/docs/OuterEnumInteger.md
new file mode 100644
index 000000000000..f71dea30ad00
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/docs/OuterEnumInteger.md
@@ -0,0 +1,15 @@
+
+
+# OuterEnumInteger
+
+## Enum
+
+
+* `NUMBER_0` (value: `0`)
+
+* `NUMBER_1` (value: `1`)
+
+* `NUMBER_2` (value: `2`)
+
+
+
diff --git a/samples/client/petstore/java/jersey3/docs/OuterEnumIntegerDefaultValue.md b/samples/client/petstore/java/jersey3/docs/OuterEnumIntegerDefaultValue.md
new file mode 100644
index 000000000000..99e6389f4278
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/docs/OuterEnumIntegerDefaultValue.md
@@ -0,0 +1,15 @@
+
+
+# OuterEnumIntegerDefaultValue
+
+## Enum
+
+
+* `NUMBER_0` (value: `0`)
+
+* `NUMBER_1` (value: `1`)
+
+* `NUMBER_2` (value: `2`)
+
+
+
diff --git a/samples/client/petstore/java/jersey3/docs/ParentPet.md b/samples/client/petstore/java/jersey3/docs/ParentPet.md
new file mode 100644
index 000000000000..4992b88a6710
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/docs/ParentPet.md
@@ -0,0 +1,12 @@
+
+
+# ParentPet
+
+
+## Properties
+
+| Name | Type | Description | Notes |
+|------------ | ------------- | ------------- | -------------|
+
+
+
diff --git a/samples/client/petstore/java/jersey3/docs/Pet.md b/samples/client/petstore/java/jersey3/docs/Pet.md
new file mode 100644
index 000000000000..08dfd8623602
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/docs/Pet.md
@@ -0,0 +1,28 @@
+
+
+# Pet
+
+
+## Properties
+
+| Name | Type | Description | Notes |
+|------------ | ------------- | ------------- | -------------|
+|**id** | **Long** | | [optional] |
+|**category** | [**Category**](Category.md) | | [optional] |
+|**name** | **String** | | |
+|**photoUrls** | **List<String>** | | |
+|**tags** | [**List<Tag>**](Tag.md) | | [optional] |
+|**status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional] |
+
+
+
+## Enum: StatusEnum
+
+| Name | Value |
+|---- | -----|
+| AVAILABLE | "available" |
+| PENDING | "pending" |
+| SOLD | "sold" |
+
+
+
diff --git a/samples/client/petstore/java/jersey3/docs/PetApi.md b/samples/client/petstore/java/jersey3/docs/PetApi.md
new file mode 100644
index 000000000000..eb2957e47054
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/docs/PetApi.md
@@ -0,0 +1,671 @@
+# PetApi
+
+All URIs are relative to *http://petstore.swagger.io:80/v2*
+
+| Method | HTTP request | Description |
+|------------- | ------------- | -------------|
+| [**addPet**](PetApi.md#addPet) | **POST** /pet | Add a new pet to the store |
+| [**deletePet**](PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet |
+| [**findPetsByStatus**](PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status |
+| [**findPetsByTags**](PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags |
+| [**getPetById**](PetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID |
+| [**updatePet**](PetApi.md#updatePet) | **PUT** /pet | Update an existing pet |
+| [**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data |
+| [**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image |
+| [**uploadFileWithRequiredFile**](PetApi.md#uploadFileWithRequiredFile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) |
+
+
+
+## addPet
+
+> addPet(pet)
+
+Add a new pet to the store
+
+
+
+### Example
+
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.auth.*;
+import org.openapitools.client.model.*;
+import org.openapitools.client.api.PetApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+
+ // Configure OAuth2 access token for authorization: petstore_auth
+ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
+ petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
+
+ PetApi apiInstance = new PetApi(defaultClient);
+ Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store
+ try {
+ apiInstance.addPet(pet);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling PetApi#addPet");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+| Name | Type | Description | Notes |
+|------------- | ------------- | ------------- | -------------|
+| **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+[http_signature_test](../README.md#http_signature_test), [petstore_auth](../README.md#petstore_auth)
+
+### HTTP request headers
+
+- **Content-Type**: application/json, application/xml
+- **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **405** | Invalid input | - |
+
+
+## deletePet
+
+> deletePet(petId, apiKey)
+
+Deletes a pet
+
+
+
+### Example
+
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.auth.*;
+import org.openapitools.client.model.*;
+import org.openapitools.client.api.PetApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ // Configure OAuth2 access token for authorization: petstore_auth
+ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
+ petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
+
+ PetApi apiInstance = new PetApi(defaultClient);
+ Long petId = 56L; // Long | Pet id to delete
+ String apiKey = "apiKey_example"; // String |
+ try {
+ apiInstance.deletePet(petId, apiKey);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling PetApi#deletePet");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+| Name | Type | Description | Notes |
+|------------- | ------------- | ------------- | -------------|
+| **petId** | **Long**| Pet id to delete | |
+| **apiKey** | **String**| | [optional] |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+[petstore_auth](../README.md#petstore_auth)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **400** | Invalid pet value | - |
+
+
+## findPetsByStatus
+
+> List<Pet> findPetsByStatus(status)
+
+Finds Pets by status
+
+Multiple status values can be provided with comma separated strings
+
+### Example
+
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.auth.*;
+import org.openapitools.client.model.*;
+import org.openapitools.client.api.PetApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+
+ // Configure OAuth2 access token for authorization: petstore_auth
+ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
+ petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
+
+ PetApi apiInstance = new PetApi(defaultClient);
+ List status = Arrays.asList("available"); // List | Status values that need to be considered for filter
+ try {
+ List result = apiInstance.findPetsByStatus(status);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling PetApi#findPetsByStatus");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+| Name | Type | Description | Notes |
+|------------- | ------------- | ------------- | -------------|
+| **status** | **List<String>**| Status values that need to be considered for filter | [enum: available, pending, sold] |
+
+### Return type
+
+[**List<Pet>**](Pet.md)
+
+### Authorization
+
+[http_signature_test](../README.md#http_signature_test), [petstore_auth](../README.md#petstore_auth)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: application/xml, application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **200** | successful operation | - |
+| **400** | Invalid status value | - |
+
+
+## findPetsByTags
+
+> List<Pet> findPetsByTags(tags)
+
+Finds Pets by tags
+
+Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
+
+### Example
+
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.auth.*;
+import org.openapitools.client.model.*;
+import org.openapitools.client.api.PetApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+
+ // Configure OAuth2 access token for authorization: petstore_auth
+ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
+ petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
+
+ PetApi apiInstance = new PetApi(defaultClient);
+ List tags = Arrays.asList(); // List | Tags to filter by
+ try {
+ List result = apiInstance.findPetsByTags(tags);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling PetApi#findPetsByTags");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+| Name | Type | Description | Notes |
+|------------- | ------------- | ------------- | -------------|
+| **tags** | **List<String>**| Tags to filter by | |
+
+### Return type
+
+[**List<Pet>**](Pet.md)
+
+### Authorization
+
+[http_signature_test](../README.md#http_signature_test), [petstore_auth](../README.md#petstore_auth)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: application/xml, application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **200** | successful operation | - |
+| **400** | Invalid tag value | - |
+
+
+## getPetById
+
+> Pet getPetById(petId)
+
+Find pet by ID
+
+Returns a single pet
+
+### Example
+
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.auth.*;
+import org.openapitools.client.model.*;
+import org.openapitools.client.api.PetApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ // Configure API key authorization: api_key
+ ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key");
+ api_key.setApiKey("YOUR API KEY");
+ // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
+ //api_key.setApiKeyPrefix("Token");
+
+ PetApi apiInstance = new PetApi(defaultClient);
+ Long petId = 56L; // Long | ID of pet to return
+ try {
+ Pet result = apiInstance.getPetById(petId);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling PetApi#getPetById");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+| Name | Type | Description | Notes |
+|------------- | ------------- | ------------- | -------------|
+| **petId** | **Long**| ID of pet to return | |
+
+### Return type
+
+[**Pet**](Pet.md)
+
+### Authorization
+
+[api_key](../README.md#api_key)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: application/xml, application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **200** | successful operation | - |
+| **400** | Invalid ID supplied | - |
+| **404** | Pet not found | - |
+
+
+## updatePet
+
+> updatePet(pet)
+
+Update an existing pet
+
+
+
+### Example
+
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.auth.*;
+import org.openapitools.client.model.*;
+import org.openapitools.client.api.PetApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+
+ // Configure OAuth2 access token for authorization: petstore_auth
+ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
+ petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
+
+ PetApi apiInstance = new PetApi(defaultClient);
+ Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store
+ try {
+ apiInstance.updatePet(pet);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling PetApi#updatePet");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+| Name | Type | Description | Notes |
+|------------- | ------------- | ------------- | -------------|
+| **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+[http_signature_test](../README.md#http_signature_test), [petstore_auth](../README.md#petstore_auth)
+
+### HTTP request headers
+
+- **Content-Type**: application/json, application/xml
+- **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **400** | Invalid ID supplied | - |
+| **404** | Pet not found | - |
+| **405** | Validation exception | - |
+
+
+## updatePetWithForm
+
+> updatePetWithForm(petId, name, status)
+
+Updates a pet in the store with form data
+
+
+
+### Example
+
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.auth.*;
+import org.openapitools.client.model.*;
+import org.openapitools.client.api.PetApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ // Configure OAuth2 access token for authorization: petstore_auth
+ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
+ petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
+
+ PetApi apiInstance = new PetApi(defaultClient);
+ Long petId = 56L; // Long | ID of pet that needs to be updated
+ String name = "name_example"; // String | Updated name of the pet
+ String status = "status_example"; // String | Updated status of the pet
+ try {
+ apiInstance.updatePetWithForm(petId, name, status);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling PetApi#updatePetWithForm");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+| Name | Type | Description | Notes |
+|------------- | ------------- | ------------- | -------------|
+| **petId** | **Long**| ID of pet that needs to be updated | |
+| **name** | **String**| Updated name of the pet | [optional] |
+| **status** | **String**| Updated status of the pet | [optional] |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+[petstore_auth](../README.md#petstore_auth)
+
+### HTTP request headers
+
+- **Content-Type**: application/x-www-form-urlencoded
+- **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **405** | Invalid input | - |
+
+
+## uploadFile
+
+> ModelApiResponse uploadFile(petId, additionalMetadata, _file)
+
+uploads an image
+
+
+
+### Example
+
+```java
+import java.io.File;
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.auth.*;
+import org.openapitools.client.model.*;
+import org.openapitools.client.api.PetApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ // Configure OAuth2 access token for authorization: petstore_auth
+ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
+ petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
+
+ PetApi apiInstance = new PetApi(defaultClient);
+ Long petId = 56L; // Long | ID of pet to update
+ String additionalMetadata = "additionalMetadata_example"; // String | Additional data to pass to server
+ File _file = new File("/path/to/file"); // File | file to upload
+ try {
+ ModelApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, _file);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling PetApi#uploadFile");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+| Name | Type | Description | Notes |
+|------------- | ------------- | ------------- | -------------|
+| **petId** | **Long**| ID of pet to update | |
+| **additionalMetadata** | **String**| Additional data to pass to server | [optional] |
+| **_file** | **File**| file to upload | [optional] |
+
+### Return type
+
+[**ModelApiResponse**](ModelApiResponse.md)
+
+### Authorization
+
+[petstore_auth](../README.md#petstore_auth)
+
+### HTTP request headers
+
+- **Content-Type**: multipart/form-data
+- **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **200** | successful operation | - |
+
+
+## uploadFileWithRequiredFile
+
+> ModelApiResponse uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata)
+
+uploads an image (required)
+
+
+
+### Example
+
+```java
+import java.io.File;
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.auth.*;
+import org.openapitools.client.model.*;
+import org.openapitools.client.api.PetApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ // Configure OAuth2 access token for authorization: petstore_auth
+ OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
+ petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
+
+ PetApi apiInstance = new PetApi(defaultClient);
+ Long petId = 56L; // Long | ID of pet to update
+ File requiredFile = new File("/path/to/file"); // File | file to upload
+ String additionalMetadata = "additionalMetadata_example"; // String | Additional data to pass to server
+ try {
+ ModelApiResponse result = apiInstance.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling PetApi#uploadFileWithRequiredFile");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+| Name | Type | Description | Notes |
+|------------- | ------------- | ------------- | -------------|
+| **petId** | **Long**| ID of pet to update | |
+| **requiredFile** | **File**| file to upload | |
+| **additionalMetadata** | **String**| Additional data to pass to server | [optional] |
+
+### Return type
+
+[**ModelApiResponse**](ModelApiResponse.md)
+
+### Authorization
+
+[petstore_auth](../README.md#petstore_auth)
+
+### HTTP request headers
+
+- **Content-Type**: multipart/form-data
+- **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **200** | successful operation | - |
+
diff --git a/samples/client/petstore/java/jersey3/docs/Pig.md b/samples/client/petstore/java/jersey3/docs/Pig.md
new file mode 100644
index 000000000000..f0a92bbe61b8
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/docs/Pig.md
@@ -0,0 +1,37 @@
+
+
+# Pig
+
+## oneOf schemas
+* [BasquePig](BasquePig.md)
+* [DanishPig](DanishPig.md)
+
+## Example
+```java
+// Import classes:
+import org.openapitools.client.model.Pig;
+import org.openapitools.client.model.BasquePig;
+import org.openapitools.client.model.DanishPig;
+
+public class Example {
+ public static void main(String[] args) {
+ Pig examplePig = new Pig();
+
+ // create a new BasquePig
+ BasquePig exampleBasquePig = new BasquePig();
+ // set Pig to BasquePig
+ examplePig.setActualInstance(exampleBasquePig);
+ // to get back the BasquePig set earlier
+ BasquePig testBasquePig = (BasquePig) examplePig.getActualInstance();
+
+ // create a new DanishPig
+ DanishPig exampleDanishPig = new DanishPig();
+ // set Pig to DanishPig
+ examplePig.setActualInstance(exampleDanishPig);
+ // to get back the DanishPig set earlier
+ DanishPig testDanishPig = (DanishPig) examplePig.getActualInstance();
+ }
+}
+```
+
+
diff --git a/samples/client/petstore/java/jersey3/docs/Quadrilateral.md b/samples/client/petstore/java/jersey3/docs/Quadrilateral.md
new file mode 100644
index 000000000000..83ffea0c742f
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/docs/Quadrilateral.md
@@ -0,0 +1,37 @@
+
+
+# Quadrilateral
+
+## oneOf schemas
+* [ComplexQuadrilateral](ComplexQuadrilateral.md)
+* [SimpleQuadrilateral](SimpleQuadrilateral.md)
+
+## Example
+```java
+// Import classes:
+import org.openapitools.client.model.Quadrilateral;
+import org.openapitools.client.model.ComplexQuadrilateral;
+import org.openapitools.client.model.SimpleQuadrilateral;
+
+public class Example {
+ public static void main(String[] args) {
+ Quadrilateral exampleQuadrilateral = new Quadrilateral();
+
+ // create a new ComplexQuadrilateral
+ ComplexQuadrilateral exampleComplexQuadrilateral = new ComplexQuadrilateral();
+ // set Quadrilateral to ComplexQuadrilateral
+ exampleQuadrilateral.setActualInstance(exampleComplexQuadrilateral);
+ // to get back the ComplexQuadrilateral set earlier
+ ComplexQuadrilateral testComplexQuadrilateral = (ComplexQuadrilateral) exampleQuadrilateral.getActualInstance();
+
+ // create a new SimpleQuadrilateral
+ SimpleQuadrilateral exampleSimpleQuadrilateral = new SimpleQuadrilateral();
+ // set Quadrilateral to SimpleQuadrilateral
+ exampleQuadrilateral.setActualInstance(exampleSimpleQuadrilateral);
+ // to get back the SimpleQuadrilateral set earlier
+ SimpleQuadrilateral testSimpleQuadrilateral = (SimpleQuadrilateral) exampleQuadrilateral.getActualInstance();
+ }
+}
+```
+
+
diff --git a/samples/client/petstore/java/jersey3/docs/QuadrilateralInterface.md b/samples/client/petstore/java/jersey3/docs/QuadrilateralInterface.md
new file mode 100644
index 000000000000..99451f3bd020
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/docs/QuadrilateralInterface.md
@@ -0,0 +1,13 @@
+
+
+# QuadrilateralInterface
+
+
+## Properties
+
+| Name | Type | Description | Notes |
+|------------ | ------------- | ------------- | -------------|
+|**quadrilateralType** | **String** | | |
+
+
+
diff --git a/samples/client/petstore/java/jersey3/docs/ReadOnlyFirst.md b/samples/client/petstore/java/jersey3/docs/ReadOnlyFirst.md
new file mode 100644
index 000000000000..ad6af7ee155f
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/docs/ReadOnlyFirst.md
@@ -0,0 +1,14 @@
+
+
+# ReadOnlyFirst
+
+
+## Properties
+
+| Name | Type | Description | Notes |
+|------------ | ------------- | ------------- | -------------|
+|**bar** | **String** | | [optional] [readonly] |
+|**baz** | **String** | | [optional] |
+
+
+
diff --git a/samples/client/petstore/java/jersey3/docs/ScaleneTriangle.md b/samples/client/petstore/java/jersey3/docs/ScaleneTriangle.md
new file mode 100644
index 000000000000..c578f6cbfaab
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/docs/ScaleneTriangle.md
@@ -0,0 +1,14 @@
+
+
+# ScaleneTriangle
+
+
+## Properties
+
+| Name | Type | Description | Notes |
+|------------ | ------------- | ------------- | -------------|
+|**shapeType** | **String** | | |
+|**triangleType** | **String** | | |
+
+
+
diff --git a/samples/client/petstore/java/jersey3/docs/Shape.md b/samples/client/petstore/java/jersey3/docs/Shape.md
new file mode 100644
index 000000000000..9c237eefb048
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/docs/Shape.md
@@ -0,0 +1,37 @@
+
+
+# Shape
+
+## oneOf schemas
+* [Quadrilateral](Quadrilateral.md)
+* [Triangle](Triangle.md)
+
+## Example
+```java
+// Import classes:
+import org.openapitools.client.model.Shape;
+import org.openapitools.client.model.Quadrilateral;
+import org.openapitools.client.model.Triangle;
+
+public class Example {
+ public static void main(String[] args) {
+ Shape exampleShape = new Shape();
+
+ // create a new Quadrilateral
+ Quadrilateral exampleQuadrilateral = new Quadrilateral();
+ // set Shape to Quadrilateral
+ exampleShape.setActualInstance(exampleQuadrilateral);
+ // to get back the Quadrilateral set earlier
+ Quadrilateral testQuadrilateral = (Quadrilateral) exampleShape.getActualInstance();
+
+ // create a new Triangle
+ Triangle exampleTriangle = new Triangle();
+ // set Shape to Triangle
+ exampleShape.setActualInstance(exampleTriangle);
+ // to get back the Triangle set earlier
+ Triangle testTriangle = (Triangle) exampleShape.getActualInstance();
+ }
+}
+```
+
+
diff --git a/samples/client/petstore/java/jersey3/docs/ShapeInterface.md b/samples/client/petstore/java/jersey3/docs/ShapeInterface.md
new file mode 100644
index 000000000000..b4f981e3b566
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/docs/ShapeInterface.md
@@ -0,0 +1,13 @@
+
+
+# ShapeInterface
+
+
+## Properties
+
+| Name | Type | Description | Notes |
+|------------ | ------------- | ------------- | -------------|
+|**shapeType** | **String** | | |
+
+
+
diff --git a/samples/client/petstore/java/jersey3/docs/ShapeOrNull.md b/samples/client/petstore/java/jersey3/docs/ShapeOrNull.md
new file mode 100644
index 000000000000..6a738c4b9870
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/docs/ShapeOrNull.md
@@ -0,0 +1,41 @@
+
+
+# ShapeOrNull
+
+The value may be a shape or the 'null' value. This is introduced in OAS schema >= 3.1.
+
+## oneOf schemas
+* [Quadrilateral](Quadrilateral.md)
+* [Triangle](Triangle.md)
+
+NOTE: this class is nullable.
+
+## Example
+```java
+// Import classes:
+import org.openapitools.client.model.ShapeOrNull;
+import org.openapitools.client.model.Quadrilateral;
+import org.openapitools.client.model.Triangle;
+
+public class Example {
+ public static void main(String[] args) {
+ ShapeOrNull exampleShapeOrNull = new ShapeOrNull();
+
+ // create a new Quadrilateral
+ Quadrilateral exampleQuadrilateral = new Quadrilateral();
+ // set ShapeOrNull to Quadrilateral
+ exampleShapeOrNull.setActualInstance(exampleQuadrilateral);
+ // to get back the Quadrilateral set earlier
+ Quadrilateral testQuadrilateral = (Quadrilateral) exampleShapeOrNull.getActualInstance();
+
+ // create a new Triangle
+ Triangle exampleTriangle = new Triangle();
+ // set ShapeOrNull to Triangle
+ exampleShapeOrNull.setActualInstance(exampleTriangle);
+ // to get back the Triangle set earlier
+ Triangle testTriangle = (Triangle) exampleShapeOrNull.getActualInstance();
+ }
+}
+```
+
+
diff --git a/samples/client/petstore/java/jersey3/docs/SimpleQuadrilateral.md b/samples/client/petstore/java/jersey3/docs/SimpleQuadrilateral.md
new file mode 100644
index 000000000000..52fb7d1a6a49
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/docs/SimpleQuadrilateral.md
@@ -0,0 +1,14 @@
+
+
+# SimpleQuadrilateral
+
+
+## Properties
+
+| Name | Type | Description | Notes |
+|------------ | ------------- | ------------- | -------------|
+|**shapeType** | **String** | | |
+|**quadrilateralType** | **String** | | |
+
+
+
diff --git a/samples/client/petstore/java/jersey3/docs/SpecialModelName.md b/samples/client/petstore/java/jersey3/docs/SpecialModelName.md
new file mode 100644
index 000000000000..e17d0d797b7f
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/docs/SpecialModelName.md
@@ -0,0 +1,14 @@
+
+
+# SpecialModelName
+
+
+## Properties
+
+| Name | Type | Description | Notes |
+|------------ | ------------- | ------------- | -------------|
+|**$specialPropertyName** | **Long** | | [optional] |
+|**specialModelName** | **String** | | [optional] |
+
+
+
diff --git a/samples/client/petstore/java/jersey3/docs/StoreApi.md b/samples/client/petstore/java/jersey3/docs/StoreApi.md
new file mode 100644
index 000000000000..a3cbc7ec0507
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/docs/StoreApi.md
@@ -0,0 +1,278 @@
+# StoreApi
+
+All URIs are relative to *http://petstore.swagger.io:80/v2*
+
+| Method | HTTP request | Description |
+|------------- | ------------- | -------------|
+| [**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID |
+| [**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status |
+| [**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID |
+| [**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet |
+
+
+
+## deleteOrder
+
+> deleteOrder(orderId)
+
+Delete purchase order by ID
+
+For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
+
+### Example
+
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.model.*;
+import org.openapitools.client.api.StoreApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ StoreApi apiInstance = new StoreApi(defaultClient);
+ String orderId = "orderId_example"; // String | ID of the order that needs to be deleted
+ try {
+ apiInstance.deleteOrder(orderId);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling StoreApi#deleteOrder");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+| Name | Type | Description | Notes |
+|------------- | ------------- | ------------- | -------------|
+| **orderId** | **String**| ID of the order that needs to be deleted | |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **400** | Invalid ID supplied | - |
+| **404** | Order not found | - |
+
+
+## getInventory
+
+> Map<String, Integer> getInventory()
+
+Returns pet inventories by status
+
+Returns a map of status codes to quantities
+
+### Example
+
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.auth.*;
+import org.openapitools.client.model.*;
+import org.openapitools.client.api.StoreApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ // Configure API key authorization: api_key
+ ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key");
+ api_key.setApiKey("YOUR API KEY");
+ // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
+ //api_key.setApiKeyPrefix("Token");
+
+ StoreApi apiInstance = new StoreApi(defaultClient);
+ try {
+ Map result = apiInstance.getInventory();
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling StoreApi#getInventory");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+This endpoint does not need any parameter.
+
+### Return type
+
+**Map<String, Integer>**
+
+### Authorization
+
+[api_key](../README.md#api_key)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **200** | successful operation | - |
+
+
+## getOrderById
+
+> Order getOrderById(orderId)
+
+Find purchase order by ID
+
+For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
+
+### Example
+
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.model.*;
+import org.openapitools.client.api.StoreApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ StoreApi apiInstance = new StoreApi(defaultClient);
+ Long orderId = 56L; // Long | ID of pet that needs to be fetched
+ try {
+ Order result = apiInstance.getOrderById(orderId);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling StoreApi#getOrderById");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+| Name | Type | Description | Notes |
+|------------- | ------------- | ------------- | -------------|
+| **orderId** | **Long**| ID of pet that needs to be fetched | |
+
+### Return type
+
+[**Order**](Order.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: application/xml, application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **200** | successful operation | - |
+| **400** | Invalid ID supplied | - |
+| **404** | Order not found | - |
+
+
+## placeOrder
+
+> Order placeOrder(order)
+
+Place an order for a pet
+
+
+
+### Example
+
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.model.*;
+import org.openapitools.client.api.StoreApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ StoreApi apiInstance = new StoreApi(defaultClient);
+ Order order = new Order(); // Order | order placed for purchasing the pet
+ try {
+ Order result = apiInstance.placeOrder(order);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling StoreApi#placeOrder");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+| Name | Type | Description | Notes |
+|------------- | ------------- | ------------- | -------------|
+| **order** | [**Order**](Order.md)| order placed for purchasing the pet | |
+
+### Return type
+
+[**Order**](Order.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: application/json
+- **Accept**: application/xml, application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **200** | successful operation | - |
+| **400** | Invalid Order | - |
+
diff --git a/samples/client/petstore/java/jersey3/docs/Tag.md b/samples/client/petstore/java/jersey3/docs/Tag.md
new file mode 100644
index 000000000000..5088b2dd1c31
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/docs/Tag.md
@@ -0,0 +1,14 @@
+
+
+# Tag
+
+
+## Properties
+
+| Name | Type | Description | Notes |
+|------------ | ------------- | ------------- | -------------|
+|**id** | **Long** | | [optional] |
+|**name** | **String** | | [optional] |
+
+
+
diff --git a/samples/client/petstore/java/jersey3/docs/Triangle.md b/samples/client/petstore/java/jersey3/docs/Triangle.md
new file mode 100644
index 000000000000..daf9d153ff61
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/docs/Triangle.md
@@ -0,0 +1,46 @@
+
+
+# Triangle
+
+## oneOf schemas
+* [EquilateralTriangle](EquilateralTriangle.md)
+* [IsoscelesTriangle](IsoscelesTriangle.md)
+* [ScaleneTriangle](ScaleneTriangle.md)
+
+## Example
+```java
+// Import classes:
+import org.openapitools.client.model.Triangle;
+import org.openapitools.client.model.EquilateralTriangle;
+import org.openapitools.client.model.IsoscelesTriangle;
+import org.openapitools.client.model.ScaleneTriangle;
+
+public class Example {
+ public static void main(String[] args) {
+ Triangle exampleTriangle = new Triangle();
+
+ // create a new EquilateralTriangle
+ EquilateralTriangle exampleEquilateralTriangle = new EquilateralTriangle();
+ // set Triangle to EquilateralTriangle
+ exampleTriangle.setActualInstance(exampleEquilateralTriangle);
+ // to get back the EquilateralTriangle set earlier
+ EquilateralTriangle testEquilateralTriangle = (EquilateralTriangle) exampleTriangle.getActualInstance();
+
+ // create a new IsoscelesTriangle
+ IsoscelesTriangle exampleIsoscelesTriangle = new IsoscelesTriangle();
+ // set Triangle to IsoscelesTriangle
+ exampleTriangle.setActualInstance(exampleIsoscelesTriangle);
+ // to get back the IsoscelesTriangle set earlier
+ IsoscelesTriangle testIsoscelesTriangle = (IsoscelesTriangle) exampleTriangle.getActualInstance();
+
+ // create a new ScaleneTriangle
+ ScaleneTriangle exampleScaleneTriangle = new ScaleneTriangle();
+ // set Triangle to ScaleneTriangle
+ exampleTriangle.setActualInstance(exampleScaleneTriangle);
+ // to get back the ScaleneTriangle set earlier
+ ScaleneTriangle testScaleneTriangle = (ScaleneTriangle) exampleTriangle.getActualInstance();
+ }
+}
+```
+
+
diff --git a/samples/client/petstore/java/jersey3/docs/TriangleInterface.md b/samples/client/petstore/java/jersey3/docs/TriangleInterface.md
new file mode 100644
index 000000000000..ef5fc7575f34
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/docs/TriangleInterface.md
@@ -0,0 +1,13 @@
+
+
+# TriangleInterface
+
+
+## Properties
+
+| Name | Type | Description | Notes |
+|------------ | ------------- | ------------- | -------------|
+|**triangleType** | **String** | | |
+
+
+
diff --git a/samples/client/petstore/java/jersey3/docs/User.md b/samples/client/petstore/java/jersey3/docs/User.md
new file mode 100644
index 000000000000..9e97dc35485f
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/docs/User.md
@@ -0,0 +1,24 @@
+
+
+# User
+
+
+## Properties
+
+| Name | Type | Description | Notes |
+|------------ | ------------- | ------------- | -------------|
+|**id** | **Long** | | [optional] |
+|**username** | **String** | | [optional] |
+|**firstName** | **String** | | [optional] |
+|**lastName** | **String** | | [optional] |
+|**email** | **String** | | [optional] |
+|**password** | **String** | | [optional] |
+|**phone** | **String** | | [optional] |
+|**userStatus** | **Integer** | User Status | [optional] |
+|**objectWithNoDeclaredProps** | **Object** | test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value. | [optional] |
+|**objectWithNoDeclaredPropsNullable** | **Object** | test code generation for nullable objects. Value must be a map of strings to values or the 'null' value. | [optional] |
+|**anyTypeProp** | **Object** | test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389 | [optional] |
+|**anyTypePropNullable** | **Object** | test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. The 'nullable' attribute does not change the allowed values. | [optional] |
+
+
+
diff --git a/samples/client/petstore/java/jersey3/docs/UserApi.md b/samples/client/petstore/java/jersey3/docs/UserApi.md
new file mode 100644
index 000000000000..6df604acce37
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/docs/UserApi.md
@@ -0,0 +1,535 @@
+# UserApi
+
+All URIs are relative to *http://petstore.swagger.io:80/v2*
+
+| Method | HTTP request | Description |
+|------------- | ------------- | -------------|
+| [**createUser**](UserApi.md#createUser) | **POST** /user | Create user |
+| [**createUsersWithArrayInput**](UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array |
+| [**createUsersWithListInput**](UserApi.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array |
+| [**deleteUser**](UserApi.md#deleteUser) | **DELETE** /user/{username} | Delete user |
+| [**getUserByName**](UserApi.md#getUserByName) | **GET** /user/{username} | Get user by user name |
+| [**loginUser**](UserApi.md#loginUser) | **GET** /user/login | Logs user into the system |
+| [**logoutUser**](UserApi.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session |
+| [**updateUser**](UserApi.md#updateUser) | **PUT** /user/{username} | Updated user |
+
+
+
+## createUser
+
+> createUser(user)
+
+Create user
+
+This can only be done by the logged in user.
+
+### Example
+
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.model.*;
+import org.openapitools.client.api.UserApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ UserApi apiInstance = new UserApi(defaultClient);
+ User user = new User(); // User | Created user object
+ try {
+ apiInstance.createUser(user);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling UserApi#createUser");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+| Name | Type | Description | Notes |
+|------------- | ------------- | ------------- | -------------|
+| **user** | [**User**](User.md)| Created user object | |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: application/json
+- **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **0** | successful operation | - |
+
+
+## createUsersWithArrayInput
+
+> createUsersWithArrayInput(user)
+
+Creates list of users with given input array
+
+
+
+### Example
+
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.model.*;
+import org.openapitools.client.api.UserApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ UserApi apiInstance = new UserApi(defaultClient);
+ List user = Arrays.asList(); // List | List of user object
+ try {
+ apiInstance.createUsersWithArrayInput(user);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling UserApi#createUsersWithArrayInput");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+| Name | Type | Description | Notes |
+|------------- | ------------- | ------------- | -------------|
+| **user** | [**List<User>**](User.md)| List of user object | |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: application/json
+- **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **0** | successful operation | - |
+
+
+## createUsersWithListInput
+
+> createUsersWithListInput(user)
+
+Creates list of users with given input array
+
+
+
+### Example
+
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.model.*;
+import org.openapitools.client.api.UserApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ UserApi apiInstance = new UserApi(defaultClient);
+ List user = Arrays.asList(); // List | List of user object
+ try {
+ apiInstance.createUsersWithListInput(user);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling UserApi#createUsersWithListInput");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+| Name | Type | Description | Notes |
+|------------- | ------------- | ------------- | -------------|
+| **user** | [**List<User>**](User.md)| List of user object | |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: application/json
+- **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **0** | successful operation | - |
+
+
+## deleteUser
+
+> deleteUser(username)
+
+Delete user
+
+This can only be done by the logged in user.
+
+### Example
+
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.model.*;
+import org.openapitools.client.api.UserApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ UserApi apiInstance = new UserApi(defaultClient);
+ String username = "username_example"; // String | The name that needs to be deleted
+ try {
+ apiInstance.deleteUser(username);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling UserApi#deleteUser");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+| Name | Type | Description | Notes |
+|------------- | ------------- | ------------- | -------------|
+| **username** | **String**| The name that needs to be deleted | |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **400** | Invalid username supplied | - |
+| **404** | User not found | - |
+
+
+## getUserByName
+
+> User getUserByName(username)
+
+Get user by user name
+
+
+
+### Example
+
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.model.*;
+import org.openapitools.client.api.UserApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ UserApi apiInstance = new UserApi(defaultClient);
+ String username = "username_example"; // String | The name that needs to be fetched. Use user1 for testing.
+ try {
+ User result = apiInstance.getUserByName(username);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling UserApi#getUserByName");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+| Name | Type | Description | Notes |
+|------------- | ------------- | ------------- | -------------|
+| **username** | **String**| The name that needs to be fetched. Use user1 for testing. | |
+
+### Return type
+
+[**User**](User.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: application/xml, application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **200** | successful operation | - |
+| **400** | Invalid username supplied | - |
+| **404** | User not found | - |
+
+
+## loginUser
+
+> String loginUser(username, password)
+
+Logs user into the system
+
+
+
+### Example
+
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.model.*;
+import org.openapitools.client.api.UserApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ UserApi apiInstance = new UserApi(defaultClient);
+ String username = "username_example"; // String | The user name for login
+ String password = "password_example"; // String | The password for login in clear text
+ try {
+ String result = apiInstance.loginUser(username, password);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling UserApi#loginUser");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+| Name | Type | Description | Notes |
+|------------- | ------------- | ------------- | -------------|
+| **username** | **String**| The user name for login | |
+| **password** | **String**| The password for login in clear text | |
+
+### Return type
+
+**String**
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: application/xml, application/json
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **200** | successful operation | * X-Rate-Limit - calls per hour allowed by the user * X-Expires-After - date in UTC when token expires |
+| **400** | Invalid username/password supplied | - |
+
+
+## logoutUser
+
+> logoutUser()
+
+Logs out current logged in user session
+
+
+
+### Example
+
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.model.*;
+import org.openapitools.client.api.UserApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ UserApi apiInstance = new UserApi(defaultClient);
+ try {
+ apiInstance.logoutUser();
+ } catch (ApiException e) {
+ System.err.println("Exception when calling UserApi#logoutUser");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+This endpoint does not need any parameter.
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **0** | successful operation | - |
+
+
+## updateUser
+
+> updateUser(username, user)
+
+Updated user
+
+This can only be done by the logged in user.
+
+### Example
+
+```java
+// Import classes:
+import org.openapitools.client.ApiClient;
+import org.openapitools.client.ApiException;
+import org.openapitools.client.Configuration;
+import org.openapitools.client.model.*;
+import org.openapitools.client.api.UserApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+ defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
+
+ UserApi apiInstance = new UserApi(defaultClient);
+ String username = "username_example"; // String | name that need to be deleted
+ User user = new User(); // User | Updated user object
+ try {
+ apiInstance.updateUser(username, user);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling UserApi#updateUser");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
+```
+
+### Parameters
+
+
+| Name | Type | Description | Notes |
+|------------- | ------------- | ------------- | -------------|
+| **username** | **String**| name that need to be deleted | |
+| **user** | [**User**](User.md)| Updated user object | |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: application/json
+- **Accept**: Not defined
+
+### HTTP response details
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+| **400** | Invalid user supplied | - |
+| **404** | User not found | - |
+
diff --git a/samples/client/petstore/java/jersey3/docs/Whale.md b/samples/client/petstore/java/jersey3/docs/Whale.md
new file mode 100644
index 000000000000..30ce4bb82151
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/docs/Whale.md
@@ -0,0 +1,15 @@
+
+
+# Whale
+
+
+## Properties
+
+| Name | Type | Description | Notes |
+|------------ | ------------- | ------------- | -------------|
+|**hasBaleen** | **Boolean** | | [optional] |
+|**hasTeeth** | **Boolean** | | [optional] |
+|**className** | **String** | | |
+
+
+
diff --git a/samples/client/petstore/java/jersey3/docs/Zebra.md b/samples/client/petstore/java/jersey3/docs/Zebra.md
new file mode 100644
index 000000000000..f7c4389b6456
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/docs/Zebra.md
@@ -0,0 +1,24 @@
+
+
+# Zebra
+
+
+## Properties
+
+| Name | Type | Description | Notes |
+|------------ | ------------- | ------------- | -------------|
+|**type** | [**TypeEnum**](#TypeEnum) | | [optional] |
+|**className** | **String** | | |
+
+
+
+## Enum: TypeEnum
+
+| Name | Value |
+|---- | -----|
+| PLAINS | "plains" |
+| MOUNTAIN | "mountain" |
+| GREVYS | "grevys" |
+
+
+
diff --git a/samples/client/petstore/java/jersey3/git_push.sh b/samples/client/petstore/java/jersey3/git_push.sh
new file mode 100644
index 000000000000..f53a75d4fabe
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/git_push.sh
@@ -0,0 +1,57 @@
+#!/bin/sh
+# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
+#
+# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com"
+
+git_user_id=$1
+git_repo_id=$2
+release_note=$3
+git_host=$4
+
+if [ "$git_host" = "" ]; then
+ git_host="github.com"
+ echo "[INFO] No command line input provided. Set \$git_host to $git_host"
+fi
+
+if [ "$git_user_id" = "" ]; then
+ git_user_id="GIT_USER_ID"
+ echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
+fi
+
+if [ "$git_repo_id" = "" ]; then
+ git_repo_id="GIT_REPO_ID"
+ echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
+fi
+
+if [ "$release_note" = "" ]; then
+ release_note="Minor update"
+ echo "[INFO] No command line input provided. Set \$release_note to $release_note"
+fi
+
+# Initialize the local directory as a Git repository
+git init
+
+# Adds the files in the local repository and stages them for commit.
+git add .
+
+# Commits the tracked changes and prepares them to be pushed to a remote repository.
+git commit -m "$release_note"
+
+# Sets the new remote
+git_remote=$(git remote)
+if [ "$git_remote" = "" ]; then # git remote not defined
+
+ if [ "$GIT_TOKEN" = "" ]; then
+ echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
+ git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
+ else
+ git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git
+ fi
+
+fi
+
+git pull origin master
+
+# Pushes (Forces) the changes in the local repository up to the remote repository
+echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git"
+git push origin master 2>&1 | grep -v 'To https'
diff --git a/samples/client/petstore/java/jersey3/gradle.properties b/samples/client/petstore/java/jersey3/gradle.properties
new file mode 100644
index 000000000000..d3e8e41ba6fb
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/gradle.properties
@@ -0,0 +1,13 @@
+# This file is automatically generated by OpenAPI Generator (https://github.com/openAPITools/openapi-generator).
+# To include other gradle properties as part of the code generation process, please use the `gradleProperties` option.
+#
+# Gradle properties reference: https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties
+# For example, uncomment below to build for Android
+#target = android
+
+# JVM arguments
+org.gradle.jvmargs=-Xmx2024m -XX:MaxPermSize=512m
+# set timeout
+org.gradle.daemon.idletimeout=3600000
+# show all warnings
+org.gradle.warning.mode=all
diff --git a/samples/client/petstore/java/jersey3/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/java/jersey3/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 000000000000..7454180f2ae8
Binary files /dev/null and b/samples/client/petstore/java/jersey3/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/samples/client/petstore/java/jersey3/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/java/jersey3/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 000000000000..ffed3a254e91
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,5 @@
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
diff --git a/samples/client/petstore/java/jersey3/gradlew b/samples/client/petstore/java/jersey3/gradlew
new file mode 100644
index 000000000000..005bcde04284
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/gradlew
@@ -0,0 +1,234 @@
+#!/bin/sh
+
+#
+# Copyright © 2015-2021 the original authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+##############################################################################
+#
+# Gradle start up script for POSIX generated by Gradle.
+#
+# Important for running:
+#
+# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
+# noncompliant, but you have some other compliant shell such as ksh or
+# bash, then to run this script, type that shell name before the whole
+# command line, like:
+#
+# ksh Gradle
+#
+# Busybox and similar reduced shells will NOT work, because this script
+# requires all of these POSIX shell features:
+# * functions;
+# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
+# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
+# * compound commands having a testable exit status, especially «case»;
+# * various built-in commands including «command», «set», and «ulimit».
+#
+# Important for patching:
+#
+# (2) This script targets any POSIX shell, so it avoids extensions provided
+# by Bash, Ksh, etc; in particular arrays are avoided.
+#
+# The "traditional" practice of packing multiple parameters into a
+# space-separated string is a well documented source of bugs and security
+# problems, so this is (mostly) avoided, by progressively accumulating
+# options in "$@", and eventually passing that to Java.
+#
+# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
+# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
+# see the in-line comments for details.
+#
+# There are tweaks for specific operating systems such as AIX, CygWin,
+# Darwin, MinGW, and NonStop.
+#
+# (3) This script is generated from the Groovy template
+# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
+# within the Gradle project.
+#
+# You can find Gradle at https://github.com/gradle/gradle/.
+#
+##############################################################################
+
+# Attempt to set APP_HOME
+
+# Resolve links: $0 may be a link
+app_path=$0
+
+# Need this for daisy-chained symlinks.
+while
+ APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
+ [ -h "$app_path" ]
+do
+ ls=$( ls -ld "$app_path" )
+ link=${ls#*' -> '}
+ case $link in #(
+ /*) app_path=$link ;; #(
+ *) app_path=$APP_HOME$link ;;
+ esac
+done
+
+APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
+
+APP_NAME="Gradle"
+APP_BASE_NAME=${0##*/}
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"'
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD=maximum
+
+warn () {
+ echo "$*"
+} >&2
+
+die () {
+ echo
+ echo "$*"
+ echo
+ exit 1
+} >&2
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+nonstop=false
+case "$( uname )" in #(
+ CYGWIN* ) cygwin=true ;; #(
+ Darwin* ) darwin=true ;; #(
+ MSYS* | MINGW* ) msys=true ;; #(
+ NONSTOP* ) nonstop=true ;;
+esac
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD=$JAVA_HOME/jre/sh/java
+ else
+ JAVACMD=$JAVA_HOME/bin/java
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD=java
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
+ case $MAX_FD in #(
+ max*)
+ MAX_FD=$( ulimit -H -n ) ||
+ warn "Could not query maximum file descriptor limit"
+ esac
+ case $MAX_FD in #(
+ '' | soft) :;; #(
+ *)
+ ulimit -n "$MAX_FD" ||
+ warn "Could not set maximum file descriptor limit to $MAX_FD"
+ esac
+fi
+
+# Collect all arguments for the java command, stacking in reverse order:
+# * args from the command line
+# * the main class name
+# * -classpath
+# * -D...appname settings
+# * --module-path (only if needed)
+# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
+
+# For Cygwin or MSYS, switch paths to Windows format before running java
+if "$cygwin" || "$msys" ; then
+ APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
+ CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
+
+ JAVACMD=$( cygpath --unix "$JAVACMD" )
+
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ for arg do
+ if
+ case $arg in #(
+ -*) false ;; # don't mess with options #(
+ /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
+ [ -e "$t" ] ;; #(
+ *) false ;;
+ esac
+ then
+ arg=$( cygpath --path --ignore --mixed "$arg" )
+ fi
+ # Roll the args list around exactly as many times as the number of
+ # args, so each arg winds up back in the position where it started, but
+ # possibly modified.
+ #
+ # NB: a `for` loop captures its iteration list before it begins, so
+ # changing the positional parameters here affects neither the number of
+ # iterations, nor the values presented in `arg`.
+ shift # remove old arg
+ set -- "$@" "$arg" # push replacement arg
+ done
+fi
+
+# Collect all arguments for the java command;
+# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
+# shell script including quotes and variable substitutions, so put them in
+# double quotes to make sure that they get re-expanded; and
+# * put everything else in single quotes, so that it's not re-expanded.
+
+set -- \
+ "-Dorg.gradle.appname=$APP_BASE_NAME" \
+ -classpath "$CLASSPATH" \
+ org.gradle.wrapper.GradleWrapperMain \
+ "$@"
+
+# Use "xargs" to parse quoted args.
+#
+# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
+#
+# In Bash we could simply go:
+#
+# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
+# set -- "${ARGS[@]}" "$@"
+#
+# but POSIX shell has neither arrays nor command substitution, so instead we
+# post-process each arg (as a line of input to sed) to backslash-escape any
+# character that might be a shell metacharacter, then use eval to reverse
+# that process (while maintaining the separation between arguments), and wrap
+# the whole thing up as a single "set" statement.
+#
+# This will of course break if any of these variables contains a newline or
+# an unmatched quote.
+#
+
+eval "set -- $(
+ printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
+ xargs -n1 |
+ sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
+ tr '\n' ' '
+ )" '"$@"'
+
+exec "$JAVACMD" "$@"
diff --git a/samples/client/petstore/java/jersey3/gradlew.bat b/samples/client/petstore/java/jersey3/gradlew.bat
new file mode 100644
index 000000000000..6a68175eb70f
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/gradlew.bat
@@ -0,0 +1,89 @@
+@rem
+@rem Copyright 2015 the original author or authors.
+@rem
+@rem Licensed under the Apache License, Version 2.0 (the "License");
+@rem you may not use this file except in compliance with the License.
+@rem You may obtain a copy of the License at
+@rem
+@rem https://www.apache.org/licenses/LICENSE-2.0
+@rem
+@rem Unless required by applicable law or agreed to in writing, software
+@rem distributed under the License is distributed on an "AS IS" BASIS,
+@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+@rem See the License for the specific language governing permissions and
+@rem limitations under the License.
+@rem
+
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Resolve any "." and ".." in APP_HOME to make it shorter.
+for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto execute
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto execute
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/samples/client/petstore/java/jersey3/pom.xml b/samples/client/petstore/java/jersey3/pom.xml
new file mode 100644
index 000000000000..fbe5148197e8
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/pom.xml
@@ -0,0 +1,357 @@
+
+ 4.0.0
+ org.openapitools
+ petstore-jersey3
+ jar
+ petstore-jersey3
+ 1.0.0
+ https://github.com/openapitools/openapi-generator
+ OpenAPI Java
+
+ scm:git:git@github.com:openapitools/openapi-generator.git
+ scm:git:git@github.com:openapitools/openapi-generator.git
+ https://github.com/openapitools/openapi-generator
+
+
+
+
+ Unlicense
+ https://www.apache.org/licenses/LICENSE-2.0.html
+ repo
+
+
+
+
+
+ OpenAPI-Generator Contributors
+ team@openapitools.org
+ OpenAPITools.org
+ http://openapitools.org
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-enforcer-plugin
+ 3.0.0
+
+
+ enforce-maven
+
+ enforce
+
+
+
+
+ 2.2.0
+
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-surefire-plugin
+ 3.0.0-M5
+
+
+
+ loggerPath
+ conf/log4j.properties
+
+
+ -Xms512m -Xmx1500m
+ methods
+ 10
+ false
+
+
+
+ maven-dependency-plugin
+
+
+ package
+
+ copy-dependencies
+
+
+ ${project.build.directory}/lib
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-jar-plugin
+ 3.2.2
+
+
+
+ test-jar
+
+
+
+
+
+
+
+ org.codehaus.mojo
+ build-helper-maven-plugin
+ 3.3.0
+
+
+ add_sources
+ generate-sources
+
+ add-source
+
+
+
+ src/main/java
+
+
+
+
+ add_test_sources
+ generate-test-sources
+
+ add-test-source
+
+
+
+ src/test/java
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+ 3.10.1
+
+ 1.8
+ 1.8
+ true
+ 128m
+ 512m
+
+ -Xlint:all
+ -J-Xss4m
+
+
+
+
+ org.apache.maven.plugins
+ maven-javadoc-plugin
+ 3.3.2
+
+
+ attach-javadocs
+
+ jar
+
+
+
+
+ none
+ 1.8
+
+
+ http.response.details
+ a
+ Http Response Details:
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-source-plugin
+ 3.2.0
+
+
+ attach-sources
+
+ jar-no-fork
+
+
+
+
+
+
+ com.diffplug.spotless
+ spotless-maven-plugin
+ ${spotless.version}
+
+
+
+
+
+
+ .gitignore
+
+
+
+
+
+ true
+ 4
+
+
+
+
+
+
+
+
+
+ 1.8
+
+ true
+
+
+
+
+
+
+
+
+
+
+
+ sign-artifacts
+
+
+
+ org.apache.maven.plugins
+ maven-gpg-plugin
+ 3.0.1
+
+
+ sign-artifacts
+ verify
+
+ sign
+
+
+
+
+
+
+
+
+
+
+
+ io.swagger
+ swagger-annotations
+ ${swagger-annotations-version}
+
+
+
+
+ com.google.code.findbugs
+ jsr305
+ 3.0.2
+
+
+
+
+ org.glassfish.jersey.core
+ jersey-client
+ ${jersey-version}
+
+
+ org.glassfish.jersey.inject
+ jersey-hk2
+ ${jersey-version}
+
+
+ org.glassfish.jersey.media
+ jersey-media-multipart
+ ${jersey-version}
+
+
+ org.glassfish.jersey.media
+ jersey-media-json-jackson
+ ${jersey-version}
+
+
+
+
+ com.fasterxml.jackson.core
+ jackson-core
+ ${jackson-version}
+
+
+ com.fasterxml.jackson.core
+ jackson-annotations
+ ${jackson-version}
+
+
+ com.fasterxml.jackson.core
+ jackson-databind
+ ${jackson-databind-version}
+
+
+ org.openapitools
+ jackson-databind-nullable
+ ${jackson-databind-nullable-version}
+
+
+ com.fasterxml.jackson.datatype
+ jackson-datatype-jsr310
+ ${jackson-version}
+
+
+ org.tomitribe
+ tomitribe-http-signatures
+ ${http-signature-version}
+
+
+ com.github.scribejava
+ scribejava-apis
+ ${scribejava-apis-version}
+
+
+ jakarta.annotation
+ jakarta.annotation-api
+ ${jakarta-annotation-version}
+ provided
+
+
+ org.glassfish.jersey.connectors
+ jersey-apache-connector
+ ${jersey-version}
+
+
+
+ org.junit.jupiter
+ junit-jupiter-api
+ ${junit-version}
+ test
+
+
+
+ UTF-8
+ 1.6.5
+ 3.0.4
+ 2.13.2
+ 2.13.2
+ 0.2.2
+ 2.1.0
+ 5.8.2
+ 1.7
+ 8.3.1
+ 2.21.0
+
+
diff --git a/samples/client/petstore/java/jersey3/settings.gradle b/samples/client/petstore/java/jersey3/settings.gradle
new file mode 100644
index 000000000000..b50c71ae7985
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/settings.gradle
@@ -0,0 +1 @@
+rootProject.name = "petstore-jersey3"
\ No newline at end of file
diff --git a/samples/client/petstore/java/jersey3/src/main/AndroidManifest.xml b/samples/client/petstore/java/jersey3/src/main/AndroidManifest.xml
new file mode 100644
index 000000000000..54fbcb3da1e8
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/src/main/AndroidManifest.xml
@@ -0,0 +1,3 @@
+
+
+
diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ApiClient.java
new file mode 100644
index 000000000000..10170cec2b62
--- /dev/null
+++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ApiClient.java
@@ -0,0 +1,1447 @@
+package org.openapitools.client;
+
+import jakarta.ws.rs.client.Client;
+import jakarta.ws.rs.client.ClientBuilder;
+import jakarta.ws.rs.client.Entity;
+import jakarta.ws.rs.client.Invocation;
+import jakarta.ws.rs.client.WebTarget;
+import jakarta.ws.rs.core.Form;
+import jakarta.ws.rs.core.GenericType;
+import jakarta.ws.rs.core.MediaType;
+import jakarta.ws.rs.core.Response;
+import jakarta.ws.rs.core.Response.Status;
+
+import com.github.scribejava.core.model.OAuth2AccessToken;
+import org.glassfish.jersey.client.ClientConfig;
+import org.glassfish.jersey.client.ClientProperties;
+import org.glassfish.jersey.client.HttpUrlConnectorProvider;
+import org.glassfish.jersey.jackson.JacksonFeature;
+import org.glassfish.jersey.media.multipart.FormDataBodyPart;
+import org.glassfish.jersey.media.multipart.FormDataContentDisposition;
+import org.glassfish.jersey.media.multipart.MultiPart;
+import org.glassfish.jersey.media.multipart.MultiPartFeature;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+import java.net.URI;
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.TrustManager;
+import javax.net.ssl.X509TrustManager;
+import java.security.cert.X509Certificate;
+import java.security.KeyManagementException;
+import java.security.NoSuchAlgorithmException;
+import java.security.SecureRandom;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.nio.file.StandardCopyOption;
+import org.glassfish.jersey.logging.LoggingFeature;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Arrays;
+import java.util.ArrayList;
+import java.util.Date;
+import java.time.OffsetDateTime;
+
+import java.net.URLEncoder;
+
+import java.io.File;
+import java.io.UnsupportedEncodingException;
+
+import java.text.DateFormat;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.openapitools.client.auth.Authentication;
+import org.openapitools.client.auth.HttpBasicAuth;
+import org.openapitools.client.auth.HttpBearerAuth;
+import org.openapitools.client.auth.HttpSignatureAuth;
+import org.openapitools.client.auth.ApiKeyAuth;
+import org.openapitools.client.auth.OAuth;
+
+/**
+ * ApiClient class.
+ */
+@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
+public class ApiClient extends JavaTimeFormatter {
+ protected Map defaultHeaderMap = new HashMap();
+ protected Map defaultCookieMap = new HashMap();
+ protected String basePath = "http://petstore.swagger.io:80/v2";
+ protected String userAgent;
+ private static final Logger log = Logger.getLogger(ApiClient.class.getName());
+
+ protected List servers = new ArrayList(Arrays.asList(
+ new ServerConfiguration(
+ "http://{server}.swagger.io:{port}/v2",
+ "petstore server",
+ new HashMap() {{
+ put("server", new ServerVariable(
+ "No description provided",
+ "petstore",
+ new HashSet(
+ Arrays.asList(
+ "petstore",
+ "qa-petstore",
+ "dev-petstore"
+ )
+ )
+ ));
+ put("port", new ServerVariable(
+ "No description provided",
+ "80",
+ new HashSet(
+ Arrays.asList(
+ "80",
+ "8080"
+ )
+ )
+ ));
+ }}
+ ),
+ new ServerConfiguration(
+ "https://localhost:8080/{version}",
+ "The local server",
+ new HashMap() {{
+ put("version", new ServerVariable(
+ "No description provided",
+ "v2",
+ new HashSet(
+ Arrays.asList(
+ "v1",
+ "v2"
+ )
+ )
+ ));
+ }}
+ ),
+ new ServerConfiguration(
+ "https://127.0.0.1/no_variable",
+ "The local server without variables",
+ new HashMap()
+ )
+ ));
+ protected Integer serverIndex = 0;
+ protected Map serverVariables = null;
+ protected Map> operationServers = new HashMap>() {{
+ put("PetApi.addPet", new ArrayList(Arrays.asList(
+ new ServerConfiguration(
+ "http://petstore.swagger.io/v2",
+ "No description provided",
+ new HashMap()
+ ),
+
+ new ServerConfiguration(
+ "http://path-server-test.petstore.local/v2",
+ "No description provided",
+ new HashMap()
+ )
+ )));
+ put("PetApi.updatePet", new ArrayList(Arrays.asList(
+ new ServerConfiguration(
+ "http://petstore.swagger.io/v2",
+ "No description provided",
+ new HashMap()
+ ),
+
+ new ServerConfiguration(
+ "http://path-server-test.petstore.local/v2",
+ "No description provided",
+ new HashMap()
+ )
+ )));
+ }};
+ protected Map operationServerIndex = new HashMap();
+ protected Map> operationServerVariables = new HashMap>();
+ protected boolean debugging = false;
+ protected ClientConfig clientConfig;
+ protected int connectionTimeout = 0;
+ private int readTimeout = 0;
+
+ protected Client httpClient;
+ protected JSON json;
+ protected String tempFolderPath = null;
+
+ protected Map authentications;
+ protected Map authenticationLookup;
+
+ protected DateFormat dateFormat;
+
+ /**
+ * Constructs a new ApiClient with default parameters.
+ */
+ public ApiClient() {
+ this(null);
+ }
+
+ /**
+ * Constructs a new ApiClient with the specified authentication parameters.
+ *
+ * @param authMap A hash map containing authentication parameters.
+ */
+ public ApiClient(Map authMap) {
+ json = new JSON();
+ httpClient = buildHttpClient();
+
+ this.dateFormat = new RFC3339DateFormat();
+
+ // Set default User-Agent.
+ setUserAgent("OpenAPI-Generator/1.0.0/java");
+
+ // Setup authentications (key: authentication name, value: authentication).
+ authentications = new HashMap();
+ Authentication auth = null;
+ if (authMap != null) {
+ auth = authMap.get("api_key");
+ }
+ if (auth instanceof ApiKeyAuth) {
+ authentications.put("api_key", auth);
+ } else {
+ authentications.put("api_key", new ApiKeyAuth("header", "api_key"));
+ }
+ if (authMap != null) {
+ auth = authMap.get("api_key_query");
+ }
+ if (auth instanceof ApiKeyAuth) {
+ authentications.put("api_key_query", auth);
+ } else {
+ authentications.put("api_key_query", new ApiKeyAuth("query", "api_key_query"));
+ }
+ if (authMap != null) {
+ auth = authMap.get("bearer_test");
+ }
+ if (auth instanceof HttpBearerAuth) {
+ authentications.put("bearer_test", auth);
+ } else {
+ authentications.put("bearer_test", new HttpBearerAuth("bearer"));
+ }
+ if (authMap != null) {
+ auth = authMap.get("http_basic_test");
+ }
+ if (auth instanceof HttpBasicAuth) {
+ authentications.put("http_basic_test", auth);
+ } else {
+ authentications.put("http_basic_test", new HttpBasicAuth());
+ }
+ if (authMap != null) {
+ auth = authMap.get("http_signature_test");
+ }
+ if (auth instanceof HttpSignatureAuth) {
+ authentications.put("http_signature_test", auth);
+ }
+ if (authMap != null) {
+ auth = authMap.get("petstore_auth");
+ }
+ if (auth instanceof OAuth) {
+ authentications.put("petstore_auth", auth);
+ } else {
+ authentications.put("petstore_auth", new OAuth(basePath, ""));
+ }
+ // Prevent the authentications from being modified.
+ authentications = Collections.unmodifiableMap(authentications);
+
+ // Setup authentication lookup (key: authentication alias, value: authentication name)
+ authenticationLookup = new HashMap();
+ }
+
+ /**
+ * Gets the JSON instance to do JSON serialization and deserialization.
+ *
+ * @return JSON
+ */
+ public JSON getJSON() {
+ return json;
+ }
+
+ /**
+ * Getter for the field httpClient
.
+ *
+ * @return a {@link jakarta.ws.rs.client.Client} object.
+ */
+ public Client getHttpClient() {
+ return httpClient;
+ }
+
+ /**
+ * Setter for the field httpClient
.
+ *
+ * @param httpClient a {@link jakarta.ws.rs.client.Client} object.
+ * @return a {@link org.openapitools.client.ApiClient} object.
+ */
+ public ApiClient setHttpClient(Client httpClient) {
+ this.httpClient = httpClient;
+ return this;
+ }
+
+ /**
+ * Returns the base URL to the location where the OpenAPI document is being served.
+ *
+ * @return The base URL to the target host.
+ */
+ public String getBasePath() {
+ return basePath;
+ }
+
+ /**
+ * Sets the base URL to the location where the OpenAPI document is being served.
+ *
+ * @param basePath The base URL to the target host.
+ * @return a {@link org.openapitools.client.ApiClient} object.
+ */
+ public ApiClient setBasePath(String basePath) {
+ this.basePath = basePath;
+ setOauthBasePath(basePath);
+ return this;
+ }
+
+ /**
+ * Getter for the field servers
.
+ *
+ * @return a {@link java.util.List} of servers.
+ */
+ public List getServers() {
+ return servers;
+ }
+
+ /**
+ * Setter for the field servers
.
+ *
+ * @param servers a {@link java.util.List} of servers.
+ * @return a {@link org.openapitools.client.ApiClient} object.
+ */
+ public ApiClient setServers(List servers) {
+ this.servers = servers;
+ updateBasePath();
+ return this;
+ }
+
+ /**
+ * Getter for the field serverIndex
.
+ *
+ * @return a {@link java.lang.Integer} object.
+ */
+ public Integer getServerIndex() {
+ return serverIndex;
+ }
+
+ /**
+ * Setter for the field serverIndex
.
+ *
+ * @param serverIndex the server index
+ * @return a {@link org.openapitools.client.ApiClient} object.
+ */
+ public ApiClient setServerIndex(Integer serverIndex) {
+ this.serverIndex = serverIndex;
+ updateBasePath();
+ return this;
+ }
+
+ /**
+ * Getter for the field serverVariables
.
+ *
+ * @return a {@link java.util.Map} of server variables.
+ */
+ public Map getServerVariables() {
+ return serverVariables;
+ }
+
+ /**
+ * Setter for the field serverVariables
.
+ *
+ * @param serverVariables a {@link java.util.Map} of server variables.
+ * @return a {@link org.openapitools.client.ApiClient} object.
+ */
+ public ApiClient setServerVariables(Map serverVariables) {
+ this.serverVariables = serverVariables;
+ updateBasePath();
+ return this;
+ }
+
+ private void updateBasePath() {
+ if (serverIndex != null) {
+ setBasePath(servers.get(serverIndex).URL(serverVariables));
+ }
+ }
+
+ private void setOauthBasePath(String basePath) {
+ for(Authentication auth : authentications.values()) {
+ if (auth instanceof OAuth) {
+ ((OAuth) auth).setBasePath(basePath);
+ }
+ }
+ }
+
+ /**
+ * Get authentications (key: authentication name, value: authentication).
+ *
+ * @return Map of authentication object
+ */
+ public Map getAuthentications() {
+ return authentications;
+ }
+
+ /**
+ * Get authentication for the given name.
+ *
+ * @param authName The authentication name
+ * @return The authentication, null if not found
+ */
+ public Authentication getAuthentication(String authName) {
+ return authentications.get(authName);
+ }
+
+ /**
+ * Helper method to set username for the first HTTP basic authentication.
+ *
+ * @param username Username
+ * @return a {@link org.openapitools.client.ApiClient} object.
+ */
+ public ApiClient setUsername(String username) {
+ for (Authentication auth : authentications.values()) {
+ if (auth instanceof HttpBasicAuth) {
+ ((HttpBasicAuth) auth).setUsername(username);
+ return this;
+ }
+ }
+ throw new RuntimeException("No HTTP basic authentication configured!");
+ }
+
+ /**
+ * Helper method to set password for the first HTTP basic authentication.
+ *
+ * @param password Password
+ * @return a {@link org.openapitools.client.ApiClient} object.
+ */
+ public ApiClient setPassword(String password) {
+ for (Authentication auth : authentications.values()) {
+ if (auth instanceof HttpBasicAuth) {
+ ((HttpBasicAuth) auth).setPassword(password);
+ return this;
+ }
+ }
+ throw new RuntimeException("No HTTP basic authentication configured!");
+ }
+
+ /**
+ * Helper method to set API key value for the first API key authentication.
+ *
+ * @param apiKey API key
+ * @return a {@link org.openapitools.client.ApiClient} object.
+ */
+ public ApiClient setApiKey(String apiKey) {
+ for (Authentication auth : authentications.values()) {
+ if (auth instanceof ApiKeyAuth) {
+ ((ApiKeyAuth) auth).setApiKey(apiKey);
+ return this;
+ }
+ }
+ throw new RuntimeException("No API key authentication configured!");
+ }
+
+ /**
+ * Helper method to configure authentications which respects aliases of API keys.
+ *
+ * @param secrets Hash map from authentication name to its secret.
+ * @return a {@link org.openapitools.client.ApiClient} object.
+ */
+ public ApiClient configureApiKeys(Map secrets) {
+ for (Map.Entry authEntry : authentications.entrySet()) {
+ Authentication auth = authEntry.getValue();
+ if (auth instanceof ApiKeyAuth) {
+ String name = authEntry.getKey();
+ // respect x-auth-id-alias property
+ name = authenticationLookup.containsKey(name) ? authenticationLookup.get(name) : name;
+ if (secrets.containsKey(name)) {
+ ((ApiKeyAuth) auth).setApiKey(secrets.get(name));
+ }
+ }
+ }
+ return this;
+ }
+
+ /**
+ * Helper method to set API key prefix for the first API key authentication.
+ *
+ * @param apiKeyPrefix API key prefix
+ * @return a {@link org.openapitools.client.ApiClient} object.
+ */
+ public ApiClient setApiKeyPrefix(String apiKeyPrefix) {
+ for (Authentication auth : authentications.values()) {
+ if (auth instanceof ApiKeyAuth) {
+ ((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix);
+ return this;
+ }
+ }
+ throw new RuntimeException("No API key authentication configured!");
+ }
+
+ /**
+ * Helper method to set bearer token for the first Bearer authentication.
+ *
+ * @param bearerToken Bearer token
+ * @return a {@link org.openapitools.client.ApiClient} object.
+ */
+ public ApiClient setBearerToken(String bearerToken) {
+ for (Authentication auth : authentications.values()) {
+ if (auth instanceof HttpBearerAuth) {
+ ((HttpBearerAuth) auth).setBearerToken(bearerToken);
+ return this;
+ }
+ }
+ throw new RuntimeException("No Bearer authentication configured!");
+ }
+
+ /**
+ * Helper method to set access token for the first OAuth2 authentication.
+ *
+ * @param accessToken Access token
+ * @return a {@link org.openapitools.client.ApiClient} object.
+ */
+ public ApiClient setAccessToken(String accessToken) {
+ for (Authentication auth : authentications.values()) {
+ if (auth instanceof OAuth) {
+ ((OAuth) auth).setAccessToken(accessToken);
+ return this;
+ }
+ }
+ throw new RuntimeException("No OAuth2 authentication configured!");
+ }
+
+ /**
+ * Helper method to set the credentials for the first OAuth2 authentication.
+ *
+ * @param clientId the client ID
+ * @param clientSecret the client secret
+ * @return a {@link org.openapitools.client.ApiClient} object.
+ */
+ public ApiClient setOauthCredentials(String clientId, String clientSecret) {
+ for (Authentication auth : authentications.values()) {
+ if (auth instanceof OAuth) {
+ ((OAuth) auth).setCredentials(clientId, clientSecret, isDebugging());
+ return this;
+ }
+ }
+ throw new RuntimeException("No OAuth2 authentication configured!");
+ }
+
+ /**
+ * Helper method to set the password flow for the first OAuth2 authentication.
+ *
+ * @param username the user name
+ * @param password the user password
+ * @return a {@link org.openapitools.client.ApiClient} object.
+ */
+ public ApiClient setOauthPasswordFlow(String username, String password) {
+ for (Authentication auth : authentications.values()) {
+ if (auth instanceof OAuth) {
+ ((OAuth) auth).usePasswordFlow(username, password);
+ return this;
+ }
+ }
+ throw new RuntimeException("No OAuth2 authentication configured!");
+ }
+
+ /**
+ * Helper method to set the authorization code flow for the first OAuth2 authentication.
+ *
+ * @param code the authorization code
+ * @return a {@link org.openapitools.client.ApiClient} object.
+ */
+ public ApiClient setOauthAuthorizationCodeFlow(String code) {
+ for (Authentication auth : authentications.values()) {
+ if (auth instanceof OAuth) {
+ ((OAuth) auth).useAuthorizationCodeFlow(code);
+ return this;
+ }
+ }
+ throw new RuntimeException("No OAuth2 authentication configured!");
+ }
+
+ /**
+ * Helper method to set the scopes for the first OAuth2 authentication.
+ *
+ * @param scope the oauth scope
+ * @return a {@link org.openapitools.client.ApiClient} object.
+ */
+ public ApiClient setOauthScope(String scope) {
+ for (Authentication auth : authentications.values()) {
+ if (auth instanceof OAuth) {
+ ((OAuth) auth).setScope(scope);
+ return this;
+ }
+ }
+ throw new RuntimeException("No OAuth2 authentication configured!");
+ }
+
+ /**
+ * Set the User-Agent header's value (by adding to the default header map).
+ *
+ * @param userAgent Http user agent
+ * @return a {@link org.openapitools.client.ApiClient} object.
+ */
+ public ApiClient setUserAgent(String userAgent) {
+ this.userAgent = userAgent;
+ addDefaultHeader("User-Agent", userAgent);
+ return this;
+ }
+
+ /**
+ * Get the User-Agent header's value.
+ *
+ * @return User-Agent string
+ */
+ public String getUserAgent(){
+ return userAgent;
+ }
+
+ /**
+ * Add a default header.
+ *
+ * @param key The header's key
+ * @param value The header's value
+ * @return a {@link org.openapitools.client.ApiClient} object.
+ */
+ public ApiClient addDefaultHeader(String key, String value) {
+ defaultHeaderMap.put(key, value);
+ return this;
+ }
+
+ /**
+ * Add a default cookie.
+ *
+ * @param key The cookie's key
+ * @param value The cookie's value
+ * @return a {@link org.openapitools.client.ApiClient} object.
+ */
+ public ApiClient addDefaultCookie(String key, String value) {
+ defaultCookieMap.put(key, value);
+ return this;
+ }
+
+ /**
+ * Gets the client config.
+ *
+ * @return Client config
+ */
+ public ClientConfig getClientConfig() {
+ return clientConfig;
+ }
+
+ /**
+ * Set the client config.
+ *
+ * @param clientConfig Set the client config
+ * @return a {@link org.openapitools.client.ApiClient} object.
+ */
+ public ApiClient setClientConfig(ClientConfig clientConfig) {
+ this.clientConfig = clientConfig;
+ // Rebuild HTTP Client according to the new "clientConfig" value.
+ this.httpClient = buildHttpClient();
+ return this;
+ }
+
+ /**
+ * Check that whether debugging is enabled for this API client.
+ *
+ * @return True if debugging is switched on
+ */
+ public boolean isDebugging() {
+ return debugging;
+ }
+
+ /**
+ * Enable/disable debugging for this API client.
+ *
+ * @param debugging To enable (true) or disable (false) debugging
+ * @return a {@link org.openapitools.client.ApiClient} object.
+ */
+ public ApiClient setDebugging(boolean debugging) {
+ this.debugging = debugging;
+ // Rebuild HTTP Client according to the new "debugging" value.
+ this.httpClient = buildHttpClient();
+ return this;
+ }
+
+ /**
+ * The path of temporary folder used to store downloaded files from endpoints
+ * with file response. The default value is null
, i.e. using
+ * the system's default temporary folder.
+ *
+ * @return Temp folder path
+ */
+ public String getTempFolderPath() {
+ return tempFolderPath;
+ }
+
+ /**
+ * Set temp folder path
+ *
+ * @param tempFolderPath Temp folder path
+ * @return a {@link org.openapitools.client.ApiClient} object.
+ */
+ public ApiClient setTempFolderPath(String tempFolderPath) {
+ this.tempFolderPath = tempFolderPath;
+ return this;
+ }
+
+ /**
+ * Connect timeout (in milliseconds).
+ *
+ * @return Connection timeout
+ */
+ public int getConnectTimeout() {
+ return connectionTimeout;
+ }
+
+ /**
+ * Set the connect timeout (in milliseconds).
+ * A value of 0 means no timeout, otherwise values must be between 1 and
+ * {@link Integer#MAX_VALUE}.
+ *
+ * @param connectionTimeout Connection timeout in milliseconds
+ * @return a {@link org.openapitools.client.ApiClient} object.
+ */
+ public ApiClient setConnectTimeout(int connectionTimeout) {
+ this.connectionTimeout = connectionTimeout;
+ httpClient.property(ClientProperties.CONNECT_TIMEOUT, connectionTimeout);
+ return this;
+ }
+
+ /**
+ * read timeout (in milliseconds).
+ *
+ * @return Read timeout
+ */
+ public int getReadTimeout() {
+ return readTimeout;
+ }
+
+ /**
+ * Set the read timeout (in milliseconds).
+ * A value of 0 means no timeout, otherwise values must be between 1 and
+ * {@link Integer#MAX_VALUE}.
+ *
+ * @param readTimeout Read timeout in milliseconds
+ * @return a {@link org.openapitools.client.ApiClient} object.
+ */
+ public ApiClient setReadTimeout(int readTimeout) {
+ this.readTimeout = readTimeout;
+ httpClient.property(ClientProperties.READ_TIMEOUT, readTimeout);
+ return this;
+ }
+
+ /**
+ * Get the date format used to parse/format date parameters.
+ *
+ * @return Date format
+ */
+ public DateFormat getDateFormat() {
+ return dateFormat;
+ }
+
+ /**
+ * Set the date format used to parse/format date parameters.
+ *
+ * @param dateFormat Date format
+ * @return a {@link org.openapitools.client.ApiClient} object.
+ */
+ public ApiClient setDateFormat(DateFormat dateFormat) {
+ this.dateFormat = dateFormat;
+ // also set the date format for model (de)serialization with Date properties
+ this.json.setDateFormat((DateFormat) dateFormat.clone());
+ return this;
+ }
+
+ /**
+ * Parse the given string into Date object.
+ *
+ * @param str String
+ * @return Date
+ */
+ public Date parseDate(String str) {
+ try {
+ return dateFormat.parse(str);
+ } catch (java.text.ParseException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ /**
+ * Format the given Date object into string.
+ *
+ * @param date Date
+ * @return Date in string format
+ */
+ public String formatDate(Date date) {
+ return dateFormat.format(date);
+ }
+
+ /**
+ * Format the given parameter object into string.
+ *
+ * @param param Object
+ * @return Object in string format
+ */
+ public String parameterToString(Object param) {
+ if (param == null) {
+ return "";
+ } else if (param instanceof Date) {
+ return formatDate((Date) param);
+ } else if (param instanceof OffsetDateTime) {
+ return formatOffsetDateTime((OffsetDateTime) param);
+ } else if (param instanceof Collection) {
+ StringBuilder b = new StringBuilder();
+ for(Object o : (Collection)param) {
+ if(b.length() > 0) {
+ b.append(',');
+ }
+ b.append(String.valueOf(o));
+ }
+ return b.toString();
+ } else {
+ return String.valueOf(param);
+ }
+ }
+
+ /*
+ * Format to {@code Pair} objects.
+ *
+ * @param collectionFormat Collection format
+ * @param name Name
+ * @param value Value
+ * @return List of pairs
+ */
+ public List parameterToPairs(String collectionFormat, String name, Object value){
+ List params = new ArrayList();
+
+ // preconditions
+ if (name == null || name.isEmpty() || value == null) return params;
+
+ Collection valueCollection;
+ if (value instanceof Collection) {
+ valueCollection = (Collection) value;
+ } else {
+ params.add(new Pair(name, parameterToString(value)));
+ return params;
+ }
+
+ if (valueCollection.isEmpty()){
+ return params;
+ }
+
+ // get the collection format (default: csv)
+ String format = (collectionFormat == null || collectionFormat.isEmpty() ? "csv" : collectionFormat);
+
+ // create the params based on the collection format
+ if ("multi".equals(format)) {
+ for (Object item : valueCollection) {
+ params.add(new Pair(name, parameterToString(item)));
+ }
+
+ return params;
+ }
+
+ String delimiter = ",";
+
+ if ("csv".equals(format)) {
+ delimiter = ",";
+ } else if ("ssv".equals(format)) {
+ delimiter = " ";
+ } else if ("tsv".equals(format)) {
+ delimiter = "\t";
+ } else if ("pipes".equals(format)) {
+ delimiter = "|";
+ }
+
+ StringBuilder sb = new StringBuilder() ;
+ for (Object item : valueCollection) {
+ sb.append(delimiter);
+ sb.append(parameterToString(item));
+ }
+
+ params.add(new Pair(name, sb.substring(1)));
+
+ return params;
+ }
+
+ /**
+ * Check if the given MIME is a JSON MIME.
+ * JSON MIME examples:
+ * application/json
+ * application/json; charset=UTF8
+ * APPLICATION/JSON
+ * application/vnd.company+json
+ * "* / *" is also default to JSON
+ *
+ * @param mime MIME
+ * @return True if the MIME type is JSON
+ */
+ public boolean isJsonMime(String mime) {
+ String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$";
+ return mime != null && (mime.matches(jsonMime) || mime.equals("*/*"));
+ }
+
+ /**
+ * Select the Accept header's value from the given accepts array:
+ * if JSON exists in the given array, use it;
+ * otherwise use all of them (joining into a string)
+ *
+ * @param accepts The accepts array to select from
+ * @return The Accept header to use. If the given array is empty,
+ * null will be returned (not to set the Accept header explicitly).
+ */
+ public String selectHeaderAccept(String[] accepts) {
+ if (accepts.length == 0) {
+ return null;
+ }
+ for (String accept : accepts) {
+ if (isJsonMime(accept)) {
+ return accept;
+ }
+ }
+ return StringUtil.join(accepts, ",");
+ }
+
+ /**
+ * Select the Content-Type header's value from the given array:
+ * if JSON exists in the given array, use it;
+ * otherwise use the first one of the array.
+ *
+ * @param contentTypes The Content-Type array to select from
+ * @return The Content-Type header to use. If the given array is empty,
+ * JSON will be used.
+ */
+ public String selectHeaderContentType(String[] contentTypes) {
+ if (contentTypes.length == 0) {
+ return "application/json";
+ }
+ for (String contentType : contentTypes) {
+ if (isJsonMime(contentType)) {
+ return contentType;
+ }
+ }
+ return contentTypes[0];
+ }
+
+ /**
+ * Escape the given string to be used as URL query value.
+ *
+ * @param str String
+ * @return Escaped string
+ */
+ public String escapeString(String str) {
+ try {
+ return URLEncoder.encode(str, "utf8").replaceAll("\\+", "%20");
+ } catch (UnsupportedEncodingException e) {
+ return str;
+ }
+ }
+
+ /**
+ * Serialize the given Java object into string entity according the given
+ * Content-Type (only JSON is supported for now).
+ *
+ * @param obj Object
+ * @param formParams Form parameters
+ * @param contentType Context type
+ * @return Entity
+ * @throws ApiException API exception
+ */
+ public Entity> serialize(Object obj, Map formParams, String contentType, boolean isBodyNullable) throws ApiException {
+ Entity> entity;
+ if (contentType.startsWith("multipart/form-data")) {
+ MultiPart multiPart = new MultiPart();
+ for (Entry param: formParams.entrySet()) {
+ if (param.getValue() instanceof File) {
+ File file = (File) param.getValue();
+ FormDataContentDisposition contentDisp = FormDataContentDisposition.name(param.getKey())
+ .fileName(file.getName()).size(file.length()).build();
+ multiPart.bodyPart(new FormDataBodyPart(contentDisp, file, MediaType.APPLICATION_OCTET_STREAM_TYPE));
+ } else {
+ FormDataContentDisposition contentDisp = FormDataContentDisposition.name(param.getKey()).build();
+ multiPart.bodyPart(new FormDataBodyPart(contentDisp, parameterToString(param.getValue())));
+ }
+ }
+ entity = Entity.entity(multiPart, MediaType.MULTIPART_FORM_DATA_TYPE);
+ } else if (contentType.startsWith("application/x-www-form-urlencoded")) {
+ Form form = new Form();
+ for (Entry param: formParams.entrySet()) {
+ form.param(param.getKey(), parameterToString(param.getValue()));
+ }
+ entity = Entity.entity(form, MediaType.APPLICATION_FORM_URLENCODED_TYPE);
+ } else {
+ // We let jersey handle the serialization
+ if (isBodyNullable) { // payload is nullable
+ if (obj instanceof String) {
+ entity = Entity.entity(obj == null ? "null" : "\"" + ((String)obj).replaceAll("\"", Matcher.quoteReplacement("\\\"")) + "\"", contentType);
+ } else {
+ entity = Entity.entity(obj == null ? "null" : obj, contentType);
+ }
+ } else {
+ if (obj instanceof String) {
+ entity = Entity.entity(obj == null ? "" : "\"" + ((String)obj).replaceAll("\"", Matcher.quoteReplacement("\\\"")) + "\"", contentType);
+ } else {
+ entity = Entity.entity(obj == null ? "" : obj, contentType);
+ }
+ }
+ }
+ return entity;
+ }
+
+ /**
+ * Serialize the given Java object into string according the given
+ * Content-Type (only JSON, HTTP form is supported for now).
+ *
+ * @param obj Object
+ * @param formParams Form parameters
+ * @param contentType Context type
+ * @param isBodyNullable True if the body is nullable
+ * @return String
+ * @throws ApiException API exception
+ */
+ public String serializeToString(Object obj, Map formParams, String contentType, boolean isBodyNullable) throws ApiException {
+ try {
+ if (contentType.startsWith("multipart/form-data")) {
+ throw new ApiException("multipart/form-data not yet supported for serializeToString (http signature authentication)");
+ } else if (contentType.startsWith("application/x-www-form-urlencoded")) {
+ String formString = "";
+ for (Entry param : formParams.entrySet()) {
+ formString = param.getKey() + "=" + URLEncoder.encode(parameterToString(param.getValue()), "UTF-8") + "&";
+ }
+
+ if (formString.length() == 0) { // empty string
+ return formString;
+ } else {
+ return formString.substring(0, formString.length() - 1);
+ }
+ } else {
+ if (isBodyNullable) {
+ return obj == null ? "null" : json.getMapper().writeValueAsString(obj);
+ } else {
+ return obj == null ? "" : json.getMapper().writeValueAsString(obj);
+ }
+ }
+ } catch (Exception ex) {
+ throw new ApiException("Failed to perform serializeToString: " + ex.toString());
+ }
+ }
+
+ /**
+ * Deserialize response body to Java object according to the Content-Type.
+ *
+ * @param Type
+ * @param response Response
+ * @param returnType Return type
+ * @return Deserialize object
+ * @throws ApiException API exception
+ */
+ @SuppressWarnings("unchecked")
+ public T deserialize(Response response, GenericType returnType) throws ApiException {
+ if (response == null || returnType == null) {
+ return null;
+ }
+
+ if ("byte[]".equals(returnType.toString())) {
+ // Handle binary response (byte array).
+ return (T) response.readEntity(byte[].class);
+ } else if (returnType.getRawType() == File.class) {
+ // Handle file downloading.
+ T file = (T) downloadFileFromResponse(response);
+ return file;
+ }
+
+ String contentType = null;
+ List contentTypes = response.getHeaders().get("Content-Type");
+ if (contentTypes != null && !contentTypes.isEmpty())
+ contentType = String.valueOf(contentTypes.get(0));
+
+ // read the entity stream multiple times
+ response.bufferEntity();
+
+ return response.readEntity(returnType);
+ }
+
+ /**
+ * 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(Response response) throws ApiException {
+ try {
+ File file = prepareDownloadFile(response);
+ Files.copy(response.readEntity(InputStream.class), file.toPath(), StandardCopyOption.REPLACE_EXISTING);
+ return file;
+ } catch (IOException e) {
+ throw new ApiException(e);
+ }
+ }
+
+ /**
+ * Prepare the file for download from the response.
+ *
+ * @param response a {@link jakarta.ws.rs.core.Response} object.
+ * @return a {@link java.io.File} object.
+ * @throws java.io.IOException if any.
+ */
+ public File prepareDownloadFile(Response response) throws IOException {
+ String filename = null;
+ String contentDisposition = (String) response.getHeaders().getFirst("Content-Disposition");
+ if (contentDisposition != null && !"".equals(contentDisposition)) {
+ // Get filename from the Content-Disposition header.
+ Pattern pattern = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?");
+ Matcher matcher = pattern.matcher(contentDisposition);
+ if (matcher.find())
+ filename = matcher.group(1);
+ }
+
+ String prefix;
+ String suffix = null;
+ if (filename == null) {
+ prefix = "download-";
+ suffix = "";
+ } else {
+ int pos = filename.lastIndexOf('.');
+ if (pos == -1) {
+ prefix = filename + "-";
+ } else {
+ prefix = filename.substring(0, pos) + "-";
+ suffix = filename.substring(pos);
+ }
+ // Files.createTempFile requires the prefix to be at least three characters long
+ if (prefix.length() < 3)
+ prefix = "download-";
+ }
+
+ if (tempFolderPath == null)
+ return Files.createTempFile(prefix, suffix).toFile();
+ else
+ return Files.createTempFile(Paths.get(tempFolderPath), prefix, suffix).toFile();
+ }
+
+ /**
+ * Invoke API by sending HTTP request with the given options.
+ *
+ * @param Type
+ * @param operation The qualified name of the operation
+ * @param path The sub-path of the HTTP URL
+ * @param method The request method, one of "GET", "POST", "PUT", "HEAD" and "DELETE"
+ * @param queryParams The query parameters
+ * @param body The request body object
+ * @param headerParams The header parameters
+ * @param cookieParams The cookie parameters
+ * @param formParams The form parameters
+ * @param accept The request's Accept header
+ * @param contentType The request's Content-Type header
+ * @param authNames The authentications to apply
+ * @param returnType The return type into which to deserialize the response
+ * @param isBodyNullable True if the body is nullable
+ * @return The response body in type of string
+ * @throws ApiException API exception
+ */
+ public