diff --git a/.github/workflows/samples-jaxrs.yaml b/.github/workflows/samples-jaxrs.yaml
index edf847e5917c..283af8b0e94d 100644
--- a/.github/workflows/samples-jaxrs.yaml
+++ b/.github/workflows/samples-jaxrs.yaml
@@ -24,6 +24,7 @@ jobs:
- samples/server/petstore/jaxrs-spec-interface
- samples/server/petstore/jaxrs-spec-interface-response
- samples/server/petstore/jaxrs-spec-oneof-interface
+ - samples/server/petstore/jaxrs-spec-jsonb
- samples/server/petstore/jaxrs-datelib-j8
- samples/server/petstore/jaxrs-resteasy/default
- samples/server/petstore/jaxrs-resteasy/eap
@@ -38,6 +39,10 @@ jobs:
- samples/server/petstore/jaxrs-spec-swagger-annotations
- samples/server/petstore/jaxrs-spec-swagger-v3-annotations-jakarta
- samples/server/petstore/jaxrs-spec-swagger-v3-annotations
+ include:
+ # quarkus-maven-plugin 1.13.x needs Maven Resolver 1.x, which Maven 3.10 no longer ships
+ - sample: samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations
+ mvn: $GITHUB_WORKSPACE/mvnw
steps:
- uses: actions/checkout@v7
- uses: actions/setup-java@v6
@@ -54,4 +59,4 @@ jobs:
key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }}
- name: Build
working-directory: ${{ matrix.sample }}
- run: mvn clean package --no-transfer-progress
+ run: ${{ matrix.mvn || 'mvn' }} clean package --no-transfer-progress
diff --git a/bin/configs/jaxrs-spec-jsonb.yaml b/bin/configs/jaxrs-spec-jsonb.yaml
new file mode 100644
index 000000000000..cd5736859868
--- /dev/null
+++ b/bin/configs/jaxrs-spec-jsonb.yaml
@@ -0,0 +1,12 @@
+generatorName: jaxrs-spec
+outputDir: samples/server/petstore/jaxrs-spec-jsonb
+inputSpec: modules/openapi-generator/src/test/resources/3_0/jaxrs-spec/petstore-with-fake-endpoints-models-for-testing.yaml
+templateDir: modules/openapi-generator/src/main/resources/JavaJaxRS/spec
+additionalProperties:
+ artifactId: jaxrs-spec-jsonb-petstore-server
+ serializationLibrary: jsonb
+ useJakartaEe: "true"
+ serializableModel: "true"
+ hideGenerationTimestamp: "true"
+ implicitHeadersRegex: (api_key|enum_header_string)
+ generateBuilders: "true"
diff --git a/docs/generators/jaxrs-spec.md b/docs/generators/jaxrs-spec.md
index 043c41f24bed..3e1a2f665205 100644
--- a/docs/generators/jaxrs-spec.md
+++ b/docs/generators/jaxrs-spec.md
@@ -47,7 +47,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response. With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
**false**
No changes to the enums are made, this is the default option.
**true**
With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
|false|
|generateBuilders|Whether to generate builders for models| |false|
|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false|
-|generateJsonCreator|Whether to generate @JsonCreator constructor for required properties.| |true|
+|generateJsonCreator|Whether to generate a JSON creator constructor for required properties.| |true|
|generatePom|Whether to generate pom.xml if the file does not already exist.| |true|
|generateRootResources|Whether to generate the root resource and application classes, only useful if interfaceOnly is true.| |true|
|groupId|groupId in generated pom.xml| |org.openapitools|
@@ -75,6 +75,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|scmDeveloperConnection|SCM developer connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git|
|scmUrl|SCM URL in generated pom.xml| |https://github.com/openapitools/openapi-generator|
|serializableModel|boolean - toggle "implements Serializable" for generated models| |false|
+|serializationLibrary|Serialization library used for the generated models. 'jsonb' is only supported by the default library (<default>). With 'jsonb', dateLibrary defaults to 'java8' ('java8-localdatetime' is also supported, 'joda' and 'legacy' are not), openApiNullable is disabled and no type annotations are generated for discriminator/oneOf polymorphism. Models with additionalProperties are generated as subclasses of HashMap without a JSON-B specific mapping, so they are (de)serialized as plain maps: declared properties are not written and are read into map entries instead of their fields. Properties with a null value are omitted, except required nullable properties, which are written as null; JsonbConfig.withNullValues(true) does not change this because the generated @JsonbProperty annotations default to nillable = false. Depending on the JSON-B implementation, enum values inside maps (and, with older implementations, inside lists) may not use the generated enum serializers/deserializers.|
**jsonb**
Use JSON-B as serialization library
**jackson**
Use Jackson as serialization library
|jackson|
|serverPort|The port on which the server should be started| |8080|
|snapshotVersion|Uses a SNAPSHOT version.|
**true**
Use a SnapShot Version
**false**
Use a Release Version
|null|
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true|
diff --git a/modules/openapi-generator/pom.xml b/modules/openapi-generator/pom.xml
index 4959e2530aa2..83152e53eee4 100644
--- a/modules/openapi-generator/pom.xml
+++ b/modules/openapi-generator/pom.xml
@@ -286,6 +286,12 @@
2.10.1test
+
+ org.eclipse
+ yasson
+ 3.0.4
+ test
+ ${swagger-parser-groupid.version}swagger-parser
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaJAXRSCXFCDIServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaJAXRSCXFCDIServerCodegen.java
index b64e836ae598..e2d04d021796 100644
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaJAXRSCXFCDIServerCodegen.java
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaJAXRSCXFCDIServerCodegen.java
@@ -67,6 +67,8 @@ public JavaJAXRSCXFCDIServerCodegen() {
// jspecify support lives in the JavaJaxRS/spec templates; this generator uses its own
// cxf-cdi template directory, so the option would be advertised but have no effect.
removeOption(USE_JSPECIFY);
+ // JSON-B support lives in the JavaJaxRS/spec templates as well; cxf-cdi always uses Jackson.
+ removeOption(CodegenConstants.SERIALIZATION_LIBRARY);
}
@Override
@@ -82,6 +84,7 @@ public void processOpts() {
// then emit imports and package-info for templates this generator does not have.
additionalProperties.remove(USE_JSPECIFY);
setUseJspecify(false);
+ additionalProperties.remove(CodegenConstants.SERIALIZATION_LIBRARY);
super.processOpts();
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaJAXRSSpecServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaJAXRSSpecServerCodegen.java
index e7a8468f4fab..50ef12c57b77 100644
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaJAXRSSpecServerCodegen.java
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaJAXRSSpecServerCodegen.java
@@ -30,6 +30,8 @@
import org.openapitools.codegen.model.ModelMap;
import org.openapitools.codegen.model.ModelsMap;
import org.openapitools.codegen.model.OperationsMap;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import java.io.File;
import java.util.Collection;
@@ -49,6 +51,8 @@
*/
public class JavaJAXRSSpecServerCodegen extends AbstractJavaJAXRSServerCodegen {
+ private final Logger LOGGER = LoggerFactory.getLogger(JavaJAXRSSpecServerCodegen.class);
+
public static final String RETURN_RESPONSE = "returnResponse";
public static final String RETURN_JBOSS_RESPONSE = "returnJBossResponse";
public static final String GENERATE_POM = "generatePom";
@@ -62,6 +66,8 @@ public class JavaJAXRSSpecServerCodegen extends AbstractJavaJAXRSServerCodegen {
public static final String USE_JAKARTA_SECURITY_ANNOTATIONS = "useJakartaSecurityAnnotations";
public static final String USE_ENUM_CASE_INSENSITIVE = "useEnumCaseInsensitive";
public static final String USE_SEALED = "useSealed";
+ public static final String SERIALIZATION_LIBRARY_JACKSON = "jackson";
+ public static final String SERIALIZATION_LIBRARY_JSONB = "jsonb";
public static final String QUARKUS_LIBRARY = "quarkus";
public static final String THORNTAIL_LIBRARY = "thorntail";
@@ -79,6 +85,7 @@ public class JavaJAXRSSpecServerCodegen extends AbstractJavaJAXRSServerCodegen {
private boolean useMicroProfileOpenAPIAnnotations = false;
private boolean useMutiny = false;
private boolean useJakartaSecurityAnnotations = false;
+ private String serializationLibrary = SERIALIZATION_LIBRARY_JACKSON;
@Setter
private boolean useEnumCaseInsensitive = false;
@@ -168,9 +175,16 @@ public JavaJAXRSSpecServerCodegen() {
cliOptions.add(CliOption.newBoolean(SUPPORT_ASYNC, "Wrap responses in CompletionStage type, allowing asynchronous computation (requires JAX-RS 2.1).", supportAsync));
cliOptions.add(CliOption.newBoolean(USE_MUTINY, "Whether to use Smallrye Mutiny instead of CompletionStage for asynchronous computation. Only valid when library is set to quarkus.", useMutiny));
cliOptions.add(CliOption.newBoolean(USE_JAKARTA_SECURITY_ANNOTATIONS, "Whether to generate Jakarta security annotations (@RolesAllowed, @PermitAll). Requires useJakartaEe=true. Currently only supported when library is set to quarkus.", useJakartaSecurityAnnotations));
- cliOptions.add(CliOption.newBoolean(GENERATE_JSON_CREATOR, "Whether to generate @JsonCreator constructor for required properties.", generateJsonCreator));
+ cliOptions.add(CliOption.newBoolean(GENERATE_JSON_CREATOR, "Whether to generate a JSON creator constructor for required properties.", generateJsonCreator));
cliOptions.add(CliOption.newBoolean(USE_ENUM_CASE_INSENSITIVE, "Use `equalsIgnoreCase` when String for enum comparison", useEnumCaseInsensitive));
cliOptions.add(CliOption.newBoolean(USE_SEALED, "Whether to generate sealed model interfaces and classes.", useSealed));
+ CliOption serializationLibraryOption = new CliOption(CodegenConstants.SERIALIZATION_LIBRARY, "Serialization library used for the generated models. 'jsonb' is only supported by the default library (" + DEFAULT_LIBRARY + "). With 'jsonb', dateLibrary defaults to 'java8' ('java8-localdatetime' is also supported, 'joda' and 'legacy' are not), openApiNullable is disabled and no type annotations are generated for discriminator/oneOf polymorphism. Models with additionalProperties are generated as subclasses of HashMap without a JSON-B specific mapping, so they are (de)serialized as plain maps: declared properties are not written and are read into map entries instead of their fields. Properties with a null value are omitted, except required nullable properties, which are written as null; JsonbConfig.withNullValues(true) does not change this because the generated @JsonbProperty annotations default to nillable = false. Depending on the JSON-B implementation, enum values inside maps (and, with older implementations, inside lists) may not use the generated enum serializers/deserializers.")
+ .defaultValue(SERIALIZATION_LIBRARY_JACKSON);
+ Map serializationOptions = new HashMap<>();
+ serializationOptions.put(SERIALIZATION_LIBRARY_JACKSON, "Use Jackson as serialization library");
+ serializationOptions.put(SERIALIZATION_LIBRARY_JSONB, "Use JSON-B as serialization library");
+ serializationLibraryOption.setEnum(serializationOptions);
+ cliOptions.add(serializationLibraryOption);
cliOptions.add(CliOption.newBoolean(USE_JSPECIFY, "Use JSpecify for null checks: @NullMarked package-info and @Nullable on optional properties and parameters.", useJspecify));
}
@@ -233,6 +247,12 @@ public void processOpts() {
artifactId = "openapi-jaxrs-client";
}
+ convertPropertyToStringAndWriteBack(CodegenConstants.SERIALIZATION_LIBRARY, this::setSerializationLibrary);
+ // JSON-B cannot map the Joda types of the legacy default; select java8 before super.processOpts() applies the date type mappings
+ if (isJsonb() && !additionalProperties.containsKey(DATE_LIBRARY) && "legacy".equals(getDateLibrary())) {
+ setDateLibrary("java8");
+ }
+
super.processOpts();
// We need to call super.processOpts() before evaluating the `library`, otherwise `library` is null when set via `configOptions` instead of via `library.set("quarkus")` in Gradle
@@ -247,6 +267,10 @@ public void processOpts() {
+ "is incompatible with the javax.* namespace.");
}
+ if (isJsonb()) {
+ applyJsonbSerialization();
+ }
+
// expose flags to templates
additionalProperties.put(USE_SWAGGER_ANNOTATIONS, useSwaggerAnnotations);
additionalProperties.put(USE_SWAGGER_V3_ANNOTATIONS, useSwaggerV3Annotations);
@@ -342,6 +366,49 @@ public String getName() {
return "jaxrs-spec";
}
+ public String getSerializationLibrary() {
+ return serializationLibrary;
+ }
+
+ public void setSerializationLibrary(String serializationLibrary) {
+ if (SERIALIZATION_LIBRARY_JACKSON.equalsIgnoreCase(serializationLibrary)) {
+ this.serializationLibrary = SERIALIZATION_LIBRARY_JACKSON;
+ } else if (SERIALIZATION_LIBRARY_JSONB.equalsIgnoreCase(serializationLibrary)) {
+ this.serializationLibrary = SERIALIZATION_LIBRARY_JSONB;
+ } else {
+ throw new IllegalArgumentException("Unexpected " + CodegenConstants.SERIALIZATION_LIBRARY + " value: '"
+ + serializationLibrary + "'. Supported values: " + SERIALIZATION_LIBRARY_JACKSON + ", " + SERIALIZATION_LIBRARY_JSONB);
+ }
+ }
+
+ public boolean isJsonb() {
+ return SERIALIZATION_LIBRARY_JSONB.equals(serializationLibrary);
+ }
+
+ private void applyJsonbSerialization() {
+ if (StringUtils.isNotEmpty(library) && !DEFAULT_LIBRARY.equals(library)) {
+ throw new IllegalArgumentException("'" + CodegenConstants.SERIALIZATION_LIBRARY + "=" + SERIALIZATION_LIBRARY_JSONB
+ + "' is only supported by the library '" + DEFAULT_LIBRARY + "', not by '" + library + "'.");
+ }
+ if (!getDateLibrary().startsWith("java8")) {
+ throw new IllegalArgumentException("'" + DATE_LIBRARY + "=" + getDateLibrary() + "' is not supported with '"
+ + CodegenConstants.SERIALIZATION_LIBRARY + "=" + SERIALIZATION_LIBRARY_JSONB + "'. Use 'java8' or 'java8-localdatetime'.");
+ }
+ if (additionalProperties.containsKey(JACKSON) && jackson) {
+ throw new IllegalArgumentException("Flags '" + JACKSON + "=true' and '" + CodegenConstants.SERIALIZATION_LIBRARY + "="
+ + SERIALIZATION_LIBRARY_JSONB + "' are mutually exclusive. Please enable only one.");
+ }
+ if (additionalProperties.containsKey(OPENAPI_NULLABLE) && openApiNullable) {
+ LOGGER.warn("'{}' is not supported with '{}={}' and will be disabled.",
+ OPENAPI_NULLABLE, CodegenConstants.SERIALIZATION_LIBRARY, SERIALIZATION_LIBRARY_JSONB);
+ }
+ setJackson(false);
+ additionalProperties.put(JACKSON, false);
+ setOpenApiNullable(false);
+ additionalProperties.put(OPENAPI_NULLABLE, false);
+ additionalProperties.put(SERIALIZATION_LIBRARY_JSONB, true);
+ }
+
@Override
public CodegenModel fromModel(String name, Schema model) {
CodegenModel codegenModel = super.fromModel(name, model);
@@ -354,6 +421,10 @@ public CodegenModel fromModel(String name, Schema model) {
codegenModel.imports.remove("JsonProperty");
codegenModel.imports.remove("JsonTypeName");
}
+ if (isJsonb() && codegenModel.getAdditionalProperties() != null) {
+ LOGGER.warn("Model '{}' declares additionalProperties and is (de)serialized as a plain map with '{}={}'; declared properties are not mapped to its fields.",
+ codegenModel.name, CodegenConstants.SERIALIZATION_LIBRARY, SERIALIZATION_LIBRARY_JSONB);
+ }
if (useJspecify) {
codegenModel.imports.add("Nullable");
}
diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/additional_properties.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/additional_properties.mustache
index 7f59262156f1..6de25d06ef95 100644
--- a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/additional_properties.mustache
+++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/additional_properties.mustache
@@ -6,7 +6,9 @@
* @param value the value of the property
* @return self reference
*/
+ {{#jackson}}
@JsonAnySetter
+ {{/jackson}}
public {{classname}} putAdditionalProperty(String key, {{{datatypeWithEnum}}} value) {
this.put(key, value);
return this;
@@ -16,7 +18,9 @@
* Return the additional (undeclared) properties.
* @return the additional (undeclared) properties
*/
+ {{#jackson}}
@JsonAnyGetter
+ {{/jackson}}
public Map getAdditionalProperties() {
return this;
}
diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/enumClass.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/enumClass.mustache
index 102fb7fe5f59..eac1c2e685a3 100644
--- a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/enumClass.mustache
+++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/enumClass.mustache
@@ -2,7 +2,9 @@
@XmlType(name="{{datatypeWithEnum}}")
@XmlEnum({{dataType}}.class)
{{/withXml}}
-{{>additionalEnumTypeAnnotations}}public enum {{datatypeWithEnum}} {
+{{#jsonb}}@JsonbTypeSerializer({{datatypeWithEnum}}.Serializer.class)
+ @JsonbTypeDeserializer({{datatypeWithEnum}}.Deserializer.class)
+ {{/jsonb}}{{>additionalEnumTypeAnnotations}}public enum {{datatypeWithEnum}} {
{{#allowableValues}}
{{#enumVars}}{{#withXml}}@XmlEnumValue({{#lambda.javaStringLiteral}}{{{rawValue}}}{{/lambda.javaStringLiteral}}){{/withXml}}{{name}}({{dataType}}.valueOf({{{value}}})){{^-last}}, {{/-last}}{{#-last}};{{/-last}}{{/enumVars}}
@@ -44,6 +46,7 @@
{{#jackson}}
@JsonCreator
+ {{/jackson}}
public static {{datatypeWithEnum}} fromValue({{dataType}} value) {
for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) {
if ({{#isString}}{{#useEnumCaseInsensitive}}b.value{{#dataFormat}}.toString(){{/dataFormat}}.equalsIgnoreCase({{#dataFormat}}value == null ? null : value.toString(){{/dataFormat}}{{^dataFormat}}value{{/dataFormat}}){{/useEnumCaseInsensitive}}{{^useEnumCaseInsensitive}}b.value.equals(value){{/useEnumCaseInsensitive}}{{/isString}}{{^isString}}b.value.equals(value){{/isString}}) {
@@ -52,5 +55,23 @@
}
{{#isNullable}}return null;{{/isNullable}}{{^isNullable}}{{#enumUnknownDefaultCase}}{{#allowableValues}}{{#enumVars}}{{#-last}}return {{{name}}};{{/-last}}{{/enumVars}}{{/allowableValues}}{{/enumUnknownDefaultCase}}{{^enumUnknownDefaultCase}}throw new IllegalArgumentException("Unexpected value '" + value + "'");{{/enumUnknownDefaultCase}}{{/isNullable}}
}
- {{/jackson}}
+ {{#jsonb}}
+
+ public static final class Serializer implements JsonbSerializer<{{datatypeWithEnum}}> {
+ @Override
+ public void serialize({{datatypeWithEnum}} obj, JsonGenerator generator, SerializationContext ctx) {
+ ctx.serialize(obj.value, generator);
+ }
+ }
+
+ public static final class Deserializer implements JsonbDeserializer<{{datatypeWithEnum}}> {
+ @Override
+ public {{datatypeWithEnum}} deserialize(JsonParser parser, DeserializationContext ctx, java.lang.reflect.Type rtType) {
+ if (parser.getValue().getValueType() == {{javaxPackage}}.json.JsonValue.ValueType.NULL) {
+ return null;
+ }
+ return fromValue(ctx.deserialize({{dataType}}.class, parser));
+ }
+ }
+ {{/jsonb}}
}
diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/enumOuterClass.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/enumOuterClass.mustache
index 00c653c5df85..ec920432da58 100644
--- a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/enumOuterClass.mustache
+++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/enumOuterClass.mustache
@@ -2,6 +2,16 @@
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
{{/jackson}}
+{{#jsonb}}
+import {{javaxPackage}}.json.bind.annotation.JsonbTypeDeserializer;
+import {{javaxPackage}}.json.bind.annotation.JsonbTypeSerializer;
+import {{javaxPackage}}.json.bind.serializer.DeserializationContext;
+import {{javaxPackage}}.json.bind.serializer.JsonbDeserializer;
+import {{javaxPackage}}.json.bind.serializer.JsonbSerializer;
+import {{javaxPackage}}.json.bind.serializer.SerializationContext;
+import {{javaxPackage}}.json.stream.JsonGenerator;
+import {{javaxPackage}}.json.stream.JsonParser;
+{{/jsonb}}
/**
* {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}}
@@ -14,7 +24,9 @@ import com.fasterxml.jackson.annotation.JsonValue;
{{#isDeprecated}}
@Deprecated
-{{/isDeprecated}}{{>additionalEnumTypeAnnotations}}public enum {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} {
+{{/isDeprecated}}{{#jsonb}}@JsonbTypeSerializer({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.Serializer.class)
+@JsonbTypeDeserializer({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.Deserializer.class)
+{{/jsonb}}{{>additionalEnumTypeAnnotations}}public enum {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} {
{{#gson}}
{{#allowableValues}}{{#enumVars}}
@SerializedName({{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}{{{value}}}{{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}})
@@ -58,6 +70,7 @@ import com.fasterxml.jackson.annotation.JsonValue;
{{#jackson}}
@JsonCreator
+ {{/jackson}}
public static {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{{dataType}}} value) {
for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) {
if (b.value.equals{{#isString}}{{#useEnumCaseInsensitive}}IgnoreCase{{/useEnumCaseInsensitive}}{{/isString}}(value)) {
@@ -66,5 +79,23 @@ import com.fasterxml.jackson.annotation.JsonValue;
}
{{#isNullable}}return null;{{/isNullable}}{{^isNullable}}{{#enumUnknownDefaultCase}}{{#allowableValues}}{{#enumVars}}{{#-last}}return {{{name}}};{{/-last}}{{/enumVars}}{{/allowableValues}}{{/enumUnknownDefaultCase}}{{^enumUnknownDefaultCase}}throw new IllegalArgumentException("Unexpected value '" + value + "'");{{/enumUnknownDefaultCase}}{{/isNullable}}
}
- {{/jackson}}
+ {{#jsonb}}
+
+ public static final class Serializer implements JsonbSerializer<{{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}> {
+ @Override
+ public void serialize({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} obj, JsonGenerator generator, SerializationContext ctx) {
+ ctx.serialize(obj.value, generator);
+ }
+ }
+
+ public static final class Deserializer implements JsonbDeserializer<{{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}> {
+ @Override
+ public {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} deserialize(JsonParser parser, DeserializationContext ctx, java.lang.reflect.Type rtType) {
+ if (parser.getValue().getValueType() == {{javaxPackage}}.json.JsonValue.ValueType.NULL) {
+ return null;
+ }
+ return fromValue(ctx.deserialize({{{dataType}}}.class, parser));
+ }
+ }
+ {{/jsonb}}
}
diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/pojo.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/pojo.mustache
index 6e4659ee27ca..48b3020c8c59 100644
--- a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/pojo.mustache
+++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/pojo.mustache
@@ -18,6 +18,20 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonFormat;
{{/additionalProperties}}
{{/jackson}}
+{{#jsonb}}
+import {{javaxPackage}}.json.bind.annotation.JsonbCreator;
+import {{javaxPackage}}.json.bind.annotation.JsonbProperty;
+{{#hasEnums}}
+import {{javaxPackage}}.json.bind.annotation.JsonbTypeDeserializer;
+import {{javaxPackage}}.json.bind.annotation.JsonbTypeSerializer;
+import {{javaxPackage}}.json.bind.serializer.DeserializationContext;
+import {{javaxPackage}}.json.bind.serializer.JsonbDeserializer;
+import {{javaxPackage}}.json.bind.serializer.JsonbSerializer;
+import {{javaxPackage}}.json.bind.serializer.SerializationContext;
+import {{javaxPackage}}.json.stream.JsonGenerator;
+import {{javaxPackage}}.json.stream.JsonParser;
+{{/hasEnums}}
+{{/jsonb}}
{{#openApiNullable}}
import org.openapitools.jackson.nullable.JsonNullable;
{{/openApiNullable}}
@@ -121,6 +135,32 @@ public {{>sealed}}class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#v
{{/hasRequired}}
{{/generateJsonCreator}}
{{/jackson}}
+ {{#jsonb}}
+ {{#generateJsonCreator}}
+ {{#hasRequired}}
+ @JsonbCreator
+ public {{classname}}(
+ {{#requiredVars}}
+ @JsonbProperty("{{baseName}}") {{>beanValidatedType}} {{name}}{{^-last}},{{/-last}}
+ {{/requiredVars}}
+ ) {
+ {{#parent}}
+ super(
+ {{#parentRequiredVars}}
+ {{name}}{{^-last}},{{/-last}}
+ {{/parentRequiredVars}}
+ );
+ {{/parent}}
+ {{#vars}}
+ {{#required}}
+ this.{{name}} = {{name}};
+ {{/required}}
+ {{/vars}}
+ }
+
+ {{/hasRequired}}
+ {{/generateJsonCreator}}
+ {{/jsonb}}
{{#vars}}
/**
{{#description}}
@@ -162,7 +202,7 @@ public {{>sealed}}class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#v
@ApiModelProperty({{#example}}example = "{{{.}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}"){{/useSwaggerAnnotations}}{{#useSwaggerV3Annotations}}
@Schema({{#example}}example = "{{{.}}}", {{/example}}{{#required}}requiredMode = Schema.RequiredMode.REQUIRED, {{/required}}description = "{{{description}}}"{{#deprecated}}, deprecated = true{{/deprecated}}){{/useSwaggerV3Annotations}}{{#useMicroProfileOpenAPIAnnotations}}
@org.eclipse.microprofile.openapi.annotations.media.Schema({{#example}}example = "{{{.}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}description = "{{{description}}}"{{#deprecated}}, deprecated = true{{/deprecated}}){{/useMicroProfileOpenAPIAnnotations}}
- {{#jackson}}@JsonProperty({{#required}}required = {{required}}, value = {{/required}}"{{baseName}}"){{/jackson}}
+ {{#jackson}}@JsonProperty({{#required}}required = {{required}}, value = {{/required}}"{{baseName}}"){{/jackson}}{{#jsonb}}@JsonbProperty({{#required}}{{#isNullable}}value = {{/isNullable}}{{/required}}"{{baseName}}"{{#required}}{{#isNullable}}, nillable = true{{/isNullable}}{{/required}}){{/jsonb}}
{{#vendorExtensions.x-is-jackson-optional-nullable}}
public JsonNullable<{{{datatypeWithEnum}}}> {{getter}}() {
return {{name}};
@@ -183,6 +223,9 @@ public {{>sealed}}class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#v
{{#jackson}}
@JsonProperty({{#required}}required = {{required}}, value = {{/required}}"{{baseName}}")
{{/jackson}}
+ {{#jsonb}}
+ @JsonbProperty("{{baseName}}")
+ {{/jsonb}}
{{#vendorExtensions.x-setter-extra-annotation}}{{{vendorExtensions.x-setter-extra-annotation}}}
{{/vendorExtensions.x-setter-extra-annotation}}public void {{setter}}({{#useJspecify}}{{>nullable_var_annotations}}{{/useJspecify}}{{>nullableDatatypeWithEnum}} {{name}}) {
{{#vendorExtensions.x-is-jackson-optional-nullable}}
diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/pom.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/pom.mustache
index a7095c1cf76a..36533f59519d 100644
--- a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/pom.mustache
+++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/pom.mustache
@@ -78,6 +78,7 @@
${jakarta.ws.rs-version}provided
+ {{^jsonb}}
com.fasterxml.jackson.datatypejackson-datatype-jsr310
@@ -97,11 +98,44 @@
${jackson-version}
{{/useJakartaEe}}
+ {{/jsonb}}
+ {{#jsonb}}
+ {{#useJakartaEe}}
+
+ jakarta.json
+ jakarta.json-api
+ ${json-api-version}
+ provided
+
+
+ jakarta.json.bind
+ jakarta.json.bind-api
+ ${json-bind-api-version}
+ provided
+
+ {{/useJakartaEe}}
+ {{^useJakartaEe}}
+
+ javax.json
+ javax.json-api
+ ${json-api-version}
+ provided
+
+
+ javax.json.bind
+ javax.json.bind-api
+ ${json-bind-api-version}
+ provided
+
+ {{/useJakartaEe}}
+ {{/jsonb}}
+ {{^jsonb}}
joda-timejoda-time${joda-version}
+ {{/jsonb}}
{{#useJakartaEe}}
jakarta.annotation
@@ -197,9 +231,17 @@
${java.version}${java.version}UTF-8
+ {{^jsonb}}
2.21.6
+ {{/jsonb}}
+ {{#jsonb}}
+ {{#useJakartaEe}}2.1.3{{/useJakartaEe}}{{^useJakartaEe}}1.1.4{{/useJakartaEe}}
+ {{#useJakartaEe}}3.0.1{{/useJakartaEe}}{{^useJakartaEe}}1.0{{/useJakartaEe}}
+ {{/jsonb}}
5.14.4
+ {{^jsonb}}
2.10.13
+ {{/jsonb}}
{{#useJakartaEe}}
2.1.1
{{/useJakartaEe}}
diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jaxrs/JavaJAXRSCXFCDIServerCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jaxrs/JavaJAXRSCXFCDIServerCodegenTest.java
index 33731edb6520..01e27d826727 100644
--- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jaxrs/JavaJAXRSCXFCDIServerCodegenTest.java
+++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jaxrs/JavaJAXRSCXFCDIServerCodegenTest.java
@@ -5,10 +5,13 @@
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.parser.core.models.ParseOptions;
import org.openapitools.codegen.ClientOptInput;
+import org.openapitools.codegen.CodegenConstants;
import org.openapitools.codegen.DefaultGenerator;
import org.openapitools.codegen.java.assertions.JavaFileAssert;
import org.openapitools.codegen.languages.JavaJAXRSCXFCDIServerCodegen;
+import org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen;
import org.openapitools.codegen.languages.features.CXFServerFeatures;
+import org.testng.Assert;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
@@ -96,4 +99,13 @@ public void testHandleDefaultValue_issue8535() throws Exception {
.assertParameterAnnotations()
.containsWithNameAndAttributes("ApiParam", ImmutableMap.of("defaultValue", "\"true\""));
}
+
+ @Test
+ public void testSerializationLibraryIsIgnored() {
+ codegen.additionalProperties().put(CodegenConstants.SERIALIZATION_LIBRARY, JavaJAXRSSpecServerCodegen.SERIALIZATION_LIBRARY_JSONB);
+ codegen.processOpts();
+
+ Assert.assertTrue(codegen.isJackson());
+ Assert.assertFalse(codegen.additionalProperties().containsKey(JavaJAXRSSpecServerCodegen.SERIALIZATION_LIBRARY_JSONB));
+ }
}
diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jaxrs/JavaJAXRSSpecJsonbEnumNullTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jaxrs/JavaJAXRSSpecJsonbEnumNullTest.java
new file mode 100644
index 000000000000..e8e43af6651f
--- /dev/null
+++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jaxrs/JavaJAXRSSpecJsonbEnumNullTest.java
@@ -0,0 +1,252 @@
+/*
+ * Copyright 2026 OpenAPI-Generator Contributors (https://openapi-generator.tech)
+ *
+ * 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
+ *
+ * http://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.
+ */
+package org.openapitools.codegen.java.jaxrs;
+
+import com.github.javaparser.StaticJavaParser;
+import com.github.javaparser.ast.CompilationUnit;
+import com.github.javaparser.ast.Node;
+import com.github.javaparser.ast.body.EnumDeclaration;
+import com.github.javaparser.ast.expr.AnnotationExpr;
+import jakarta.json.bind.Jsonb;
+import jakarta.json.bind.JsonbBuilder;
+import jakarta.json.bind.JsonbException;
+import jakarta.json.stream.JsonParser;
+import org.openapitools.codegen.CodegenConstants;
+import org.openapitools.codegen.DefaultGenerator;
+import org.openapitools.codegen.config.CodegenConfigurator;
+import org.openapitools.codegen.languages.AbstractJavaJAXRSServerCodegen;
+import org.testng.annotations.DataProvider;
+import org.testng.annotations.Test;
+
+import javax.tools.ToolProvider;
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.nio.charset.StandardCharsets;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+import static org.openapitools.codegen.TestUtils.newTempFolder;
+import static org.testng.Assert.*;
+
+/**
+ * Runtime regression test for the jaxrs-spec JSON-B enum (de)serializers: the generated enums are compiled and used
+ * with a real JSON-B implementation, covering both enum templates (inline {@code enumClass} and {@code enumOuterClass}).
+ */
+public class JavaJAXRSSpecJsonbEnumNullTest {
+
+ @Test
+ public void testJsonbEnumDeserializersAcceptExplicitNull() throws Exception {
+ Path output = newTempFolder();
+ CodegenConfigurator configurator = new CodegenConfigurator()
+ .setGeneratorName("jaxrs-spec")
+ .setValidateSpec(false)
+ .setInputSpec("src/test/resources/3_0/jaxrs-spec/petstore-with-fake-endpoints-models-for-testing.yaml")
+ .setOutputDir(output.toString())
+ .addGlobalProperty("models", "")
+ .addGlobalProperty("modelDocs", "false")
+ .addGlobalProperty("modelTests", "false")
+ .addAdditionalProperty(CodegenConstants.SERIALIZATION_LIBRARY, "jsonb")
+ .addAdditionalProperty(AbstractJavaJAXRSServerCodegen.USE_JAKARTA_EE, true);
+ List files = new DefaultGenerator().opts(configurator.toClientOptInput()).generate();
+
+ // Compile the generated enums exactly as generated (including their JSON-B (de)serializers); only the
+ // unrelated enclosing model classes are replaced by minimal holders with a single enum property.
+ Path runtime = Files.createDirectory(output.resolve("runtime"));
+ String imports = "import jakarta.json.bind.annotation.*;\n"
+ + "import jakarta.json.bind.serializer.*;\n"
+ + "import jakarta.json.stream.*;\n"
+ + "import java.lang.reflect.Type;\n";
+ Files.writeString(runtime.resolve("PetHolder.java"), imports
+ + "public class PetHolder {\n"
+ + " public StatusEnum status;\n"
+ + enumDeclaration(files, "Pet.java", "StatusEnum") + "\n}\n");
+ Files.writeString(runtime.resolve("OuterEnum.java"), imports + enumDeclaration(files, "OuterEnum.java", "OuterEnum"));
+ Files.writeString(runtime.resolve("OuterEnumInteger.java"), imports + enumDeclaration(files, "OuterEnumInteger.java", "OuterEnumInteger"));
+ Files.writeString(runtime.resolve("OuterHolder.java"), "public class OuterHolder {\n"
+ + " public OuterEnum outerEnum;\n"
+ + " public OuterEnumInteger outerEnumInteger;\n"
+ + "}\n");
+ compile(runtime);
+
+ try (URLClassLoader loader = new URLClassLoader(new URL[]{runtime.toUri().toURL()}, getClass().getClassLoader());
+ Jsonb jsonb = JsonbBuilder.create()) {
+ Class> petHolder = loader.loadClass("PetHolder");
+ Class> outerHolder = loader.loadClass("OuterHolder");
+
+ // current non-null behavior: the enum wire values
+ Object pet = jsonb.fromJson("{\"status\":\"available\"}", petHolder);
+ assertEquals(String.valueOf(petHolder.getField("status").get(pet)), "available");
+ assertEquals(jsonb.toJson(pet), "{\"status\":\"available\"}");
+ Object outer = jsonb.fromJson("{\"outerEnum\":\"approved\",\"outerEnumInteger\":1}", outerHolder);
+ assertEquals(String.valueOf(outerHolder.getField("outerEnum").get(outer)), "approved");
+ assertEquals(String.valueOf(outerHolder.getField("outerEnumInteger").get(outer)), "1");
+
+ // explicit JSON null must deserialize to null for both enum templates
+ assertNull(petHolder.getField("status").get(jsonb.fromJson("{\"status\":null}", petHolder)));
+ Object nullOuter = jsonb.fromJson("{\"outerEnum\":null,\"outerEnumInteger\":null}", outerHolder);
+ assertNull(outerHolder.getField("outerEnum").get(nullOuter));
+ assertNull(outerHolder.getField("outerEnumInteger").get(nullOuter));
+ }
+ }
+
+ @Test
+ public void testJsonbEnumsCompileNextToSchemaNamedType() throws Exception {
+ // the generated top-level enum 'Type' and the model with an inline enum that references it
+ Path runtime = compileGeneratedModels("src/test/resources/3_0/jaxrs-spec/jsonb-enum-named-type.yaml", Map.of(),
+ "Type.java", "TypeHolder.java");
+
+ try (URLClassLoader loader = new URLClassLoader(new URL[]{runtime.toUri().toURL()}, getClass().getClassLoader());
+ Jsonb jsonb = JsonbBuilder.create()) {
+ Class> holder = loader.loadClass("org.openapitools.model.TypeHolder");
+ String json = "{\"kind\":\"beta\",\"status\":\"pending\"}";
+ assertEquals(jsonb.toJson(jsonb.fromJson(json, holder)), json);
+ }
+ }
+
+ @DataProvider
+ public Object[][] enumOptions() {
+ return new Object[][]{{false, false}, {true, false}, {false, true}, {true, true}};
+ }
+
+ /**
+ * The JSON-B deserializers must resolve values like the generated {@code fromValue} (used by Jackson), so that
+ * {@code useEnumCaseInsensitive} and {@code enumUnknownDefaultCase} apply to top-level, inline and list item enums.
+ */
+ @Test(dataProvider = "enumOptions")
+ public void testJsonbEnumDeserializersUseFromValueOptions(boolean caseInsensitive, boolean unknownDefault) throws Exception {
+ Path runtime = compileGeneratedModels("src/test/resources/3_0/jaxrs-spec/jsonb-enum-options.yaml",
+ Map.of("useEnumCaseInsensitive", caseInsensitive, "enumUnknownDefaultCase", unknownDefault),
+ "StringEnum.java", "IntegerEnum.java", "NumberEnum.java", "EnumHolder.java");
+ String otherCase = caseInsensitive ? "AVAILABLE" : unknownDefault ? "UNKNOWN_DEFAULT_OPEN_API" : "rejected";
+ String unknown = unknownDefault ? "UNKNOWN_DEFAULT_OPEN_API" : "rejected";
+ String unknownNumber = unknownDefault ? "NUMBER_unknown_default_open_api" : "rejected";
+
+ try (URLClassLoader loader = new URLClassLoader(new URL[]{runtime.toUri().toURL()}, getClass().getClassLoader());
+ Jsonb jsonb = JsonbBuilder.create()) {
+ Class> holder = loader.loadClass("org.openapitools.model.EnumHolder");
+ for (String property : List.of("top", "inline")) {
+ assertEquals(read(jsonb, holder, property, "\"available\""), "AVAILABLE", property);
+ assertEquals(read(jsonb, holder, property, "\"AVAILABLE\""), otherCase, property);
+ assertEquals(read(jsonb, holder, property, "\"unknown\""), unknown, property);
+ assertEquals(read(jsonb, holder, property, "null"), "null", property);
+ }
+ for (String property : List.of("topInteger", "inlineInteger")) {
+ assertEquals(read(jsonb, holder, property, "2"), "NUMBER_2", property);
+ assertEquals(read(jsonb, holder, property, "9"), unknownNumber, property);
+ assertEquals(read(jsonb, holder, property, "null"), "null", property);
+ }
+ assertEquals(read(jsonb, holder, "topNumber", "-2.25"), "NUMBER_MINUS_2_DOT_25");
+ assertEquals(read(jsonb, holder, "topNumber", "9"), unknownNumber);
+ assertEquals(read(jsonb, holder, "topNumber", "null"), "null");
+ assertEquals(read(jsonb, holder, "list", "[\"pending\",null]"), "[PENDING, null]");
+ assertEquals(read(jsonb, holder, "list", "[\"AVAILABLE\"]"), otherCase.equals("rejected") ? "rejected" : "[" + otherCase + "]");
+ assertEquals(read(jsonb, holder, "list", "[\"unknown\"]"), unknown.equals("rejected") ? "rejected" : "[" + unknown + "]");
+
+ // values are still written as their wire values
+ Object values = jsonb.fromJson("{\"inline\":\"pending\",\"inlineInteger\":1,\"list\":[\"available\"],\"top\":\"pending\","
+ + "\"topInteger\":2,\"topNumber\":1.5}", holder);
+ assertEquals(jsonb.toJson(values), "{\"inline\":\"pending\",\"inlineInteger\":1,\"list\":[\"available\"],\"top\":\"pending\","
+ + "\"topInteger\":2,\"topNumber\":1.5}");
+ }
+ }
+
+ /** The enum constant(s) read into the given property, or "rejected" if JSON-B fails to deserialize the value. */
+ private static String read(Jsonb jsonb, Class> holder, String property, String jsonValue) throws Exception {
+ Object instance;
+ try {
+ instance = jsonb.fromJson("{\"" + property + "\":" + jsonValue + "}", holder);
+ } catch (JsonbException e) {
+ return "rejected";
+ }
+ Object value = holder.getMethod("get" + Character.toUpperCase(property.charAt(0)) + property.substring(1)).invoke(instance);
+ if (value instanceof List) {
+ return ((List>) value).stream().map(e -> e == null ? "null" : ((Enum>) e).name()).collect(Collectors.toList()).toString();
+ }
+ return value == null ? "null" : ((Enum>) value).name();
+ }
+
+ /**
+ * Generates the jaxrs-spec JSON-B models of the given spec and compiles the given model files as generated; only
+ * {@code @Generated} is dropped (jakarta.annotation is not on the test classpath).
+ */
+ private static Path compileGeneratedModels(String spec, Map properties, String... fileNames) throws Exception {
+ Path output = newTempFolder();
+ CodegenConfigurator configurator = new CodegenConfigurator()
+ .setGeneratorName("jaxrs-spec")
+ .setValidateSpec(false)
+ .setInputSpec(spec)
+ .setOutputDir(output.toString())
+ .addGlobalProperty("models", "")
+ .addGlobalProperty("modelDocs", "false")
+ .addGlobalProperty("modelTests", "false")
+ .addAdditionalProperty(CodegenConstants.SERIALIZATION_LIBRARY, "jsonb")
+ .addAdditionalProperty(AbstractJavaJAXRSServerCodegen.USE_JAKARTA_EE, true)
+ .addAdditionalProperty("useBeanValidation", false)
+ .addAdditionalProperty("useSwaggerAnnotations", false);
+ properties.forEach(configurator::addAdditionalProperty);
+ List files = new DefaultGenerator().opts(configurator.toClientOptInput()).generate();
+
+ Path runtime = Files.createDirectory(output.resolve("runtime"));
+ for (String fileName : fileNames) {
+ File file = files.stream().filter(f -> f.getName().equals(fileName)).findFirst()
+ .orElseThrow(() -> new AssertionError(fileName + " was not generated"));
+ CompilationUnit unit = StaticJavaParser.parse(file);
+ unit.findAll(AnnotationExpr.class).stream()
+ .filter(annotation -> annotation.getNameAsString().endsWith("Generated"))
+ .forEach(Node::remove);
+ Files.writeString(runtime.resolve(fileName), unit.toString());
+ }
+ compile(runtime);
+ return runtime;
+ }
+
+ /** The generated enum declaration with its JSON-B annotations; other annotations (e.g. @Generated) are dropped. */
+ private static String enumDeclaration(List files, String fileName, String enumName) throws Exception {
+ File file = files.stream().filter(f -> f.getName().equals(fileName)).findFirst()
+ .orElseThrow(() -> new AssertionError(fileName + " was not generated"));
+ CompilationUnit unit = StaticJavaParser.parse(file);
+ EnumDeclaration declaration = unit.findAll(EnumDeclaration.class).stream()
+ .filter(d -> d.getNameAsString().equals(enumName))
+ .findFirst().orElseThrow(() -> new AssertionError(enumName + " was not generated in " + fileName));
+ declaration.getAnnotations().removeIf(a -> !a.getNameAsString().startsWith("Jsonb"));
+ return declaration.toString();
+ }
+
+ private static void compile(Path runtime) throws Exception {
+ // the JSON-B and JSON-P API jars are enough to compile the generated (de)serializers
+ String classpath = jarOf(Jsonb.class) + File.pathSeparator + jarOf(JsonParser.class);
+ List args = new ArrayList<>(List.of("-classpath", classpath, "-d", runtime.toString()));
+ try (Stream sources = Files.list(runtime)) {
+ sources.filter(p -> p.toString().endsWith(".java")).map(Path::toString).forEach(args::add);
+ }
+ ByteArrayOutputStream diagnostics = new ByteArrayOutputStream();
+ assertNotNull(ToolProvider.getSystemJavaCompiler(), "Runtime regression tests require a JDK");
+ int result = ToolProvider.getSystemJavaCompiler().run(null, diagnostics, diagnostics, args.toArray(new String[0]));
+ assertEquals(result, 0, diagnostics.toString(StandardCharsets.UTF_8));
+ }
+
+ private static String jarOf(Class> type) throws Exception {
+ return Paths.get(type.getProtectionDomain().getCodeSource().getLocation().toURI()).toString();
+ }
+}
diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jaxrs/JavaJAXRSSpecJsonbNullablePropertiesTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jaxrs/JavaJAXRSSpecJsonbNullablePropertiesTest.java
new file mode 100644
index 000000000000..5ae4f14921bf
--- /dev/null
+++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jaxrs/JavaJAXRSSpecJsonbNullablePropertiesTest.java
@@ -0,0 +1,155 @@
+/*
+ * Copyright 2026 OpenAPI-Generator Contributors (https://openapi-generator.tech)
+ *
+ * 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
+ *
+ * http://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.
+ */
+package org.openapitools.codegen.java.jaxrs;
+
+import com.github.javaparser.StaticJavaParser;
+import com.github.javaparser.ast.CompilationUnit;
+import com.github.javaparser.ast.Node;
+import com.github.javaparser.ast.expr.AnnotationExpr;
+import jakarta.json.Json;
+import jakarta.json.JsonObject;
+import jakarta.json.bind.Jsonb;
+import jakarta.json.bind.JsonbBuilder;
+import jakarta.json.stream.JsonParser;
+import org.openapitools.codegen.CodegenConstants;
+import org.openapitools.codegen.DefaultGenerator;
+import org.openapitools.codegen.config.CodegenConfigurator;
+import org.openapitools.codegen.languages.AbstractJavaJAXRSServerCodegen;
+import org.testng.annotations.DataProvider;
+import org.testng.annotations.Test;
+
+import javax.tools.ToolProvider;
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.StringReader;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.nio.charset.StandardCharsets;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.List;
+
+import static org.openapitools.codegen.TestUtils.assertFileContains;
+import static org.openapitools.codegen.TestUtils.assertFileNotContains;
+import static org.openapitools.codegen.TestUtils.newTempFolder;
+import static org.testng.Assert.*;
+
+/**
+ * Runtime regression test for null handling of the jaxrs-spec JSON-B models: a property that is both required and
+ * nullable must be serialized as JSON {@code null}, while optional or non-nullable properties keep the JSON-B default
+ * (omitted when null).
+ */
+public class JavaJAXRSSpecJsonbNullablePropertiesTest {
+
+ private static final String MODEL_PACKAGE = "org.openapitools.model";
+
+ @DataProvider
+ public Object[][] specs() {
+ return new Object[][]{
+ {"src/test/resources/3_0/jaxrs-spec/jsonb-nullable-properties.yaml"},
+ {"src/test/resources/3_1/jaxrs-spec/jsonb-nullable-properties.yaml"}
+ };
+ }
+
+ @Test(dataProvider = "specs")
+ public void testRequiredNullablePropertyIsSerializedAsNull(String spec) throws Exception {
+ Path output = newTempFolder();
+ File model = generateModel(spec, output, true);
+
+ // Compile the generated model as is; only @Generated is dropped (jakarta.annotation is not on the test classpath).
+ Path runtime = Files.createDirectory(output.resolve("runtime"));
+ CompilationUnit unit = StaticJavaParser.parse(model);
+ unit.findAll(AnnotationExpr.class).stream()
+ .filter(annotation -> annotation.getNameAsString().endsWith("Generated"))
+ .forEach(Node::remove);
+ Path source = runtime.resolve("NullableProperties.java");
+ Files.writeString(source, unit.toString());
+ compile(runtime, source);
+
+ try (URLClassLoader loader = new URLClassLoader(new URL[]{runtime.toUri().toURL()}, getClass().getClassLoader());
+ Jsonb jsonb = JsonbBuilder.create()) {
+ Class> type = loader.loadClass(MODEL_PACKAGE + ".NullableProperties");
+
+ // all properties null: only the required nullable property is written (as JSON null)
+ assertEquals(jsonb.toJson(type.getConstructor().newInstance()), "{\"requiredNullable\":null}");
+ Object nulls = jsonb.fromJson("{\"requiredValue\":null,\"optionalValue\":null,\"requiredNullable\":null,"
+ + "\"optionalNullable\":null,\"snake_case_value\":null}", type);
+ assertEquals(jsonb.toJson(nulls), "{\"requiredNullable\":null}");
+
+ // non-null values, including the renamed property, are read and written unchanged
+ String json = "{\"optionalNullable\":\"d\",\"optionalValue\":\"b\",\"requiredNullable\":\"c\","
+ + "\"requiredValue\":\"a\",\"snake_case_value\":\"e\"}";
+ Object values = jsonb.fromJson(json, type);
+ assertEquals(type.getMethod("getRequiredValue").invoke(values), "a");
+ assertEquals(type.getMethod("getOptionalValue").invoke(values), "b");
+ assertEquals(type.getMethod("getRequiredNullable").invoke(values), "c");
+ assertEquals(type.getMethod("getOptionalNullable").invoke(values), "d");
+ assertEquals(type.getMethod("getSnakeCaseValue").invoke(values), "e");
+ assertEquals(parse(jsonb.toJson(values)), parse(json));
+ }
+ }
+
+ @Test
+ public void testJavaxRequiredNullablePropertyIsNillable() throws Exception {
+ File model = generateModel("src/test/resources/3_0/jaxrs-spec/jsonb-nullable-properties.yaml", newTempFolder(), false);
+
+ assertFileContains(model.toPath(),
+ "@JsonbProperty(value = \"requiredNullable\", nillable = true)\n public String getRequiredNullable()",
+ "@JsonbProperty(\"requiredNullable\")\n public void setRequiredNullable(",
+ "@JsonbProperty(\"optionalNullable\")\n public String getOptionalNullable()",
+ "@JsonbProperty(\"requiredValue\")\n public String getRequiredValue()");
+ assertFileNotContains(model.toPath(),
+ "@JsonbProperty(value = \"optionalNullable\", nillable = true)",
+ "@JsonbProperty(value = \"requiredValue\", nillable = true)");
+ }
+
+ private static File generateModel(String spec, Path output, boolean useJakartaEe) {
+ CodegenConfigurator configurator = new CodegenConfigurator()
+ .setGeneratorName("jaxrs-spec")
+ .setValidateSpec(false)
+ .setInputSpec(spec)
+ .setOutputDir(output.toString())
+ .addGlobalProperty("models", "")
+ .addGlobalProperty("modelDocs", "false")
+ .addGlobalProperty("modelTests", "false")
+ .addAdditionalProperty(CodegenConstants.SERIALIZATION_LIBRARY, "jsonb")
+ .addAdditionalProperty(AbstractJavaJAXRSServerCodegen.USE_JAKARTA_EE, useJakartaEe)
+ .addAdditionalProperty("useBeanValidation", false)
+ .addAdditionalProperty("useSwaggerAnnotations", false);
+ List files = new DefaultGenerator().opts(configurator.toClientOptInput()).generate();
+ return files.stream().filter(file -> file.getName().equals("NullableProperties.java")).findFirst()
+ .orElseThrow(() -> new AssertionError("NullableProperties.java was not generated"));
+ }
+
+ private static void compile(Path runtime, Path source) throws Exception {
+ // the JSON-B and JSON-P API jars are enough to compile the generated model
+ String classpath = jarOf(Jsonb.class) + File.pathSeparator + jarOf(JsonParser.class);
+ ByteArrayOutputStream diagnostics = new ByteArrayOutputStream();
+ assertNotNull(ToolProvider.getSystemJavaCompiler(), "Runtime regression tests require a JDK");
+ int result = ToolProvider.getSystemJavaCompiler().run(null, diagnostics, diagnostics,
+ "-classpath", classpath, "-d", runtime.toString(), source.toString());
+ assertEquals(result, 0, diagnostics.toString(StandardCharsets.UTF_8));
+ }
+
+ private static String jarOf(Class> type) throws Exception {
+ return Paths.get(type.getProtectionDomain().getCodeSource().getLocation().toURI()).toString();
+ }
+
+ private static JsonObject parse(String json) {
+ return Json.createReader(new StringReader(json)).readObject();
+ }
+}
diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jaxrs/JavaJAXRSSpecServerCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jaxrs/JavaJAXRSSpecServerCodegenTest.java
index 879132b927e2..529d415baad8 100644
--- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jaxrs/JavaJAXRSSpecServerCodegenTest.java
+++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jaxrs/JavaJAXRSSpecServerCodegenTest.java
@@ -2761,4 +2761,194 @@ public void testUseJspecifyIsDisabledForCxfCdi() throws Exception {
}
}
+ private Path generateWithSerializationLibrary(Map properties) throws IOException {
+ File output = Files.createTempDirectory("test").toFile();
+ output.deleteOnExit();
+
+ final CodegenConfigurator configurator = new CodegenConfigurator()
+ .setGeneratorName("jaxrs-spec")
+ .setAdditionalProperties(properties)
+ .setValidateSpec(false)
+ .setInputSpec("src/test/resources/3_0/jaxrs-spec/petstore-with-fake-endpoints-models-for-testing.yaml")
+ .setOutputDir(output.getAbsolutePath().replace("\\", "/"));
+
+ new DefaultGenerator().opts(configurator.toClientOptInput()).generate();
+ return output.toPath();
+ }
+
+ @Test
+ public void testSerializationLibraryDefaultsToJackson() throws Exception {
+ Path output = generateWithSerializationLibrary(new HashMap<>());
+
+ Path pet = output.resolve("src/gen/java/org/openapitools/model/Pet.java");
+ assertFileContains(pet, "import com.fasterxml.jackson.annotation.JsonProperty;", "@JsonProperty(\"id\")");
+ assertFileNotContains(pet, "Jsonb");
+ assertFileNotContains(output.resolve("pom.xml"), "json.bind-api");
+ }
+
+ @Test
+ public void testSerializationLibraryJsonbWithJakartaEe() throws Exception {
+ Map properties = new HashMap<>();
+ properties.put(CodegenConstants.SERIALIZATION_LIBRARY, SERIALIZATION_LIBRARY_JSONB);
+ properties.put(AbstractJavaJAXRSServerCodegen.USE_JAKARTA_EE, true);
+ Path output = generateWithSerializationLibrary(properties);
+
+ Path pet = output.resolve("src/gen/java/org/openapitools/model/Pet.java");
+ assertFileContains(pet,
+ "import jakarta.json.bind.annotation.JsonbProperty;",
+ "@JsonbProperty(\"id\")",
+ "@JsonbCreator",
+ "@JsonbProperty(\"name\") String name",
+ "@JsonbTypeSerializer(StatusEnum.Serializer.class)",
+ "@JsonbTypeDeserializer(StatusEnum.Deserializer.class)",
+ "ctx.serialize(obj.value, generator);");
+ assertFileNotContains(pet, "com.fasterxml.jackson", "JsonNullable", "@JsonTypeName");
+
+ Path outerEnum = output.resolve("src/gen/java/org/openapitools/model/OuterEnumInteger.java");
+ assertFileContains(outerEnum,
+ "@JsonbTypeSerializer(OuterEnumInteger.Serializer.class)",
+ "implements JsonbDeserializer");
+ assertFileNotContains(outerEnum, "com.fasterxml.jackson");
+
+ Path pom = output.resolve("pom.xml");
+ assertFileContains(pom, "jakarta.json.bind-api", "jakarta.json-api");
+ assertFileNotContains(pom, "com.fasterxml.jackson", "jackson-databind-nullable", "joda-time");
+ }
+
+ @Test
+ public void testSerializationLibraryJsonbKeepsEnumFromValue() throws Exception {
+ Map properties = new HashMap<>();
+ properties.put(CodegenConstants.SERIALIZATION_LIBRARY, SERIALIZATION_LIBRARY_JSONB);
+ properties.put(AbstractJavaJAXRSServerCodegen.USE_JAKARTA_EE, true);
+ Path output = generateWithSerializationLibrary(properties);
+
+ Path pet = output.resolve("src/gen/java/org/openapitools/model/Pet.java");
+ assertFileContains(pet, "public static StatusEnum fromValue(String value) {");
+ assertFileNotContains(pet, "@JsonCreator");
+
+ Path outerEnum = output.resolve("src/gen/java/org/openapitools/model/OuterEnum.java");
+ assertFileContains(outerEnum, "public static OuterEnum fromValue(String value) {");
+ assertFileNotContains(outerEnum, "@JsonCreator");
+ }
+
+ @Test
+ public void testSerializationLibraryJsonbWithJavax() throws Exception {
+ Map properties = new HashMap<>();
+ properties.put(CodegenConstants.SERIALIZATION_LIBRARY, SERIALIZATION_LIBRARY_JSONB);
+ Path output = generateWithSerializationLibrary(properties);
+
+ assertFileContains(output.resolve("src/gen/java/org/openapitools/model/Pet.java"),
+ "import javax.json.bind.annotation.JsonbProperty;", "import javax.json.stream.JsonParser;");
+ assertFileContains(output.resolve("pom.xml"), "javax.json.bind-api");
+ }
+
+ @Test
+ public void testSerializationLibraryJsonbDisablesJacksonAndOpenApiNullable() {
+ codegen.additionalProperties().put(CodegenConstants.SERIALIZATION_LIBRARY, "JsonB");
+ codegen.processOpts();
+
+ JavaJAXRSSpecServerCodegen jaxrsCodegen = (JavaJAXRSSpecServerCodegen) codegen;
+ Assert.assertEquals(jaxrsCodegen.getSerializationLibrary(), SERIALIZATION_LIBRARY_JSONB);
+ Assert.assertFalse(jaxrsCodegen.isJackson());
+ Assert.assertFalse(jaxrsCodegen.isOpenApiNullable());
+ Assert.assertEquals(codegen.additionalProperties().get(SERIALIZATION_LIBRARY_JSONB), true);
+ Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.OPENAPI_NULLABLE), false);
+ }
+
+ @Test(expectedExceptions = IllegalArgumentException.class,
+ expectedExceptionsMessageRegExp = "Unexpected serializationLibrary value: 'gson'.*")
+ public void testSerializationLibraryRejectsUnknownValue() {
+ codegen.additionalProperties().put(CodegenConstants.SERIALIZATION_LIBRARY, "gson");
+ codegen.processOpts();
+ }
+
+ @Test(expectedExceptions = IllegalArgumentException.class,
+ expectedExceptionsMessageRegExp = ".*only supported by the library '', not by 'quarkus'.*")
+ public void testSerializationLibraryJsonbRejectsNonDefaultLibrary() {
+ codegen.setLibrary(QUARKUS_LIBRARY);
+ codegen.additionalProperties().put(CodegenConstants.SERIALIZATION_LIBRARY, SERIALIZATION_LIBRARY_JSONB);
+ codegen.processOpts();
+ }
+
+ @Test(expectedExceptions = IllegalArgumentException.class,
+ expectedExceptionsMessageRegExp = ".*mutually exclusive.*")
+ public void testSerializationLibraryJsonbRejectsExplicitJackson() {
+ codegen.additionalProperties().put(CodegenConstants.SERIALIZATION_LIBRARY, SERIALIZATION_LIBRARY_JSONB);
+ codegen.additionalProperties().put(AbstractJavaJAXRSServerCodegen.JACKSON, true);
+ codegen.processOpts();
+ }
+
+ @DataProvider
+ public Object[][] jsonbJava8DateLibraries() {
+ return new Object[][]{
+ {null, "OffsetDateTime"},
+ {"java8", "OffsetDateTime"},
+ {"java8-localdatetime", "LocalDateTime"}
+ };
+ }
+
+ @Test(dataProvider = "jsonbJava8DateLibraries")
+ public void testSerializationLibraryJsonbUsesJava8Dates(String dateLibrary, String dateTimeType) throws Exception {
+ Map properties = new HashMap<>();
+ properties.put(CodegenConstants.SERIALIZATION_LIBRARY, SERIALIZATION_LIBRARY_JSONB);
+ properties.put(AbstractJavaJAXRSServerCodegen.USE_JAKARTA_EE, true);
+ if (dateLibrary != null) {
+ properties.put(AbstractJavaJAXRSServerCodegen.DATE_LIBRARY, dateLibrary);
+ }
+ Path formatTest = generateWithSerializationLibrary(properties).resolve("src/gen/java/org/openapitools/model/FormatTest.java");
+
+ assertFileContains(formatTest,
+ "import java.time.LocalDate;", "private LocalDate date;",
+ "import java.time." + dateTimeType + ";", "private " + dateTimeType + " dateTime;");
+ assertFileNotContains(formatTest, "org.joda.time", "java.util.Date");
+ }
+
+ @DataProvider
+ public Object[][] jsonbUnsupportedDateLibraries() {
+ return new Object[][]{{"joda"}, {"legacy"}};
+ }
+
+ @Test(dataProvider = "jsonbUnsupportedDateLibraries", expectedExceptions = IllegalArgumentException.class,
+ expectedExceptionsMessageRegExp = "'dateLibrary=(joda|legacy)' is not supported with 'serializationLibrary=jsonb'.*")
+ public void testSerializationLibraryJsonbRejectsUnsupportedDateLibrary(String dateLibrary) {
+ codegen.additionalProperties().put(CodegenConstants.SERIALIZATION_LIBRARY, SERIALIZATION_LIBRARY_JSONB);
+ codegen.additionalProperties().put(AbstractJavaJAXRSServerCodegen.DATE_LIBRARY, dateLibrary);
+ codegen.processOpts();
+ }
+
+ @Test
+ public void testSerializationLibraryJsonbKeepsDateLibraryFromSetter() {
+ codegen.setDateLibrary("java8-localdatetime");
+ codegen.additionalProperties().put(CodegenConstants.SERIALIZATION_LIBRARY, SERIALIZATION_LIBRARY_JSONB);
+ codegen.processOpts();
+
+ Assert.assertEquals(codegen.getDateLibrary(), "java8-localdatetime");
+ }
+
+ @Test(expectedExceptions = IllegalArgumentException.class,
+ expectedExceptionsMessageRegExp = "'dateLibrary=joda' is not supported with 'serializationLibrary=jsonb'.*")
+ public void testSerializationLibraryJsonbRejectsUnsupportedDateLibraryFromSetter() {
+ codegen.setDateLibrary("joda");
+ codegen.additionalProperties().put(CodegenConstants.SERIALIZATION_LIBRARY, SERIALIZATION_LIBRARY_JSONB);
+ codegen.processOpts();
+ }
+
+ @DataProvider
+ public Object[][] jacksonSerializationLibraries() {
+ return new Object[][]{{null}, {SERIALIZATION_LIBRARY_JACKSON}};
+ }
+
+ @Test(dataProvider = "jacksonSerializationLibraries")
+ public void testSerializationLibraryJacksonKeepsLegacyDates(String serializationLibrary) throws Exception {
+ Map properties = new HashMap<>();
+ if (serializationLibrary != null) {
+ properties.put(CodegenConstants.SERIALIZATION_LIBRARY, serializationLibrary);
+ }
+ Path formatTest = generateWithSerializationLibrary(properties).resolve("src/gen/java/org/openapitools/model/FormatTest.java");
+
+ assertFileContains(formatTest,
+ "import org.joda.time.LocalDate;", "private LocalDate date;",
+ "import java.util.Date;", "private Date dateTime;");
+ }
+
}
diff --git a/modules/openapi-generator/src/test/resources/3_0/jaxrs-spec/jsonb-enum-named-type.yaml b/modules/openapi-generator/src/test/resources/3_0/jaxrs-spec/jsonb-enum-named-type.yaml
new file mode 100644
index 000000000000..491e376c14f4
--- /dev/null
+++ b/modules/openapi-generator/src/test/resources/3_0/jaxrs-spec/jsonb-enum-named-type.yaml
@@ -0,0 +1,23 @@
+openapi: 3.0.3
+info:
+ title: JSON-B enum named Type
+ description: A top-level enum and a model with an inline enum, both next to a schema named Type.
+ version: 1.0.0
+paths: {}
+components:
+ schemas:
+ Type:
+ type: string
+ enum:
+ - alpha
+ - beta
+ TypeHolder:
+ type: object
+ properties:
+ kind:
+ $ref: '#/components/schemas/Type'
+ status:
+ type: string
+ enum:
+ - available
+ - pending
diff --git a/modules/openapi-generator/src/test/resources/3_0/jaxrs-spec/jsonb-enum-options.yaml b/modules/openapi-generator/src/test/resources/3_0/jaxrs-spec/jsonb-enum-options.yaml
new file mode 100644
index 000000000000..407723825e70
--- /dev/null
+++ b/modules/openapi-generator/src/test/resources/3_0/jaxrs-spec/jsonb-enum-options.yaml
@@ -0,0 +1,49 @@
+openapi: 3.0.3
+info:
+ title: JSON-B enum deserialization options
+ description: String, integer and number enums (top-level, inline and as list items) for useEnumCaseInsensitive and enumUnknownDefaultCase.
+ version: 1.0.0
+paths: {}
+components:
+ schemas:
+ StringEnum:
+ type: string
+ enum:
+ - available
+ - pending
+ IntegerEnum:
+ type: integer
+ enum:
+ - 1
+ - 2
+ NumberEnum:
+ type: number
+ enum:
+ - 1.5
+ - -2.25
+ EnumHolder:
+ type: object
+ properties:
+ top:
+ $ref: '#/components/schemas/StringEnum'
+ topInteger:
+ $ref: '#/components/schemas/IntegerEnum'
+ topNumber:
+ $ref: '#/components/schemas/NumberEnum'
+ inline:
+ type: string
+ enum:
+ - available
+ - pending
+ inlineInteger:
+ type: integer
+ enum:
+ - 1
+ - 2
+ list:
+ type: array
+ items:
+ type: string
+ enum:
+ - available
+ - pending
diff --git a/modules/openapi-generator/src/test/resources/3_0/jaxrs-spec/jsonb-nullable-properties.yaml b/modules/openapi-generator/src/test/resources/3_0/jaxrs-spec/jsonb-nullable-properties.yaml
new file mode 100644
index 000000000000..cbce4c38d86d
--- /dev/null
+++ b/modules/openapi-generator/src/test/resources/3_0/jaxrs-spec/jsonb-nullable-properties.yaml
@@ -0,0 +1,26 @@
+openapi: 3.0.3
+info:
+ title: JSON-B nullable properties
+ description: Required/optional and nullable/non-nullable properties for the jaxrs-spec JSON-B serialization.
+ version: 1.0.0
+paths: {}
+components:
+ schemas:
+ NullableProperties:
+ type: object
+ required:
+ - requiredValue
+ - requiredNullable
+ properties:
+ requiredValue:
+ type: string
+ optionalValue:
+ type: string
+ requiredNullable:
+ type: string
+ nullable: true
+ optionalNullable:
+ type: string
+ nullable: true
+ snake_case_value:
+ type: string
diff --git a/modules/openapi-generator/src/test/resources/3_1/jaxrs-spec/jsonb-nullable-properties.yaml b/modules/openapi-generator/src/test/resources/3_1/jaxrs-spec/jsonb-nullable-properties.yaml
new file mode 100644
index 000000000000..a0a4448a119d
--- /dev/null
+++ b/modules/openapi-generator/src/test/resources/3_1/jaxrs-spec/jsonb-nullable-properties.yaml
@@ -0,0 +1,28 @@
+openapi: 3.1.0
+info:
+ title: JSON-B nullable properties
+ description: Required/optional and nullable/non-nullable properties for the jaxrs-spec JSON-B serialization.
+ version: 1.0.0
+paths: {}
+components:
+ schemas:
+ NullableProperties:
+ type: object
+ required:
+ - requiredValue
+ - requiredNullable
+ properties:
+ requiredValue:
+ type: string
+ optionalValue:
+ type: string
+ requiredNullable:
+ type:
+ - string
+ - "null"
+ optionalNullable:
+ type:
+ - string
+ - "null"
+ snake_case_value:
+ type: string
diff --git a/samples/server/petstore/jaxrs-spec-jsonb/.openapi-generator-ignore b/samples/server/petstore/jaxrs-spec-jsonb/.openapi-generator-ignore
new file mode 100644
index 000000000000..7484ee590a38
--- /dev/null
+++ b/samples/server/petstore/jaxrs-spec-jsonb/.openapi-generator-ignore
@@ -0,0 +1,23 @@
+# OpenAPI Generator Ignore
+# Generated by openapi-generator https://github.com/openapitools/openapi-generator
+
+# Use this file to prevent files from being overwritten by the generator.
+# The patterns follow closely to .gitignore or .dockerignore.
+
+# As an example, the C# client generator defines ApiClient.cs.
+# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
+#ApiClient.cs
+
+# You can match any string of characters against a directory, file or extension with a single asterisk (*):
+#foo/*/qux
+# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
+
+# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
+#foo/**/qux
+# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
+
+# You can also negate patterns with an exclamation (!).
+# For example, you can ignore all files in a docs folder with the file extension .md:
+#docs/*.md
+# Then explicitly reverse the ignore rule for a single file:
+#!docs/README.md
diff --git a/samples/server/petstore/jaxrs-spec-jsonb/.openapi-generator/FILES b/samples/server/petstore/jaxrs-spec-jsonb/.openapi-generator/FILES
new file mode 100644
index 000000000000..7155b1df8e89
--- /dev/null
+++ b/samples/server/petstore/jaxrs-spec-jsonb/.openapi-generator/FILES
@@ -0,0 +1,65 @@
+README.md
+pom.xml
+src/gen/java/org/openapitools/api/AnotherFakeApi.java
+src/gen/java/org/openapitools/api/FakeApi.java
+src/gen/java/org/openapitools/api/FakeClassnameTestApi.java
+src/gen/java/org/openapitools/api/FooApi.java
+src/gen/java/org/openapitools/api/PetApi.java
+src/gen/java/org/openapitools/api/RestApplication.java
+src/gen/java/org/openapitools/api/RestResourceRoot.java
+src/gen/java/org/openapitools/api/StoreApi.java
+src/gen/java/org/openapitools/api/UserApi.java
+src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java
+src/gen/java/org/openapitools/model/AllOfWithSingleRef.java
+src/gen/java/org/openapitools/model/Animal.java
+src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java
+src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java
+src/gen/java/org/openapitools/model/ArrayTest.java
+src/gen/java/org/openapitools/model/Capitalization.java
+src/gen/java/org/openapitools/model/Cat.java
+src/gen/java/org/openapitools/model/Category.java
+src/gen/java/org/openapitools/model/ChildWithNullable.java
+src/gen/java/org/openapitools/model/ClassModel.java
+src/gen/java/org/openapitools/model/Client.java
+src/gen/java/org/openapitools/model/DeprecatedObject.java
+src/gen/java/org/openapitools/model/Dog.java
+src/gen/java/org/openapitools/model/EnumArrays.java
+src/gen/java/org/openapitools/model/EnumClass.java
+src/gen/java/org/openapitools/model/EnumTest.java
+src/gen/java/org/openapitools/model/FakeBigDecimalMap200Response.java
+src/gen/java/org/openapitools/model/FakeTestsDefaultsDefaultResponse.java
+src/gen/java/org/openapitools/model/FileSchemaTestClass.java
+src/gen/java/org/openapitools/model/Foo.java
+src/gen/java/org/openapitools/model/FooGetDefaultResponse.java
+src/gen/java/org/openapitools/model/FormatTest.java
+src/gen/java/org/openapitools/model/HasOnlyReadOnly.java
+src/gen/java/org/openapitools/model/HealthCheckResult.java
+src/gen/java/org/openapitools/model/IntegerEnum.java
+src/gen/java/org/openapitools/model/MapTest.java
+src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java
+src/gen/java/org/openapitools/model/Model200Response.java
+src/gen/java/org/openapitools/model/ModelApiResponse.java
+src/gen/java/org/openapitools/model/ModelFile.java
+src/gen/java/org/openapitools/model/ModelList.java
+src/gen/java/org/openapitools/model/ModelReturn.java
+src/gen/java/org/openapitools/model/Name.java
+src/gen/java/org/openapitools/model/NullableClass.java
+src/gen/java/org/openapitools/model/NumberOnly.java
+src/gen/java/org/openapitools/model/ObjectWithDeprecatedFields.java
+src/gen/java/org/openapitools/model/Order.java
+src/gen/java/org/openapitools/model/OuterComposite.java
+src/gen/java/org/openapitools/model/OuterEnum.java
+src/gen/java/org/openapitools/model/OuterEnumDefaultValue.java
+src/gen/java/org/openapitools/model/OuterEnumInteger.java
+src/gen/java/org/openapitools/model/OuterEnumIntegerDefaultValue.java
+src/gen/java/org/openapitools/model/OuterObjectWithEnumProperty.java
+src/gen/java/org/openapitools/model/ParentWithNullable.java
+src/gen/java/org/openapitools/model/Pet.java
+src/gen/java/org/openapitools/model/ReadOnlyFirst.java
+src/gen/java/org/openapitools/model/SingleRefType.java
+src/gen/java/org/openapitools/model/SpecialModelName.java
+src/gen/java/org/openapitools/model/StringEnum.java
+src/gen/java/org/openapitools/model/Tag.java
+src/gen/java/org/openapitools/model/TestInlineFreeformAdditionalPropertiesRequest.java
+src/gen/java/org/openapitools/model/User.java
+src/main/openapi/openapi.yaml
diff --git a/samples/server/petstore/jaxrs-spec-jsonb/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-spec-jsonb/.openapi-generator/VERSION
new file mode 100644
index 000000000000..56fe0e8b297f
--- /dev/null
+++ b/samples/server/petstore/jaxrs-spec-jsonb/.openapi-generator/VERSION
@@ -0,0 +1 @@
+7.27.0-SNAPSHOT
diff --git a/samples/server/petstore/jaxrs-spec-jsonb/README.md b/samples/server/petstore/jaxrs-spec-jsonb/README.md
new file mode 100644
index 000000000000..da90cb71c166
--- /dev/null
+++ b/samples/server/petstore/jaxrs-spec-jsonb/README.md
@@ -0,0 +1,27 @@
+# JAX-RS server with OpenAPI
+
+## Overview
+This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using an
+[OpenAPI-Spec](https://openapis.org), you can easily generate a server stub.
+
+This is an example of building a OpenAPI-enabled JAX-RS server.
+This example uses the [JAX-RS](https://jax-rs-spec.java.net/) framework.
+
+
+The JAX-RS implementation needs to be provided by the application server you are deploying on.
+
+To run the server from the command line, you can use maven to provision and start a TomEE Server.
+Please execute the following:
+
+```
+mvn -Dtomee-embedded-plugin.http=80 package org.apache.tomee.maven:tomee-embedded-maven-plugin:7.0.5:run
+```
+
+You can then call your server endpoints under:
+
+```
+http://localhost:80/v2/
+```
+
+Note that if you have configured the `host` to be something other than localhost, the calls through
+swagger-ui will be directed to that host and not localhost!
diff --git a/samples/server/petstore/jaxrs-spec-jsonb/pom.xml b/samples/server/petstore/jaxrs-spec-jsonb/pom.xml
new file mode 100644
index 000000000000..9b7be0b12ea0
--- /dev/null
+++ b/samples/server/petstore/jaxrs-spec-jsonb/pom.xml
@@ -0,0 +1,140 @@
+
+ 4.0.0
+ org.openapitools
+ jaxrs-spec-jsonb-petstore-server
+ war
+ jaxrs-spec-jsonb-petstore-server
+ 1.0.0
+
+
+
+ src/main/java
+
+
+ org.codehaus.mojo
+ build-helper-maven-plugin
+ 1.9.1
+
+
+ add-source
+ generate-sources
+
+ add-source
+
+
+
+ src/gen/java
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-war-plugin
+ 3.1.0
+
+ false
+
+
+
+ maven-surefire-plugin
+ 3.5.6
+
+
+ maven-failsafe-plugin
+ 3.5.6
+
+
+
+ integration-test
+ verify
+
+
+
+
+
+
+
+
+ jakarta.ws.rs
+ jakarta.ws.rs-api
+ ${jakarta.ws.rs-version}
+ provided
+
+
+ jakarta.json
+ jakarta.json-api
+ ${json-api-version}
+ provided
+
+
+ jakarta.json.bind
+ jakarta.json.bind-api
+ ${json-bind-api-version}
+ provided
+
+
+ jakarta.annotation
+ jakarta.annotation-api
+ ${javax.annotation-api-version}
+
+
+ io.swagger
+ swagger-annotations
+ provided
+ 1.5.3
+
+
+
+ com.google.code.findbugs
+ jsr305
+ 3.0.2
+
+
+ org.junit.jupiter
+ junit-jupiter-engine
+ ${junit-version}
+ test
+
+
+ org.testng
+ testng
+ 6.8.8
+ test
+
+
+ junit
+ junit
+
+
+ snakeyaml
+ org.yaml
+
+
+ bsh
+ org.beanshell
+
+
+
+
+
+ jakarta.validation
+ jakarta.validation-api
+ ${beanvalidation-version}
+ provided
+
+
+
+ 1.8
+ ${java.version}
+ ${java.version}
+ UTF-8
+ 2.1.3
+ 3.0.1
+ 5.14.4
+ 2.1.1
+ 3.0.2
+ 3.1.0
+
+
diff --git a/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/api/AnotherFakeApi.java
new file mode 100644
index 000000000000..c095d91be289
--- /dev/null
+++ b/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/api/AnotherFakeApi.java
@@ -0,0 +1,35 @@
+package org.openapitools.api;
+
+import org.openapitools.model.Client;
+
+import jakarta.ws.rs.*;
+import jakarta.ws.rs.core.Response;
+
+import io.swagger.annotations.*;
+
+import java.io.InputStream;
+import java.util.Map;
+import java.util.List;
+import jakarta.validation.constraints.*;
+import jakarta.validation.Valid;
+
+/**
+* Represents a collection of functions to interact with the API endpoints.
+*/
+@Path("/another-fake/dummy")
+@Api(description = "the another-fake API")
+@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 7.27.0-SNAPSHOT")
+public class AnotherFakeApi {
+
+ @PATCH
+ @Consumes({ "application/json" })
+ @Produces({ "application/json" })
+ @ApiOperation(value = "To test special tags", notes = "To test special tags and operation ID starting with number", response = Client.class, tags={ "$another-fake?" })
+ @ApiResponses(value = {
+ @ApiResponse(code = 200, message = "successful operation", response = Client.class)
+ })
+ public Response call123testSpecialTags(@Valid @NotNull Client client
+) {
+ return Response.ok().entity("magic!").build();
+ }
+}
diff --git a/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/api/FakeApi.java
new file mode 100644
index 000000000000..4be386215dbe
--- /dev/null
+++ b/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/api/FakeApi.java
@@ -0,0 +1,381 @@
+package org.openapitools.api;
+
+import java.math.BigDecimal;
+import org.openapitools.model.ChildWithNullable;
+import org.openapitools.model.Client;
+import org.openapitools.model.EnumClass;
+import org.openapitools.model.FakeBigDecimalMap200Response;
+import org.openapitools.model.FakeTestsDefaultsDefaultResponse;
+import java.io.File;
+import org.openapitools.model.FileSchemaTestClass;
+import org.openapitools.model.HealthCheckResult;
+import java.time.LocalDate;
+import java.util.Map;
+import org.openapitools.model.ModelApiResponse;
+import java.time.OffsetDateTime;
+import org.openapitools.model.OuterComposite;
+import org.openapitools.model.OuterObjectWithEnumProperty;
+import org.openapitools.model.Pet;
+import org.openapitools.model.TestInlineFreeformAdditionalPropertiesRequest;
+import org.openapitools.model.User;
+
+import jakarta.ws.rs.*;
+import jakarta.ws.rs.core.Response;
+
+import io.swagger.annotations.*;
+
+import java.io.InputStream;
+import java.util.Map;
+import java.util.List;
+import jakarta.validation.constraints.*;
+import jakarta.validation.Valid;
+
+/**
+* Represents a collection of functions to interact with the API endpoints.
+*/
+@Path("/fake")
+@Api(description = "the fake API")
+@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 7.27.0-SNAPSHOT")
+public class FakeApi {
+
+ @GET
+ @Path("/BigDecimalMap")
+ @Produces({ "*/*" })
+ @ApiOperation(value = "", notes = "for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys", response = FakeBigDecimalMap200Response.class, tags={ "fake" })
+ @ApiResponses(value = {
+ @ApiResponse(code = 200, message = "successful operation", response = FakeBigDecimalMap200Response.class)
+ })
+ public Response fakeBigDecimalMap() {
+ return Response.ok().entity("magic!").build();
+ }
+
+ @GET
+ @Path("/health")
+ @Produces({ "application/json" })
+ @ApiOperation(value = "Health check endpoint", notes = "", response = HealthCheckResult.class, tags={ "fake" })
+ @ApiResponses(value = {
+ @ApiResponse(code = 200, message = "The instance started successfully", response = HealthCheckResult.class)
+ })
+ public Response fakeHealthGet() {
+ return Response.ok().entity("magic!").build();
+ }
+
+ @GET
+ @Path("/http-signature-test")
+ @Consumes({ "application/json", "application/xml" })
+ @ApiOperation(value = "test http signature authentication", notes = "", response = Void.class, authorizations = {
+
+ @Authorization(value = "http_signature_test")
+ }, tags={ "fake" })
+ @ApiResponses(value = {
+ @ApiResponse(code = 200, message = "The instance started successfully", response = Void.class)
+ })
+ public Response fakeHttpSignatureTest(@Valid @NotNull Pet pet
+,@QueryParam("query_1") @ApiParam("query parameter") String query1
+,@HeaderParam("header_1") @ApiParam("header parameter") String header1
+) {
+ return Response.ok().entity("magic!").build();
+ }
+
+ @POST
+ @Path("/outer/boolean")
+ @Consumes({ "application/json" })
+ @Produces({ "*/*" })
+ @ApiOperation(value = "", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake" })
+ @ApiResponses(value = {
+ @ApiResponse(code = 200, message = "Output boolean", response = Boolean.class)
+ })
+ public Response fakeOuterBooleanSerialize(@Valid Boolean body
+) {
+ return Response.ok().entity("magic!").build();
+ }
+
+ @POST
+ @Path("/outer/composite")
+ @Consumes({ "application/json" })
+ @Produces({ "*/*" })
+ @ApiOperation(value = "", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake" })
+ @ApiResponses(value = {
+ @ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class)
+ })
+ public Response fakeOuterCompositeSerialize(@Valid OuterComposite outerComposite
+) {
+ return Response.ok().entity("magic!").build();
+ }
+
+ @POST
+ @Path("/outer/number")
+ @Consumes({ "application/json" })
+ @Produces({ "*/*" })
+ @ApiOperation(value = "", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake" })
+ @ApiResponses(value = {
+ @ApiResponse(code = 200, message = "Output number", response = BigDecimal.class)
+ })
+ public Response fakeOuterNumberSerialize(@Valid BigDecimal body
+) {
+ return Response.ok().entity("magic!").build();
+ }
+
+ @POST
+ @Path("/outer/string")
+ @Consumes({ "application/json" })
+ @Produces({ "*/*" })
+ @ApiOperation(value = "", notes = "Test serialization of outer string types", response = String.class, tags={ "fake" })
+ @ApiResponses(value = {
+ @ApiResponse(code = 200, message = "Output string", response = String.class)
+ })
+ public Response fakeOuterStringSerialize(@Valid String body
+) {
+ return Response.ok().entity("magic!").build();
+ }
+
+ @POST
+ @Path("/property/enum-int")
+ @Consumes({ "application/json" })
+ @Produces({ "*/*" })
+ @ApiOperation(value = "", notes = "Test serialization of enum (int) properties with examples", response = OuterObjectWithEnumProperty.class, tags={ "fake" })
+ @ApiResponses(value = {
+ @ApiResponse(code = 200, message = "Output enum (int)", response = OuterObjectWithEnumProperty.class)
+ })
+ public Response fakePropertyEnumIntegerSerialize(@Valid @NotNull OuterObjectWithEnumProperty outerObjectWithEnumProperty
+) {
+ return Response.ok().entity("magic!").build();
+ }
+
+ @GET
+ @Path("/tests/defaults")
+ @Produces({ "application/json" })
+ @ApiOperation(value = "test enum default in request body", notes = "", response = FakeTestsDefaultsDefaultResponse.class, tags={ "fake" })
+ @ApiResponses(value = {
+ @ApiResponse(code = 200, message = "response", response = FakeTestsDefaultsDefaultResponse.class)
+ })
+ public Response fakeTestsDefaults() {
+ return Response.ok().entity("magic!").build();
+ }
+
+ @POST
+ @Path("/additionalProperties-reference")
+ @Consumes({ "application/json" })
+ @ApiOperation(value = "test referenced additionalProperties", notes = "", response = Void.class, tags={ "fake" })
+ @ApiResponses(value = {
+ @ApiResponse(code = 200, message = "successful operation", response = Void.class)
+ })
+ public Response testAdditionalPropertiesReference(@NotNull Map requestBody
+) {
+ return Response.ok().entity("magic!").build();
+ }
+
+ @PUT
+ @Path("/body-with-binary")
+ @Consumes({ "image/png" })
+ @ApiOperation(value = "", notes = "For this test, the body has to be a binary file.", response = Void.class, tags={ "fake" })
+ @ApiResponses(value = {
+ @ApiResponse(code = 200, message = "Success", response = Void.class)
+ })
+ public Response testBodyWithBinary(@Valid File body
+) {
+ return Response.ok().entity("magic!").build();
+ }
+
+ @PUT
+ @Path("/body-with-file-schema")
+ @Consumes({ "application/json" })
+ @ApiOperation(value = "", notes = "For this test, the body for this request must reference a schema named `File`.", response = Void.class, tags={ "fake" })
+ @ApiResponses(value = {
+ @ApiResponse(code = 200, message = "Success", response = Void.class)
+ })
+ public Response testBodyWithFileSchema(@Valid @NotNull FileSchemaTestClass fileSchemaTestClass
+) {
+ return Response.ok().entity("magic!").build();
+ }
+
+ @PUT
+ @Path("/body-with-query-params")
+ @Consumes({ "application/json" })
+ @ApiOperation(value = "", notes = "", response = Void.class, tags={ "fake" })
+ @ApiResponses(value = {
+ @ApiResponse(code = 200, message = "Success", response = Void.class)
+ })
+ public Response testBodyWithQueryParams(@QueryParam("query") @NotNull String query
+,@Valid @NotNull User user
+) {
+ return Response.ok().entity("magic!").build();
+ }
+
+ @PATCH
+ @Consumes({ "application/json" })
+ @Produces({ "application/json" })
+ @ApiOperation(value = "To test \"client\" model", notes = "To test \"client\" model", response = Client.class, tags={ "fake" })
+ @ApiResponses(value = {
+ @ApiResponse(code = 200, message = "successful operation", response = Client.class)
+ })
+ public Response testClientModel(@Valid @NotNull Client client
+) {
+ return Response.ok().entity("magic!").build();
+ }
+
+ @POST
+ @Consumes({ "application/x-www-form-urlencoded" })
+ @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", response = Void.class, authorizations = {
+
+ @Authorization(value = "http_basic_test")
+ }, tags={ "fake" })
+ @ApiResponses(value = {
+ @ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class),
+ @ApiResponse(code = 404, message = "User not found", response = Void.class)
+ })
+ public Response testEndpointParameters(
+@FormParam(value = "number") BigDecimal number,
+@FormParam(value = "double") Double _double,
+@FormParam(value = "pattern_without_delimiter") String patternWithoutDelimiter,
+@FormParam(value = "byte") byte[] _byte,
+@FormParam(value = "integer") Integer integer,
+@FormParam(value = "int32") Integer int32,
+@FormParam(value = "int64") Long int64,
+@FormParam(value = "float") Float _float,
+@FormParam(value = "string") String string,
+@FormParam(value = "binary") InputStream binaryInputStream,
+@FormParam(value = "date") LocalDate date,
+@FormParam(value = "dateTime") OffsetDateTime dateTime,
+@FormParam(value = "password") String password,
+@FormParam(value = "callback") String paramCallback) {
+ return Response.ok().entity("magic!").build();
+ }
+
+ @GET
+ @Consumes({ "application/x-www-form-urlencoded" })
+ @ApiOperation(value = "To test enum parameters", notes = "To test enum parameters", response = Void.class, tags={ "fake" })
+ @io.swagger.annotations.ApiImplicitParams({
+ @io.swagger.annotations.ApiImplicitParam(name = "enum_header_string", value = "Header parameter enum test (string)", dataType = "String", paramType = "header")
+ })
+ @ApiResponses(value = {
+ @ApiResponse(code = 400, message = "Invalid request", response = Void.class),
+ @ApiResponse(code = 404, message = "Not found", response = Void.class)
+ })
+ public Response testEnumParameters(@HeaderParam("enum_header_string_array") @ApiParam("Header parameter enum test (string array)") List enumHeaderStringArray
+,@QueryParam("enum_query_string_array") @ApiParam("Query parameter enum test (string array)") List enumQueryStringArray
+,@QueryParam("enum_query_string") @DefaultValue("-efg") @ApiParam("Query parameter enum test (string)") String enumQueryString
+,@QueryParam("enum_query_integer") @ApiParam("Query parameter enum test (double)") Integer enumQueryInteger
+,@QueryParam("enum_query_double") @ApiParam("Query parameter enum test (double)") Double enumQueryDouble
+,@QueryParam("enum_query_model_array") List enumQueryModelArray
+,
+@FormParam(value = "enum_form_string_array") List enumFormStringArray,
+@FormParam(value = "enum_form_string") String enumFormString) {
+ return Response.ok().entity("magic!").build();
+ }
+
+ @DELETE
+ @ApiOperation(value = "Fake endpoint to test group parameters (optional)", notes = "Fake endpoint to test group parameters (optional)", response = Void.class, authorizations = {
+
+ @Authorization(value = "bearer_test")
+ }, tags={ "fake" })
+ @ApiResponses(value = {
+ @ApiResponse(code = 400, message = "Something wrong", response = Void.class)
+ })
+ public Response testGroupParameters(@QueryParam("required_string_group") @NotNull @ApiParam("Required String in group parameters") Integer requiredStringGroup
+,@HeaderParam("required_boolean_group") @NotNull @ApiParam("Required Boolean in group parameters") Boolean requiredBooleanGroup
+,@QueryParam("required_int64_group") @NotNull @ApiParam("Required Integer in group parameters") Long requiredInt64Group
+,@QueryParam("string_group") @ApiParam("String in group parameters") Integer stringGroup
+,@HeaderParam("boolean_group") @ApiParam("Boolean in group parameters") Boolean booleanGroup
+,@QueryParam("int64_group") @ApiParam("Integer in group parameters") Long int64Group
+) {
+ return Response.ok().entity("magic!").build();
+ }
+
+ @POST
+ @Path("/inline-additionalProperties")
+ @Consumes({ "application/json" })
+ @ApiOperation(value = "test inline additionalProperties", notes = "", response = Void.class, tags={ "fake" })
+ @ApiResponses(value = {
+ @ApiResponse(code = 200, message = "successful operation", response = Void.class)
+ })
+ public Response testInlineAdditionalProperties(@NotNull Map requestBody
+) {
+ return Response.ok().entity("magic!").build();
+ }
+
+ @POST
+ @Path("/inline-freeform-additionalProperties")
+ @Consumes({ "application/json" })
+ @ApiOperation(value = "test inline free-form additionalProperties", notes = "", response = Void.class, tags={ "fake" })
+ @ApiResponses(value = {
+ @ApiResponse(code = 200, message = "successful operation", response = Void.class)
+ })
+ public Response testInlineFreeformAdditionalProperties(@Valid @NotNull TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest
+) {
+ return Response.ok().entity("magic!").build();
+ }
+
+ @GET
+ @Path("/jsonFormData")
+ @Consumes({ "application/x-www-form-urlencoded" })
+ @ApiOperation(value = "test json serialization of form data", notes = "", response = Void.class, tags={ "fake" })
+ @ApiResponses(value = {
+ @ApiResponse(code = 200, message = "successful operation", response = Void.class)
+ })
+ public Response testJsonFormData(
+@FormParam(value = "param") String param,
+@FormParam(value = "param2") String param2) {
+ return Response.ok().entity("magic!").build();
+ }
+
+ @POST
+ @Path("/nullable")
+ @Consumes({ "application/json" })
+ @ApiOperation(value = "test nullable parent property", notes = "", response = Void.class, tags={ "fake" })
+ @ApiResponses(value = {
+ @ApiResponse(code = 200, message = "successful operation", response = Void.class)
+ })
+ public Response testNullable(@Valid @NotNull ChildWithNullable childWithNullable
+) {
+ return Response.ok().entity("magic!").build();
+ }
+
+ @PUT
+ @Path("/test-query-parameters")
+ @ApiOperation(value = "", notes = "To test the collection format in query parameters", response = Void.class, tags={ "fake" })
+ @ApiResponses(value = {
+ @ApiResponse(code = 200, message = "Success", response = Void.class)
+ })
+ public Response testQueryParameterCollectionFormat(@QueryParam("pipe") @NotNull List pipe
+,@QueryParam("ioutil") @NotNull List ioutil
+,@QueryParam("http") @NotNull List http
+,@QueryParam("url") @NotNull List url
+,@QueryParam("context") @NotNull List context
+,@QueryParam("allowEmpty") @NotNull String allowEmpty
+,@QueryParam("language") Map language
+) {
+ return Response.ok().entity("magic!").build();
+ }
+
+ @POST
+ @Path("/stringMap-reference")
+ @Consumes({ "application/json" })
+ @ApiOperation(value = "test referenced string map", notes = "", response = Void.class, tags={ "fake" })
+ @ApiResponses(value = {
+ @ApiResponse(code = 200, message = "successful operation", response = Void.class)
+ })
+ public Response testStringMapReference(@NotNull Map requestBody
+) {
+ return Response.ok().entity("magic!").build();
+ }
+
+ @POST
+ @Path("/{petId}/uploadImageWithRequiredFile")
+ @Consumes({ "multipart/form-data" })
+ @Produces({ "application/json" })
+ @ApiOperation(value = "uploads an image (required)", notes = "", response = ModelApiResponse.class, authorizations = {
+ @Authorization(value = "petstore_auth", scopes = {
+ @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
+ @AuthorizationScope(scope = "read:pets", description = "read your pets") })
+ }, tags={ "pet" })
+ @ApiResponses(value = {
+ @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class)
+ })
+ public Response uploadFileWithRequiredFile(@PathParam("petId") @ApiParam("ID of pet to update") Long petId
+,
+@FormParam(value = "requiredFile") InputStream requiredFileInputStream,
+@FormParam(value = "additionalMetadata") String additionalMetadata) {
+ return Response.ok().entity("magic!").build();
+ }
+}
diff --git a/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/api/FakeClassnameTestApi.java
new file mode 100644
index 000000000000..5d43613fa9a0
--- /dev/null
+++ b/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/api/FakeClassnameTestApi.java
@@ -0,0 +1,38 @@
+package org.openapitools.api;
+
+import org.openapitools.model.Client;
+
+import jakarta.ws.rs.*;
+import jakarta.ws.rs.core.Response;
+
+import io.swagger.annotations.*;
+
+import java.io.InputStream;
+import java.util.Map;
+import java.util.List;
+import jakarta.validation.constraints.*;
+import jakarta.validation.Valid;
+
+/**
+* Represents a collection of functions to interact with the API endpoints.
+*/
+@Path("/fake_classname_test")
+@Api(description = "the fake_classname_test API")
+@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 7.27.0-SNAPSHOT")
+public class FakeClassnameTestApi {
+
+ @PATCH
+ @Consumes({ "application/json" })
+ @Produces({ "application/json" })
+ @ApiOperation(value = "To test class name in snake case", notes = "To test class name in snake case", response = Client.class, authorizations = {
+
+ @Authorization(value = "api_key_query")
+ }, tags={ "fake_classname_tags 123#$%^" })
+ @ApiResponses(value = {
+ @ApiResponse(code = 200, message = "successful operation", response = Client.class)
+ })
+ public Response testClassname(@Valid @NotNull Client client
+) {
+ return Response.ok().entity("magic!").build();
+ }
+}
diff --git a/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/api/FooApi.java b/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/api/FooApi.java
new file mode 100644
index 000000000000..88f47d915056
--- /dev/null
+++ b/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/api/FooApi.java
@@ -0,0 +1,33 @@
+package org.openapitools.api;
+
+import org.openapitools.model.FooGetDefaultResponse;
+
+import jakarta.ws.rs.*;
+import jakarta.ws.rs.core.Response;
+
+import io.swagger.annotations.*;
+
+import java.io.InputStream;
+import java.util.Map;
+import java.util.List;
+import jakarta.validation.constraints.*;
+import jakarta.validation.Valid;
+
+/**
+* Represents a collection of functions to interact with the API endpoints.
+*/
+@Path("/foo")
+@Api(description = "the foo API")
+@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 7.27.0-SNAPSHOT")
+public class FooApi {
+
+ @GET
+ @Produces({ "application/json" })
+ @ApiOperation(value = "", notes = "", response = FooGetDefaultResponse.class, tags={ })
+ @ApiResponses(value = {
+ @ApiResponse(code = 200, message = "response", response = FooGetDefaultResponse.class)
+ })
+ public Response fooGet() {
+ return Response.ok().entity("magic!").build();
+ }
+}
diff --git a/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/api/PetApi.java b/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/api/PetApi.java
new file mode 100644
index 000000000000..891192da80ec
--- /dev/null
+++ b/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/api/PetApi.java
@@ -0,0 +1,169 @@
+package org.openapitools.api;
+
+import java.io.File;
+import org.openapitools.model.ModelApiResponse;
+import org.openapitools.model.Pet;
+import java.util.Set;
+
+import jakarta.ws.rs.*;
+import jakarta.ws.rs.core.Response;
+
+import io.swagger.annotations.*;
+
+import java.io.InputStream;
+import java.util.Map;
+import java.util.List;
+import jakarta.validation.constraints.*;
+import jakarta.validation.Valid;
+
+/**
+* Represents a collection of functions to interact with the API endpoints.
+*/
+@Path("/pet")
+@Api(description = "the pet API")
+@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 7.27.0-SNAPSHOT")
+public class PetApi {
+
+ @POST
+ @Consumes({ "application/json", "application/xml" })
+ @ApiOperation(value = "Add a new pet to the store", notes = "", response = Void.class, authorizations = {
+ @Authorization(value = "petstore_auth", scopes = {
+ @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
+ @AuthorizationScope(scope = "read:pets", description = "read your pets") })
+ }, tags={ "pet" })
+ @ApiResponses(value = {
+ @ApiResponse(code = 200, message = "Successful operation", response = Void.class),
+ @ApiResponse(code = 405, message = "Invalid input", response = Void.class)
+ })
+ public Response addPet(@Valid @NotNull Pet pet
+) {
+ return Response.ok().entity("magic!").build();
+ }
+
+ @DELETE
+ @Path("/{petId}")
+ @ApiOperation(value = "Deletes a pet", notes = "", response = Void.class, authorizations = {
+ @Authorization(value = "petstore_auth", scopes = {
+ @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
+ @AuthorizationScope(scope = "read:pets", description = "read your pets") })
+ }, tags={ "pet" })
+ @io.swagger.annotations.ApiImplicitParams({
+ @io.swagger.annotations.ApiImplicitParam(name = "api_key", value = "", dataType = "String", paramType = "header")
+ })
+ @ApiResponses(value = {
+ @ApiResponse(code = 200, message = "Successful operation", response = Void.class),
+ @ApiResponse(code = 400, message = "Invalid pet value", response = Void.class)
+ })
+ public Response deletePet(@PathParam("petId") @ApiParam("Pet id to delete") Long petId
+) {
+ return Response.ok().entity("magic!").build();
+ }
+
+ @GET
+ @Path("/findByStatus")
+ @Produces({ "application/xml", "application/json" })
+ @ApiOperation(value = "Finds Pets by status", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = {
+ @Authorization(value = "petstore_auth", scopes = {
+ @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
+ @AuthorizationScope(scope = "read:pets", description = "read your pets") })
+ }, tags={ "pet" })
+ @ApiResponses(value = {
+ @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"),
+ @ApiResponse(code = 400, message = "Invalid status value", response = Void.class)
+ })
+ public Response findPetsByStatus(@Deprecated @QueryParam("status") @NotNull @ApiParam("Status values that need to be considered for filter") List status
+) {
+ return Response.ok().entity("magic!").build();
+ }
+
+ @Deprecated
+ @GET
+ @Path("/findByTags")
+ @Produces({ "application/xml", "application/json" })
+ @ApiOperation(value = "Finds Pets by tags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "Set", authorizations = {
+ @Authorization(value = "petstore_auth", scopes = {
+ @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
+ @AuthorizationScope(scope = "read:pets", description = "read your pets") })
+ }, tags={ "pet" })
+ @ApiResponses(value = {
+ @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "Set"),
+ @ApiResponse(code = 400, message = "Invalid tag value", response = Void.class)
+ })
+ public Response findPetsByTags(@QueryParam("tags") @NotNull @ApiParam("Tags to filter by") Set tags
+) {
+ return Response.ok().entity("magic!").build();
+ }
+
+ @GET
+ @Path("/{petId}")
+ @Produces({ "application/xml", "application/json" })
+ @ApiOperation(value = "Find pet by ID", notes = "Returns a single pet", response = Pet.class, authorizations = {
+
+ @Authorization(value = "api_key")
+ }, tags={ "pet" })
+ @ApiResponses(value = {
+ @ApiResponse(code = 200, message = "successful operation", response = Pet.class),
+ @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class),
+ @ApiResponse(code = 404, message = "Pet not found", response = Void.class)
+ })
+ public Response getPetById(@PathParam("petId") @ApiParam("ID of pet to return") Long petId
+) {
+ return Response.ok().entity("magic!").build();
+ }
+
+ @PUT
+ @Consumes({ "application/json", "application/xml" })
+ @ApiOperation(value = "Update an existing pet", notes = "", response = Void.class, authorizations = {
+ @Authorization(value = "petstore_auth", scopes = {
+ @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
+ @AuthorizationScope(scope = "read:pets", description = "read your pets") })
+ }, tags={ "pet" })
+ @ApiResponses(value = {
+ @ApiResponse(code = 200, message = "Successful operation", response = Void.class),
+ @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class),
+ @ApiResponse(code = 404, message = "Pet not found", response = Void.class),
+ @ApiResponse(code = 405, message = "Validation exception", response = Void.class)
+ })
+ public Response updatePet(@Valid @NotNull Pet pet
+) {
+ return Response.ok().entity("magic!").build();
+ }
+
+ @POST
+ @Path("/{petId}")
+ @Consumes({ "application/x-www-form-urlencoded" })
+ @ApiOperation(value = "Updates a pet in the store with form data", notes = "", response = Void.class, authorizations = {
+ @Authorization(value = "petstore_auth", scopes = {
+ @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
+ @AuthorizationScope(scope = "read:pets", description = "read your pets") })
+ }, tags={ "pet" })
+ @ApiResponses(value = {
+ @ApiResponse(code = 200, message = "Successful operation", response = Void.class),
+ @ApiResponse(code = 405, message = "Invalid input", response = Void.class)
+ })
+ public Response updatePetWithForm(@PathParam("petId") @ApiParam("ID of pet that needs to be updated") Long petId
+,
+@FormParam(value = "name") String name,
+@FormParam(value = "status") String status) {
+ return Response.ok().entity("magic!").build();
+ }
+
+ @POST
+ @Path("/{petId}/uploadImage")
+ @Consumes({ "multipart/form-data" })
+ @Produces({ "application/json" })
+ @ApiOperation(value = "uploads an image", notes = "", response = ModelApiResponse.class, authorizations = {
+ @Authorization(value = "petstore_auth", scopes = {
+ @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
+ @AuthorizationScope(scope = "read:pets", description = "read your pets") })
+ }, tags={ "pet" })
+ @ApiResponses(value = {
+ @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class)
+ })
+ public Response uploadFile(@PathParam("petId") @ApiParam("ID of pet to update") Long petId
+,
+@FormParam(value = "additionalMetadata") String additionalMetadata,
+@FormParam(value = "file") InputStream _fileInputStream) {
+ return Response.ok().entity("magic!").build();
+ }
+}
diff --git a/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/api/RestApplication.java b/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/api/RestApplication.java
new file mode 100644
index 000000000000..f6d53b4501db
--- /dev/null
+++ b/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/api/RestApplication.java
@@ -0,0 +1,9 @@
+package org.openapitools.api;
+
+import jakarta.ws.rs.ApplicationPath;
+import jakarta.ws.rs.core.Application;
+
+@ApplicationPath(RestResourceRoot.APPLICATION_PATH)
+public class RestApplication extends Application {
+
+}
diff --git a/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/api/RestResourceRoot.java b/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/api/RestResourceRoot.java
new file mode 100644
index 000000000000..96ba6c8d8e40
--- /dev/null
+++ b/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/api/RestResourceRoot.java
@@ -0,0 +1,5 @@
+package org.openapitools.api;
+
+public class RestResourceRoot {
+ public static final String APPLICATION_PATH = "/v2";
+}
diff --git a/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/api/StoreApi.java
new file mode 100644
index 000000000000..4660eb0dda32
--- /dev/null
+++ b/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/api/StoreApi.java
@@ -0,0 +1,78 @@
+package org.openapitools.api;
+
+import java.util.Map;
+import org.openapitools.model.Order;
+
+import jakarta.ws.rs.*;
+import jakarta.ws.rs.core.Response;
+
+import io.swagger.annotations.*;
+
+import java.io.InputStream;
+import java.util.Map;
+import java.util.List;
+import jakarta.validation.constraints.*;
+import jakarta.validation.Valid;
+
+/**
+* Represents a collection of functions to interact with the API endpoints.
+*/
+@Path("/store")
+@Api(description = "the store API")
+@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 7.27.0-SNAPSHOT")
+public class StoreApi {
+
+ @DELETE
+ @Path("/order/{order_id}")
+ @ApiOperation(value = "Delete purchase order by ID", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", response = Void.class, tags={ "store" })
+ @ApiResponses(value = {
+ @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class),
+ @ApiResponse(code = 404, message = "Order not found", response = Void.class)
+ })
+ public Response deleteOrder(@PathParam("order_id") @ApiParam("ID of the order that needs to be deleted") String orderId
+) {
+ return Response.ok().entity("magic!").build();
+ }
+
+ @GET
+ @Path("/inventory")
+ @Produces({ "application/json" })
+ @ApiOperation(value = "Returns pet inventories by status", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = {
+
+ @Authorization(value = "api_key")
+ }, tags={ "store" })
+ @ApiResponses(value = {
+ @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map")
+ })
+ public Response getInventory() {
+ return Response.ok().entity("magic!").build();
+ }
+
+ @GET
+ @Path("/order/{order_id}")
+ @Produces({ "application/xml", "application/json" })
+ @ApiOperation(value = "Find purchase order by ID", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions", response = Order.class, tags={ "store" })
+ @ApiResponses(value = {
+ @ApiResponse(code = 200, message = "successful operation", response = Order.class),
+ @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class),
+ @ApiResponse(code = 404, message = "Order not found", response = Void.class)
+ })
+ public Response getOrderById(@PathParam("order_id") @Min(1L) @Max(5L) @ApiParam("ID of pet that needs to be fetched") Long orderId
+) {
+ return Response.ok().entity("magic!").build();
+ }
+
+ @POST
+ @Path("/order")
+ @Consumes({ "application/json" })
+ @Produces({ "application/xml", "application/json" })
+ @ApiOperation(value = "Place an order for a pet", notes = "", response = Order.class, tags={ "store" })
+ @ApiResponses(value = {
+ @ApiResponse(code = 200, message = "successful operation", response = Order.class),
+ @ApiResponse(code = 400, message = "Invalid Order", response = Void.class)
+ })
+ public Response placeOrder(@Valid @NotNull Order order
+) {
+ return Response.ok().entity("magic!").build();
+ }
+}
diff --git a/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/api/UserApi.java b/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/api/UserApi.java
new file mode 100644
index 000000000000..8f6d78e3b715
--- /dev/null
+++ b/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/api/UserApi.java
@@ -0,0 +1,123 @@
+package org.openapitools.api;
+
+import java.time.OffsetDateTime;
+import org.openapitools.model.User;
+
+import jakarta.ws.rs.*;
+import jakarta.ws.rs.core.Response;
+
+import io.swagger.annotations.*;
+
+import java.io.InputStream;
+import java.util.Map;
+import java.util.List;
+import jakarta.validation.constraints.*;
+import jakarta.validation.Valid;
+
+/**
+* Represents a collection of functions to interact with the API endpoints.
+*/
+@Path("/user")
+@Api(description = "the user API")
+@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 7.27.0-SNAPSHOT")
+public class UserApi {
+
+ @POST
+ @Consumes({ "application/json" })
+ @ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user" })
+ @ApiResponses(value = {
+ @ApiResponse(code = 200, message = "successful operation", response = Void.class)
+ })
+ public Response createUser(@Valid @NotNull User user
+) {
+ return Response.ok().entity("magic!").build();
+ }
+
+ @POST
+ @Path("/createWithArray")
+ @Consumes({ "application/json" })
+ @ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user" })
+ @ApiResponses(value = {
+ @ApiResponse(code = 200, message = "successful operation", response = Void.class)
+ })
+ public Response createUsersWithArrayInput(@NotNull List<@Valid User> user
+) {
+ return Response.ok().entity("magic!").build();
+ }
+
+ @POST
+ @Path("/createWithList")
+ @Consumes({ "application/json" })
+ @ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user" })
+ @ApiResponses(value = {
+ @ApiResponse(code = 200, message = "successful operation", response = Void.class)
+ })
+ public Response createUsersWithListInput(@NotNull List<@Valid User> user
+) {
+ return Response.ok().entity("magic!").build();
+ }
+
+ @DELETE
+ @Path("/{username}")
+ @ApiOperation(value = "Delete user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user" })
+ @ApiResponses(value = {
+ @ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class),
+ @ApiResponse(code = 404, message = "User not found", response = Void.class)
+ })
+ public Response deleteUser(@PathParam("username") @ApiParam("The name that needs to be deleted") String username
+) {
+ return Response.ok().entity("magic!").build();
+ }
+
+ @GET
+ @Path("/{username}")
+ @Produces({ "application/xml", "application/json" })
+ @ApiOperation(value = "Get user by user name", notes = "", response = User.class, tags={ "user" })
+ @ApiResponses(value = {
+ @ApiResponse(code = 200, message = "successful operation", response = User.class),
+ @ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class),
+ @ApiResponse(code = 404, message = "User not found", response = Void.class)
+ })
+ public Response getUserByName(@PathParam("username") @ApiParam("The name that needs to be fetched. Use user1 for testing.") String username
+) {
+ return Response.ok().entity("magic!").build();
+ }
+
+ @GET
+ @Path("/login")
+ @Produces({ "application/xml", "application/json" })
+ @ApiOperation(value = "Logs user into the system", notes = "", response = String.class, tags={ "user" })
+ @ApiResponses(value = {
+ @ApiResponse(code = 200, message = "successful operation", response = String.class),
+ @ApiResponse(code = 400, message = "Invalid username/password supplied", response = Void.class)
+ })
+ public Response loginUser(@QueryParam("username") @NotNull @ApiParam("The user name for login") String username
+,@QueryParam("password") @NotNull @ApiParam("The password for login in clear text") String password
+) {
+ return Response.ok().entity("magic!").build();
+ }
+
+ @GET
+ @Path("/logout")
+ @ApiOperation(value = "Logs out current logged in user session", notes = "", response = Void.class, tags={ "user" })
+ @ApiResponses(value = {
+ @ApiResponse(code = 200, message = "successful operation", response = Void.class)
+ })
+ public Response logoutUser() {
+ return Response.ok().entity("magic!").build();
+ }
+
+ @PUT
+ @Path("/{username}")
+ @Consumes({ "application/json" })
+ @ApiOperation(value = "Updated user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user" })
+ @ApiResponses(value = {
+ @ApiResponse(code = 400, message = "Invalid user supplied", response = Void.class),
+ @ApiResponse(code = 404, message = "User not found", response = Void.class)
+ })
+ public Response updateUser(@PathParam("username") @ApiParam("name that need to be deleted") String username
+,@Valid @NotNull User user
+) {
+ return Response.ok().entity("magic!").build();
+ }
+}
diff --git a/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java
new file mode 100644
index 000000000000..bc834123aebb
--- /dev/null
+++ b/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java
@@ -0,0 +1,173 @@
+package org.openapitools.model;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.util.HashMap;
+import java.util.Map;
+import java.io.Serializable;
+import jakarta.validation.constraints.*;
+import jakarta.validation.Valid;
+
+import io.swagger.annotations.*;
+import java.util.Objects;
+import jakarta.json.bind.annotation.JsonbCreator;
+import jakarta.json.bind.annotation.JsonbProperty;
+
+
+
+@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 7.27.0-SNAPSHOT")
+public class AdditionalPropertiesClass implements Serializable {
+ private Map mapProperty = new HashMap<>();
+ private Map> mapOfMapProperty = new HashMap<>();
+
+ protected AdditionalPropertiesClass(AdditionalPropertiesClassBuilder, ?> b) {
+ this.mapProperty = b.mapProperty;
+ this.mapOfMapProperty = b.mapOfMapProperty;
+ }
+
+ public AdditionalPropertiesClass() {
+ }
+
+ /**
+ **/
+ public AdditionalPropertiesClass mapProperty(Map mapProperty) {
+ this.mapProperty = mapProperty;
+ return this;
+ }
+
+
+ @ApiModelProperty(value = "")
+ @JsonbProperty("map_property")
+ public Map getMapProperty() {
+ return mapProperty;
+ }
+
+ @JsonbProperty("map_property")
+ public void setMapProperty(Map mapProperty) {
+ this.mapProperty = mapProperty;
+ }
+
+ public AdditionalPropertiesClass putMapPropertyItem(String key, String mapPropertyItem) {
+ if (this.mapProperty == null) {
+ this.mapProperty = new HashMap<>();
+ }
+
+ this.mapProperty.put(key, mapPropertyItem);
+ return this;
+ }
+
+ public AdditionalPropertiesClass removeMapPropertyItem(String key) {
+ if (this.mapProperty != null) {
+ this.mapProperty.remove(key);
+ }
+
+ return this;
+ }
+ /**
+ **/
+ public AdditionalPropertiesClass mapOfMapProperty(Map> mapOfMapProperty) {
+ this.mapOfMapProperty = mapOfMapProperty;
+ return this;
+ }
+
+
+ @ApiModelProperty(value = "")
+ @JsonbProperty("map_of_map_property")
+ public Map> getMapOfMapProperty() {
+ return mapOfMapProperty;
+ }
+
+ @JsonbProperty("map_of_map_property")
+ public void setMapOfMapProperty(Map> mapOfMapProperty) {
+ this.mapOfMapProperty = mapOfMapProperty;
+ }
+
+ public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map mapOfMapPropertyItem) {
+ if (this.mapOfMapProperty == null) {
+ this.mapOfMapProperty = new HashMap<>();
+ }
+
+ this.mapOfMapProperty.put(key, mapOfMapPropertyItem);
+ return this;
+ }
+
+ public AdditionalPropertiesClass removeMapOfMapPropertyItem(String key) {
+ if (this.mapOfMapProperty != null) {
+ this.mapOfMapProperty.remove(key);
+ }
+
+ return this;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ AdditionalPropertiesClass additionalPropertiesClass = (AdditionalPropertiesClass) o;
+ return Objects.equals(this.mapProperty, additionalPropertiesClass.mapProperty) &&
+ Objects.equals(this.mapOfMapProperty, additionalPropertiesClass.mapOfMapProperty);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(mapProperty, mapOfMapProperty);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class AdditionalPropertiesClass {\n");
+
+ sb.append(" mapProperty: ").append(toIndentedString(mapProperty)).append("\n");
+ sb.append(" mapOfMapProperty: ").append(toIndentedString(mapOfMapProperty)).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) {
+ return o == null ? "null" : o.toString().replace("\n", "\n ");
+ }
+
+
+ public static AdditionalPropertiesClassBuilder, ?> builder() {
+ return new AdditionalPropertiesClassBuilderImpl();
+ }
+
+ private static final class AdditionalPropertiesClassBuilderImpl extends AdditionalPropertiesClassBuilder {
+
+ @Override
+ protected AdditionalPropertiesClassBuilderImpl self() {
+ return this;
+ }
+
+ @Override
+ public AdditionalPropertiesClass build() {
+ return new AdditionalPropertiesClass(this);
+ }
+ }
+
+ public static abstract class AdditionalPropertiesClassBuilder> {
+ private Map mapProperty = new HashMap<>();
+ private Map> mapOfMapProperty = new HashMap<>();
+ protected abstract B self();
+
+ public abstract C build();
+
+ public B mapProperty(Map mapProperty) {
+ this.mapProperty = mapProperty;
+ return self();
+ }
+ public B mapOfMapProperty(Map> mapOfMapProperty) {
+ this.mapOfMapProperty = mapOfMapProperty;
+ return self();
+ }
+ }
+}
diff --git a/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/AllOfWithSingleRef.java b/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/AllOfWithSingleRef.java
new file mode 100644
index 000000000000..c4a12c6b35f5
--- /dev/null
+++ b/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/AllOfWithSingleRef.java
@@ -0,0 +1,148 @@
+package org.openapitools.model;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import org.openapitools.model.SingleRefType;
+import java.io.Serializable;
+import jakarta.validation.constraints.*;
+import jakarta.validation.Valid;
+
+import io.swagger.annotations.*;
+import java.util.Objects;
+import jakarta.json.bind.annotation.JsonbCreator;
+import jakarta.json.bind.annotation.JsonbProperty;
+import jakarta.json.bind.annotation.JsonbTypeDeserializer;
+import jakarta.json.bind.annotation.JsonbTypeSerializer;
+import jakarta.json.bind.serializer.DeserializationContext;
+import jakarta.json.bind.serializer.JsonbDeserializer;
+import jakarta.json.bind.serializer.JsonbSerializer;
+import jakarta.json.bind.serializer.SerializationContext;
+import jakarta.json.stream.JsonGenerator;
+import jakarta.json.stream.JsonParser;
+
+
+
+@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 7.27.0-SNAPSHOT")
+public class AllOfWithSingleRef implements Serializable {
+ private String username;
+ private SingleRefType singleRefType;
+
+ protected AllOfWithSingleRef(AllOfWithSingleRefBuilder, ?> b) {
+ this.username = b.username;
+ this.singleRefType = b.singleRefType;
+ }
+
+ public AllOfWithSingleRef() {
+ }
+
+ /**
+ **/
+ public AllOfWithSingleRef username(String username) {
+ this.username = username;
+ return this;
+ }
+
+
+ @ApiModelProperty(value = "")
+ @JsonbProperty("username")
+ public String getUsername() {
+ return username;
+ }
+
+ @JsonbProperty("username")
+ public void setUsername(String username) {
+ this.username = username;
+ }
+
+ /**
+ **/
+ public AllOfWithSingleRef singleRefType(SingleRefType singleRefType) {
+ this.singleRefType = singleRefType;
+ return this;
+ }
+
+
+ @ApiModelProperty(value = "")
+ @JsonbProperty("SingleRefType")
+ public SingleRefType getSingleRefType() {
+ return singleRefType;
+ }
+
+ @JsonbProperty("SingleRefType")
+ public void setSingleRefType(SingleRefType singleRefType) {
+ this.singleRefType = singleRefType;
+ }
+
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ AllOfWithSingleRef allOfWithSingleRef = (AllOfWithSingleRef) o;
+ return Objects.equals(this.username, allOfWithSingleRef.username) &&
+ Objects.equals(this.singleRefType, allOfWithSingleRef.singleRefType);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(username, singleRefType);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class AllOfWithSingleRef {\n");
+
+ sb.append(" username: ").append(toIndentedString(username)).append("\n");
+ sb.append(" singleRefType: ").append(toIndentedString(singleRefType)).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) {
+ return o == null ? "null" : o.toString().replace("\n", "\n ");
+ }
+
+
+ public static AllOfWithSingleRefBuilder, ?> builder() {
+ return new AllOfWithSingleRefBuilderImpl();
+ }
+
+ private static final class AllOfWithSingleRefBuilderImpl extends AllOfWithSingleRefBuilder {
+
+ @Override
+ protected AllOfWithSingleRefBuilderImpl self() {
+ return this;
+ }
+
+ @Override
+ public AllOfWithSingleRef build() {
+ return new AllOfWithSingleRef(this);
+ }
+ }
+
+ public static abstract class AllOfWithSingleRefBuilder> {
+ private String username;
+ private SingleRefType singleRefType;
+ protected abstract B self();
+
+ public abstract C build();
+
+ public B username(String username) {
+ this.username = username;
+ return self();
+ }
+ public B singleRefType(SingleRefType singleRefType) {
+ this.singleRefType = singleRefType;
+ return self();
+ }
+ }
+}
diff --git a/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/Animal.java b/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/Animal.java
new file mode 100644
index 000000000000..b5c57a9d5c97
--- /dev/null
+++ b/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/Animal.java
@@ -0,0 +1,146 @@
+package org.openapitools.model;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.io.Serializable;
+import jakarta.validation.constraints.*;
+import jakarta.validation.Valid;
+
+import io.swagger.annotations.*;
+import java.util.Objects;
+import jakarta.json.bind.annotation.JsonbCreator;
+import jakarta.json.bind.annotation.JsonbProperty;
+
+
+
+@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 7.27.0-SNAPSHOT")
+public class Animal implements Serializable {
+ private String className;
+ private String color = "red";
+
+ protected Animal(AnimalBuilder, ?> b) {
+ this.className = b.className;
+ this.color = b.color;
+ }
+
+ public Animal() {
+ }
+
+ @JsonbCreator
+ public Animal(
+ @JsonbProperty("className") String className
+ ) {
+ this.className = className;
+ }
+
+ /**
+ **/
+ public Animal className(String className) {
+ this.className = className;
+ return this;
+ }
+
+
+ @ApiModelProperty(required = true, value = "")
+ @JsonbProperty("className")
+ @NotNull public String getClassName() {
+ return className;
+ }
+
+ @JsonbProperty("className")
+ public void setClassName(String className) {
+ this.className = className;
+ }
+
+ /**
+ **/
+ public Animal color(String color) {
+ this.color = color;
+ return this;
+ }
+
+
+ @ApiModelProperty(value = "")
+ @JsonbProperty("color")
+ public String getColor() {
+ return color;
+ }
+
+ @JsonbProperty("color")
+ public void setColor(String color) {
+ this.color = color;
+ }
+
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ Animal animal = (Animal) o;
+ return Objects.equals(this.className, animal.className) &&
+ Objects.equals(this.color, animal.color);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(className, color);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class Animal {\n");
+
+ sb.append(" className: ").append(toIndentedString(className)).append("\n");
+ sb.append(" color: ").append(toIndentedString(color)).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) {
+ return o == null ? "null" : o.toString().replace("\n", "\n ");
+ }
+
+
+ public static AnimalBuilder, ?> builder() {
+ return new AnimalBuilderImpl();
+ }
+
+ private static final class AnimalBuilderImpl extends AnimalBuilder {
+
+ @Override
+ protected AnimalBuilderImpl self() {
+ return this;
+ }
+
+ @Override
+ public Animal build() {
+ return new Animal(this);
+ }
+ }
+
+ public static abstract class AnimalBuilder> {
+ private String className;
+ private String color = "red";
+ protected abstract B self();
+
+ public abstract C build();
+
+ public B className(String className) {
+ this.className = className;
+ return self();
+ }
+ public B color(String color) {
+ this.color = color;
+ return self();
+ }
+ }
+}
diff --git a/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java
new file mode 100644
index 000000000000..9837fb20e357
--- /dev/null
+++ b/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java
@@ -0,0 +1,131 @@
+package org.openapitools.model;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.io.Serializable;
+import jakarta.validation.constraints.*;
+import jakarta.validation.Valid;
+
+import io.swagger.annotations.*;
+import java.util.Objects;
+import jakarta.json.bind.annotation.JsonbCreator;
+import jakarta.json.bind.annotation.JsonbProperty;
+
+
+
+@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 7.27.0-SNAPSHOT")
+public class ArrayOfArrayOfNumberOnly implements Serializable {
+ private List> arrayArrayNumber = new ArrayList<>();
+
+ protected ArrayOfArrayOfNumberOnly(ArrayOfArrayOfNumberOnlyBuilder, ?> b) {
+ this.arrayArrayNumber = b.arrayArrayNumber;
+ }
+
+ public ArrayOfArrayOfNumberOnly() {
+ }
+
+ /**
+ **/
+ public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) {
+ this.arrayArrayNumber = arrayArrayNumber;
+ return this;
+ }
+
+
+ @ApiModelProperty(value = "")
+ @JsonbProperty("ArrayArrayNumber")
+ public List> getArrayArrayNumber() {
+ return arrayArrayNumber;
+ }
+
+ @JsonbProperty("ArrayArrayNumber")
+ public void setArrayArrayNumber(List> arrayArrayNumber) {
+ this.arrayArrayNumber = arrayArrayNumber;
+ }
+
+ public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) {
+ if (this.arrayArrayNumber == null) {
+ this.arrayArrayNumber = new ArrayList<>();
+ }
+
+ this.arrayArrayNumber.add(arrayArrayNumberItem);
+ return this;
+ }
+
+ public ArrayOfArrayOfNumberOnly removeArrayArrayNumberItem(List arrayArrayNumberItem) {
+ if (arrayArrayNumberItem != null && this.arrayArrayNumber != null) {
+ this.arrayArrayNumber.remove(arrayArrayNumberItem);
+ }
+
+ return this;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ ArrayOfArrayOfNumberOnly arrayOfArrayOfNumberOnly = (ArrayOfArrayOfNumberOnly) o;
+ return Objects.equals(this.arrayArrayNumber, arrayOfArrayOfNumberOnly.arrayArrayNumber);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(arrayArrayNumber);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class ArrayOfArrayOfNumberOnly {\n");
+
+ sb.append(" arrayArrayNumber: ").append(toIndentedString(arrayArrayNumber)).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) {
+ return o == null ? "null" : o.toString().replace("\n", "\n ");
+ }
+
+
+ public static ArrayOfArrayOfNumberOnlyBuilder, ?> builder() {
+ return new ArrayOfArrayOfNumberOnlyBuilderImpl();
+ }
+
+ private static final class ArrayOfArrayOfNumberOnlyBuilderImpl extends ArrayOfArrayOfNumberOnlyBuilder {
+
+ @Override
+ protected ArrayOfArrayOfNumberOnlyBuilderImpl self() {
+ return this;
+ }
+
+ @Override
+ public ArrayOfArrayOfNumberOnly build() {
+ return new ArrayOfArrayOfNumberOnly(this);
+ }
+ }
+
+ public static abstract class ArrayOfArrayOfNumberOnlyBuilder> {
+ private List> arrayArrayNumber = new ArrayList<>();
+ protected abstract B self();
+
+ public abstract C build();
+
+ public B arrayArrayNumber(List> arrayArrayNumber) {
+ this.arrayArrayNumber = arrayArrayNumber;
+ return self();
+ }
+ }
+}
diff --git a/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java
new file mode 100644
index 000000000000..603b82c68b1b
--- /dev/null
+++ b/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java
@@ -0,0 +1,131 @@
+package org.openapitools.model;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.io.Serializable;
+import jakarta.validation.constraints.*;
+import jakarta.validation.Valid;
+
+import io.swagger.annotations.*;
+import java.util.Objects;
+import jakarta.json.bind.annotation.JsonbCreator;
+import jakarta.json.bind.annotation.JsonbProperty;
+
+
+
+@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 7.27.0-SNAPSHOT")
+public class ArrayOfNumberOnly implements Serializable {
+ private List arrayNumber = new ArrayList<>();
+
+ protected ArrayOfNumberOnly(ArrayOfNumberOnlyBuilder, ?> b) {
+ this.arrayNumber = b.arrayNumber;
+ }
+
+ public ArrayOfNumberOnly() {
+ }
+
+ /**
+ **/
+ public ArrayOfNumberOnly arrayNumber(List arrayNumber) {
+ this.arrayNumber = arrayNumber;
+ return this;
+ }
+
+
+ @ApiModelProperty(value = "")
+ @JsonbProperty("ArrayNumber")
+ public List<@Valid BigDecimal> getArrayNumber() {
+ return arrayNumber;
+ }
+
+ @JsonbProperty("ArrayNumber")
+ public void setArrayNumber(List arrayNumber) {
+ this.arrayNumber = arrayNumber;
+ }
+
+ public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) {
+ if (this.arrayNumber == null) {
+ this.arrayNumber = new ArrayList<>();
+ }
+
+ this.arrayNumber.add(arrayNumberItem);
+ return this;
+ }
+
+ public ArrayOfNumberOnly removeArrayNumberItem(BigDecimal arrayNumberItem) {
+ if (arrayNumberItem != null && this.arrayNumber != null) {
+ this.arrayNumber.remove(arrayNumberItem);
+ }
+
+ return this;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ ArrayOfNumberOnly arrayOfNumberOnly = (ArrayOfNumberOnly) o;
+ return Objects.equals(this.arrayNumber, arrayOfNumberOnly.arrayNumber);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(arrayNumber);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class ArrayOfNumberOnly {\n");
+
+ sb.append(" arrayNumber: ").append(toIndentedString(arrayNumber)).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) {
+ return o == null ? "null" : o.toString().replace("\n", "\n ");
+ }
+
+
+ public static ArrayOfNumberOnlyBuilder, ?> builder() {
+ return new ArrayOfNumberOnlyBuilderImpl();
+ }
+
+ private static final class ArrayOfNumberOnlyBuilderImpl extends ArrayOfNumberOnlyBuilder {
+
+ @Override
+ protected ArrayOfNumberOnlyBuilderImpl self() {
+ return this;
+ }
+
+ @Override
+ public ArrayOfNumberOnly build() {
+ return new ArrayOfNumberOnly(this);
+ }
+ }
+
+ public static abstract class ArrayOfNumberOnlyBuilder> {
+ private List arrayNumber = new ArrayList<>();
+ protected abstract B self();
+
+ public abstract C build();
+
+ public B arrayNumber(List arrayNumber) {
+ this.arrayNumber = arrayNumber;
+ return self();
+ }
+ }
+}
diff --git a/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/ArrayTest.java
new file mode 100644
index 000000000000..097949b6165f
--- /dev/null
+++ b/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/ArrayTest.java
@@ -0,0 +1,219 @@
+package org.openapitools.model;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import org.openapitools.model.ReadOnlyFirst;
+import java.io.Serializable;
+import jakarta.validation.constraints.*;
+import jakarta.validation.Valid;
+
+import io.swagger.annotations.*;
+import java.util.Objects;
+import jakarta.json.bind.annotation.JsonbCreator;
+import jakarta.json.bind.annotation.JsonbProperty;
+
+
+
+@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 7.27.0-SNAPSHOT")
+public class ArrayTest implements Serializable {
+ private List arrayOfString = new ArrayList<>();
+ private List> arrayArrayOfInteger = new ArrayList<>();
+ private List> arrayArrayOfModel = new ArrayList<>();
+
+ protected ArrayTest(ArrayTestBuilder, ?> b) {
+ this.arrayOfString = b.arrayOfString;
+ this.arrayArrayOfInteger = b.arrayArrayOfInteger;
+ this.arrayArrayOfModel = b.arrayArrayOfModel;
+ }
+
+ public ArrayTest() {
+ }
+
+ /**
+ **/
+ public ArrayTest arrayOfString(List arrayOfString) {
+ this.arrayOfString = arrayOfString;
+ return this;
+ }
+
+
+ @ApiModelProperty(value = "")
+ @JsonbProperty("array_of_string")
+ @Size(min=0,max=3)public List getArrayOfString() {
+ return arrayOfString;
+ }
+
+ @JsonbProperty("array_of_string")
+ public void setArrayOfString(List arrayOfString) {
+ this.arrayOfString = arrayOfString;
+ }
+
+ public ArrayTest addArrayOfStringItem(String arrayOfStringItem) {
+ if (this.arrayOfString == null) {
+ this.arrayOfString = new ArrayList<>();
+ }
+
+ this.arrayOfString.add(arrayOfStringItem);
+ return this;
+ }
+
+ public ArrayTest removeArrayOfStringItem(String arrayOfStringItem) {
+ if (arrayOfStringItem != null && this.arrayOfString != null) {
+ this.arrayOfString.remove(arrayOfStringItem);
+ }
+
+ return this;
+ }
+ /**
+ **/
+ public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) {
+ this.arrayArrayOfInteger = arrayArrayOfInteger;
+ return this;
+ }
+
+
+ @ApiModelProperty(value = "")
+ @JsonbProperty("array_array_of_integer")
+ public List> getArrayArrayOfInteger() {
+ return arrayArrayOfInteger;
+ }
+
+ @JsonbProperty("array_array_of_integer")
+ public void setArrayArrayOfInteger(List> arrayArrayOfInteger) {
+ this.arrayArrayOfInteger = arrayArrayOfInteger;
+ }
+
+ public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) {
+ if (this.arrayArrayOfInteger == null) {
+ this.arrayArrayOfInteger = new ArrayList<>();
+ }
+
+ this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem);
+ return this;
+ }
+
+ public ArrayTest removeArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) {
+ if (arrayArrayOfIntegerItem != null && this.arrayArrayOfInteger != null) {
+ this.arrayArrayOfInteger.remove(arrayArrayOfIntegerItem);
+ }
+
+ return this;
+ }
+ /**
+ **/
+ public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) {
+ this.arrayArrayOfModel = arrayArrayOfModel;
+ return this;
+ }
+
+
+ @ApiModelProperty(value = "")
+ @JsonbProperty("array_array_of_model")
+ public List> getArrayArrayOfModel() {
+ return arrayArrayOfModel;
+ }
+
+ @JsonbProperty("array_array_of_model")
+ public void setArrayArrayOfModel(List> arrayArrayOfModel) {
+ this.arrayArrayOfModel = arrayArrayOfModel;
+ }
+
+ public ArrayTest addArrayArrayOfModelItem(List<@Valid ReadOnlyFirst> arrayArrayOfModelItem) {
+ if (this.arrayArrayOfModel == null) {
+ this.arrayArrayOfModel = new ArrayList<>();
+ }
+
+ this.arrayArrayOfModel.add(arrayArrayOfModelItem);
+ return this;
+ }
+
+ public ArrayTest removeArrayArrayOfModelItem(List<@Valid ReadOnlyFirst> arrayArrayOfModelItem) {
+ if (arrayArrayOfModelItem != null && this.arrayArrayOfModel != null) {
+ this.arrayArrayOfModel.remove(arrayArrayOfModelItem);
+ }
+
+ return this;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ ArrayTest arrayTest = (ArrayTest) o;
+ return Objects.equals(this.arrayOfString, arrayTest.arrayOfString) &&
+ Objects.equals(this.arrayArrayOfInteger, arrayTest.arrayArrayOfInteger) &&
+ Objects.equals(this.arrayArrayOfModel, arrayTest.arrayArrayOfModel);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class ArrayTest {\n");
+
+ sb.append(" arrayOfString: ").append(toIndentedString(arrayOfString)).append("\n");
+ sb.append(" arrayArrayOfInteger: ").append(toIndentedString(arrayArrayOfInteger)).append("\n");
+ sb.append(" arrayArrayOfModel: ").append(toIndentedString(arrayArrayOfModel)).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) {
+ return o == null ? "null" : o.toString().replace("\n", "\n ");
+ }
+
+
+ public static ArrayTestBuilder, ?> builder() {
+ return new ArrayTestBuilderImpl();
+ }
+
+ private static final class ArrayTestBuilderImpl extends ArrayTestBuilder {
+
+ @Override
+ protected ArrayTestBuilderImpl self() {
+ return this;
+ }
+
+ @Override
+ public ArrayTest build() {
+ return new ArrayTest(this);
+ }
+ }
+
+ public static abstract class ArrayTestBuilder> {
+ private List arrayOfString = new ArrayList<>();
+ private List> arrayArrayOfInteger = new ArrayList<>();
+ private List> arrayArrayOfModel = new ArrayList<>();
+ protected abstract B self();
+
+ public abstract C build();
+
+ public B arrayOfString(List arrayOfString) {
+ this.arrayOfString = arrayOfString;
+ return self();
+ }
+ public B arrayArrayOfInteger(List> arrayArrayOfInteger) {
+ this.arrayArrayOfInteger = arrayArrayOfInteger;
+ return self();
+ }
+ public B arrayArrayOfModel(List> arrayArrayOfModel) {
+ this.arrayArrayOfModel = arrayArrayOfModel;
+ return self();
+ }
+ }
+}
diff --git a/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/Capitalization.java
new file mode 100644
index 000000000000..8dbbb902af2f
--- /dev/null
+++ b/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/Capitalization.java
@@ -0,0 +1,252 @@
+package org.openapitools.model;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.io.Serializable;
+import jakarta.validation.constraints.*;
+import jakarta.validation.Valid;
+
+import io.swagger.annotations.*;
+import java.util.Objects;
+import jakarta.json.bind.annotation.JsonbCreator;
+import jakarta.json.bind.annotation.JsonbProperty;
+
+
+
+@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 7.27.0-SNAPSHOT")
+public class Capitalization implements Serializable {
+ private String smallCamel;
+ private String capitalCamel;
+ private String smallSnake;
+ private String capitalSnake;
+ private String scAETHFlowPoints;
+ private String ATT_NAME;
+
+ protected Capitalization(CapitalizationBuilder, ?> b) {
+ this.smallCamel = b.smallCamel;
+ this.capitalCamel = b.capitalCamel;
+ this.smallSnake = b.smallSnake;
+ this.capitalSnake = b.capitalSnake;
+ this.scAETHFlowPoints = b.scAETHFlowPoints;
+ this.ATT_NAME = b.ATT_NAME;
+ }
+
+ public Capitalization() {
+ }
+
+ /**
+ **/
+ public Capitalization smallCamel(String smallCamel) {
+ this.smallCamel = smallCamel;
+ return this;
+ }
+
+
+ @ApiModelProperty(value = "")
+ @JsonbProperty("smallCamel")
+ public String getSmallCamel() {
+ return smallCamel;
+ }
+
+ @JsonbProperty("smallCamel")
+ public void setSmallCamel(String smallCamel) {
+ this.smallCamel = smallCamel;
+ }
+
+ /**
+ **/
+ public Capitalization capitalCamel(String capitalCamel) {
+ this.capitalCamel = capitalCamel;
+ return this;
+ }
+
+
+ @ApiModelProperty(value = "")
+ @JsonbProperty("CapitalCamel")
+ public String getCapitalCamel() {
+ return capitalCamel;
+ }
+
+ @JsonbProperty("CapitalCamel")
+ public void setCapitalCamel(String capitalCamel) {
+ this.capitalCamel = capitalCamel;
+ }
+
+ /**
+ **/
+ public Capitalization smallSnake(String smallSnake) {
+ this.smallSnake = smallSnake;
+ return this;
+ }
+
+
+ @ApiModelProperty(value = "")
+ @JsonbProperty("small_Snake")
+ public String getSmallSnake() {
+ return smallSnake;
+ }
+
+ @JsonbProperty("small_Snake")
+ public void setSmallSnake(String smallSnake) {
+ this.smallSnake = smallSnake;
+ }
+
+ /**
+ **/
+ public Capitalization capitalSnake(String capitalSnake) {
+ this.capitalSnake = capitalSnake;
+ return this;
+ }
+
+
+ @ApiModelProperty(value = "")
+ @JsonbProperty("Capital_Snake")
+ public String getCapitalSnake() {
+ return capitalSnake;
+ }
+
+ @JsonbProperty("Capital_Snake")
+ public void setCapitalSnake(String capitalSnake) {
+ this.capitalSnake = capitalSnake;
+ }
+
+ /**
+ **/
+ public Capitalization scAETHFlowPoints(String scAETHFlowPoints) {
+ this.scAETHFlowPoints = scAETHFlowPoints;
+ return this;
+ }
+
+
+ @ApiModelProperty(value = "")
+ @JsonbProperty("SCA_ETH_Flow_Points")
+ public String getScAETHFlowPoints() {
+ return scAETHFlowPoints;
+ }
+
+ @JsonbProperty("SCA_ETH_Flow_Points")
+ public void setScAETHFlowPoints(String scAETHFlowPoints) {
+ this.scAETHFlowPoints = scAETHFlowPoints;
+ }
+
+ /**
+ * Name of the pet
+ **/
+ public Capitalization ATT_NAME(String ATT_NAME) {
+ this.ATT_NAME = ATT_NAME;
+ return this;
+ }
+
+
+ @ApiModelProperty(value = "Name of the pet ")
+ @JsonbProperty("ATT_NAME")
+ public String getATTNAME() {
+ return ATT_NAME;
+ }
+
+ @JsonbProperty("ATT_NAME")
+ public void setATTNAME(String ATT_NAME) {
+ this.ATT_NAME = ATT_NAME;
+ }
+
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ Capitalization capitalization = (Capitalization) o;
+ return Objects.equals(this.smallCamel, capitalization.smallCamel) &&
+ Objects.equals(this.capitalCamel, capitalization.capitalCamel) &&
+ Objects.equals(this.smallSnake, capitalization.smallSnake) &&
+ Objects.equals(this.capitalSnake, capitalization.capitalSnake) &&
+ Objects.equals(this.scAETHFlowPoints, capitalization.scAETHFlowPoints) &&
+ Objects.equals(this.ATT_NAME, capitalization.ATT_NAME);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class Capitalization {\n");
+
+ sb.append(" smallCamel: ").append(toIndentedString(smallCamel)).append("\n");
+ sb.append(" capitalCamel: ").append(toIndentedString(capitalCamel)).append("\n");
+ sb.append(" smallSnake: ").append(toIndentedString(smallSnake)).append("\n");
+ sb.append(" capitalSnake: ").append(toIndentedString(capitalSnake)).append("\n");
+ sb.append(" scAETHFlowPoints: ").append(toIndentedString(scAETHFlowPoints)).append("\n");
+ sb.append(" ATT_NAME: ").append(toIndentedString(ATT_NAME)).append("\n");
+ sb.append("}");
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces
+ * (except the first line).
+ */
+ private String toIndentedString(Object o) {
+ return o == null ? "null" : o.toString().replace("\n", "\n ");
+ }
+
+
+ public static CapitalizationBuilder, ?> builder() {
+ return new CapitalizationBuilderImpl();
+ }
+
+ private static final class CapitalizationBuilderImpl extends CapitalizationBuilder {
+
+ @Override
+ protected CapitalizationBuilderImpl self() {
+ return this;
+ }
+
+ @Override
+ public Capitalization build() {
+ return new Capitalization(this);
+ }
+ }
+
+ public static abstract class CapitalizationBuilder> {
+ private String smallCamel;
+ private String capitalCamel;
+ private String smallSnake;
+ private String capitalSnake;
+ private String scAETHFlowPoints;
+ private String ATT_NAME;
+ protected abstract B self();
+
+ public abstract C build();
+
+ public B smallCamel(String smallCamel) {
+ this.smallCamel = smallCamel;
+ return self();
+ }
+ public B capitalCamel(String capitalCamel) {
+ this.capitalCamel = capitalCamel;
+ return self();
+ }
+ public B smallSnake(String smallSnake) {
+ this.smallSnake = smallSnake;
+ return self();
+ }
+ public B capitalSnake(String capitalSnake) {
+ this.capitalSnake = capitalSnake;
+ return self();
+ }
+ public B scAETHFlowPoints(String scAETHFlowPoints) {
+ this.scAETHFlowPoints = scAETHFlowPoints;
+ return self();
+ }
+ public B ATT_NAME(String ATT_NAME) {
+ this.ATT_NAME = ATT_NAME;
+ return self();
+ }
+ }
+}
diff --git a/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/Cat.java b/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/Cat.java
new file mode 100644
index 000000000000..d37faa310418
--- /dev/null
+++ b/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/Cat.java
@@ -0,0 +1,120 @@
+package org.openapitools.model;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import org.openapitools.model.Animal;
+import java.io.Serializable;
+import jakarta.validation.constraints.*;
+import jakarta.validation.Valid;
+
+import io.swagger.annotations.*;
+import java.util.Objects;
+import jakarta.json.bind.annotation.JsonbCreator;
+import jakarta.json.bind.annotation.JsonbProperty;
+
+
+
+@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 7.27.0-SNAPSHOT")
+public class Cat extends Animal implements Serializable {
+ private Boolean declawed;
+
+ protected Cat(CatBuilder, ?> b) {
+ super(b);
+ this.declawed = b.declawed;
+ }
+
+ public Cat() {
+ }
+
+ @JsonbCreator
+ public Cat(
+ @JsonbProperty("className") String className
+ ) {
+ super(
+ className
+ );
+ }
+
+ /**
+ **/
+ public Cat declawed(Boolean declawed) {
+ this.declawed = declawed;
+ return this;
+ }
+
+
+ @ApiModelProperty(value = "")
+ @JsonbProperty("declawed")
+ public Boolean getDeclawed() {
+ return declawed;
+ }
+
+ @JsonbProperty("declawed")
+ public void setDeclawed(Boolean declawed) {
+ this.declawed = declawed;
+ }
+
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ Cat cat = (Cat) o;
+ return Objects.equals(this.declawed, cat.declawed) &&
+ super.equals(o);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(declawed, super.hashCode());
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class Cat {\n");
+ sb.append(" ").append(toIndentedString(super.toString())).append("\n");
+ sb.append(" declawed: ").append(toIndentedString(declawed)).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) {
+ return o == null ? "null" : o.toString().replace("\n", "\n ");
+ }
+
+
+ public static CatBuilder, ?> builder() {
+ return new CatBuilderImpl();
+ }
+
+ private static final class CatBuilderImpl extends CatBuilder {
+
+ @Override
+ protected CatBuilderImpl self() {
+ return this;
+ }
+
+ @Override
+ public Cat build() {
+ return new Cat(this);
+ }
+ }
+
+ public static abstract class CatBuilder> extends AnimalBuilder {
+ private Boolean declawed;
+
+ public B declawed(Boolean declawed) {
+ this.declawed = declawed;
+ return self();
+ }
+ }
+}
diff --git a/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/Category.java b/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/Category.java
new file mode 100644
index 000000000000..a4fd163c4ccf
--- /dev/null
+++ b/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/Category.java
@@ -0,0 +1,146 @@
+package org.openapitools.model;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.io.Serializable;
+import jakarta.validation.constraints.*;
+import jakarta.validation.Valid;
+
+import io.swagger.annotations.*;
+import java.util.Objects;
+import jakarta.json.bind.annotation.JsonbCreator;
+import jakarta.json.bind.annotation.JsonbProperty;
+
+
+
+@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 7.27.0-SNAPSHOT")
+public class Category implements Serializable {
+ private Long id;
+ private String name = "default-name";
+
+ protected Category(CategoryBuilder, ?> b) {
+ this.id = b.id;
+ this.name = b.name;
+ }
+
+ public Category() {
+ }
+
+ @JsonbCreator
+ public Category(
+ @JsonbProperty("name") String name
+ ) {
+ this.name = name;
+ }
+
+ /**
+ **/
+ public Category id(Long id) {
+ this.id = id;
+ return this;
+ }
+
+
+ @ApiModelProperty(value = "")
+ @JsonbProperty("id")
+ public Long getId() {
+ return id;
+ }
+
+ @JsonbProperty("id")
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ /**
+ **/
+ public Category name(String name) {
+ this.name = name;
+ return this;
+ }
+
+
+ @ApiModelProperty(required = true, value = "")
+ @JsonbProperty("name")
+ @NotNull public String getName() {
+ return name;
+ }
+
+ @JsonbProperty("name")
+ public void setName(String name) {
+ this.name = name;
+ }
+
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ Category category = (Category) o;
+ return Objects.equals(this.id, category.id) &&
+ Objects.equals(this.name, category.name);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(id, name);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class Category {\n");
+
+ sb.append(" id: ").append(toIndentedString(id)).append("\n");
+ sb.append(" name: ").append(toIndentedString(name)).append("\n");
+ sb.append("}");
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces
+ * (except the first line).
+ */
+ private String toIndentedString(Object o) {
+ return o == null ? "null" : o.toString().replace("\n", "\n ");
+ }
+
+
+ public static CategoryBuilder, ?> builder() {
+ return new CategoryBuilderImpl();
+ }
+
+ private static final class CategoryBuilderImpl extends CategoryBuilder {
+
+ @Override
+ protected CategoryBuilderImpl self() {
+ return this;
+ }
+
+ @Override
+ public Category build() {
+ return new Category(this);
+ }
+ }
+
+ public static abstract class CategoryBuilder> {
+ private Long id;
+ private String name = "default-name";
+ protected abstract B self();
+
+ public abstract C build();
+
+ public B id(Long id) {
+ this.id = id;
+ return self();
+ }
+ public B name(String name) {
+ this.name = name;
+ return self();
+ }
+ }
+}
diff --git a/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/ChildWithNullable.java b/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/ChildWithNullable.java
new file mode 100644
index 000000000000..ba8cf26727fe
--- /dev/null
+++ b/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/ChildWithNullable.java
@@ -0,0 +1,119 @@
+package org.openapitools.model;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import org.openapitools.model.ParentWithNullable;
+import java.io.Serializable;
+import jakarta.validation.constraints.*;
+import jakarta.validation.Valid;
+
+import io.swagger.annotations.*;
+import java.util.Objects;
+import jakarta.json.bind.annotation.JsonbCreator;
+import jakarta.json.bind.annotation.JsonbProperty;
+import jakarta.json.bind.annotation.JsonbTypeDeserializer;
+import jakarta.json.bind.annotation.JsonbTypeSerializer;
+import jakarta.json.bind.serializer.DeserializationContext;
+import jakarta.json.bind.serializer.JsonbDeserializer;
+import jakarta.json.bind.serializer.JsonbSerializer;
+import jakarta.json.bind.serializer.SerializationContext;
+import jakarta.json.stream.JsonGenerator;
+import jakarta.json.stream.JsonParser;
+
+
+
+@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 7.27.0-SNAPSHOT")
+public class ChildWithNullable extends ParentWithNullable implements Serializable {
+ private String otherProperty;
+
+ protected ChildWithNullable(ChildWithNullableBuilder, ?> b) {
+ super(b);
+ this.otherProperty = b.otherProperty;
+ }
+
+ public ChildWithNullable() {
+ }
+
+ /**
+ **/
+ public ChildWithNullable otherProperty(String otherProperty) {
+ this.otherProperty = otherProperty;
+ return this;
+ }
+
+
+ @ApiModelProperty(value = "")
+ @JsonbProperty("otherProperty")
+ public String getOtherProperty() {
+ return otherProperty;
+ }
+
+ @JsonbProperty("otherProperty")
+ public void setOtherProperty(String otherProperty) {
+ this.otherProperty = otherProperty;
+ }
+
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ ChildWithNullable childWithNullable = (ChildWithNullable) o;
+ return Objects.equals(this.otherProperty, childWithNullable.otherProperty) &&
+ super.equals(o);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(otherProperty, super.hashCode());
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class ChildWithNullable {\n");
+ sb.append(" ").append(toIndentedString(super.toString())).append("\n");
+ sb.append(" otherProperty: ").append(toIndentedString(otherProperty)).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) {
+ return o == null ? "null" : o.toString().replace("\n", "\n ");
+ }
+
+
+ public static ChildWithNullableBuilder, ?> builder() {
+ return new ChildWithNullableBuilderImpl();
+ }
+
+ private static final class ChildWithNullableBuilderImpl extends ChildWithNullableBuilder {
+
+ @Override
+ protected ChildWithNullableBuilderImpl self() {
+ return this;
+ }
+
+ @Override
+ public ChildWithNullable build() {
+ return new ChildWithNullable(this);
+ }
+ }
+
+ public static abstract class ChildWithNullableBuilder> extends ParentWithNullableBuilder {
+ private String otherProperty;
+
+ public B otherProperty(String otherProperty) {
+ this.otherProperty = otherProperty;
+ return self();
+ }
+ }
+}
diff --git a/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/ClassModel.java
new file mode 100644
index 000000000000..9e7a4d13ee50
--- /dev/null
+++ b/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/ClassModel.java
@@ -0,0 +1,113 @@
+package org.openapitools.model;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.io.Serializable;
+import jakarta.validation.constraints.*;
+import jakarta.validation.Valid;
+
+import io.swagger.annotations.*;
+import java.util.Objects;
+import jakarta.json.bind.annotation.JsonbCreator;
+import jakarta.json.bind.annotation.JsonbProperty;
+
+/**
+ * Model for testing model with \"_class\" property
+ **/
+@ApiModel(description = "Model for testing model with \"_class\" property")
+@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 7.27.0-SNAPSHOT")
+public class ClassModel implements Serializable {
+ private String propertyClass;
+
+ protected ClassModel(ClassModelBuilder, ?> b) {
+ this.propertyClass = b.propertyClass;
+ }
+
+ public ClassModel() {
+ }
+
+ /**
+ **/
+ public ClassModel propertyClass(String propertyClass) {
+ this.propertyClass = propertyClass;
+ return this;
+ }
+
+
+ @ApiModelProperty(value = "")
+ @JsonbProperty("_class")
+ public String getPropertyClass() {
+ return propertyClass;
+ }
+
+ @JsonbProperty("_class")
+ public void setPropertyClass(String propertyClass) {
+ this.propertyClass = propertyClass;
+ }
+
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ ClassModel classModel = (ClassModel) o;
+ return Objects.equals(this.propertyClass, classModel.propertyClass);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(propertyClass);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class ClassModel {\n");
+
+ sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).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) {
+ return o == null ? "null" : o.toString().replace("\n", "\n ");
+ }
+
+
+ public static ClassModelBuilder, ?> builder() {
+ return new ClassModelBuilderImpl();
+ }
+
+ private static final class ClassModelBuilderImpl extends ClassModelBuilder {
+
+ @Override
+ protected ClassModelBuilderImpl self() {
+ return this;
+ }
+
+ @Override
+ public ClassModel build() {
+ return new ClassModel(this);
+ }
+ }
+
+ public static abstract class ClassModelBuilder> {
+ private String propertyClass;
+ protected abstract B self();
+
+ public abstract C build();
+
+ public B propertyClass(String propertyClass) {
+ this.propertyClass = propertyClass;
+ return self();
+ }
+ }
+}
diff --git a/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/Client.java b/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/Client.java
new file mode 100644
index 000000000000..b65488d6c292
--- /dev/null
+++ b/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/Client.java
@@ -0,0 +1,111 @@
+package org.openapitools.model;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.io.Serializable;
+import jakarta.validation.constraints.*;
+import jakarta.validation.Valid;
+
+import io.swagger.annotations.*;
+import java.util.Objects;
+import jakarta.json.bind.annotation.JsonbCreator;
+import jakarta.json.bind.annotation.JsonbProperty;
+
+
+
+@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 7.27.0-SNAPSHOT")
+public class Client implements Serializable {
+ private String client;
+
+ protected Client(ClientBuilder, ?> b) {
+ this.client = b.client;
+ }
+
+ public Client() {
+ }
+
+ /**
+ **/
+ public Client client(String client) {
+ this.client = client;
+ return this;
+ }
+
+
+ @ApiModelProperty(value = "")
+ @JsonbProperty("client")
+ public String getClient() {
+ return client;
+ }
+
+ @JsonbProperty("client")
+ public void setClient(String client) {
+ this.client = client;
+ }
+
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ Client client = (Client) o;
+ return Objects.equals(this.client, client.client);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(client);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class Client {\n");
+
+ sb.append(" client: ").append(toIndentedString(client)).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) {
+ return o == null ? "null" : o.toString().replace("\n", "\n ");
+ }
+
+
+ public static ClientBuilder, ?> builder() {
+ return new ClientBuilderImpl();
+ }
+
+ private static final class ClientBuilderImpl extends ClientBuilder {
+
+ @Override
+ protected ClientBuilderImpl self() {
+ return this;
+ }
+
+ @Override
+ public Client build() {
+ return new Client(this);
+ }
+ }
+
+ public static abstract class ClientBuilder> {
+ private String client;
+ protected abstract B self();
+
+ public abstract C build();
+
+ public B client(String client) {
+ this.client = client;
+ return self();
+ }
+ }
+}
diff --git a/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/DeprecatedObject.java b/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/DeprecatedObject.java
new file mode 100644
index 000000000000..970f4f91852f
--- /dev/null
+++ b/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/DeprecatedObject.java
@@ -0,0 +1,113 @@
+package org.openapitools.model;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.io.Serializable;
+import jakarta.validation.constraints.*;
+import jakarta.validation.Valid;
+
+import io.swagger.annotations.*;
+import java.util.Objects;
+import jakarta.json.bind.annotation.JsonbCreator;
+import jakarta.json.bind.annotation.JsonbProperty;
+
+
+@Deprecated
+
+
+@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 7.27.0-SNAPSHOT")
+public class DeprecatedObject implements Serializable {
+ private String name;
+
+ protected DeprecatedObject(DeprecatedObjectBuilder, ?> b) {
+ this.name = b.name;
+ }
+
+ public DeprecatedObject() {
+ }
+
+ /**
+ **/
+ public DeprecatedObject name(String name) {
+ this.name = name;
+ return this;
+ }
+
+
+ @ApiModelProperty(value = "")
+ @JsonbProperty("name")
+ public String getName() {
+ return name;
+ }
+
+ @JsonbProperty("name")
+ public void setName(String name) {
+ this.name = name;
+ }
+
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ DeprecatedObject deprecatedObject = (DeprecatedObject) o;
+ return Objects.equals(this.name, deprecatedObject.name);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(name);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class DeprecatedObject {\n");
+
+ sb.append(" name: ").append(toIndentedString(name)).append("\n");
+ sb.append("}");
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces
+ * (except the first line).
+ */
+ private String toIndentedString(Object o) {
+ return o == null ? "null" : o.toString().replace("\n", "\n ");
+ }
+
+
+ public static DeprecatedObjectBuilder, ?> builder() {
+ return new DeprecatedObjectBuilderImpl();
+ }
+
+ private static final class DeprecatedObjectBuilderImpl extends DeprecatedObjectBuilder {
+
+ @Override
+ protected DeprecatedObjectBuilderImpl self() {
+ return this;
+ }
+
+ @Override
+ public DeprecatedObject build() {
+ return new DeprecatedObject(this);
+ }
+ }
+
+ public static abstract class DeprecatedObjectBuilder> {
+ private String name;
+ protected abstract B self();
+
+ public abstract C build();
+
+ public B name(String name) {
+ this.name = name;
+ return self();
+ }
+ }
+}
diff --git a/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/Dog.java b/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/Dog.java
new file mode 100644
index 000000000000..59106cb5d6ba
--- /dev/null
+++ b/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/Dog.java
@@ -0,0 +1,120 @@
+package org.openapitools.model;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import org.openapitools.model.Animal;
+import java.io.Serializable;
+import jakarta.validation.constraints.*;
+import jakarta.validation.Valid;
+
+import io.swagger.annotations.*;
+import java.util.Objects;
+import jakarta.json.bind.annotation.JsonbCreator;
+import jakarta.json.bind.annotation.JsonbProperty;
+
+
+
+@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 7.27.0-SNAPSHOT")
+public class Dog extends Animal implements Serializable {
+ private String breed;
+
+ protected Dog(DogBuilder, ?> b) {
+ super(b);
+ this.breed = b.breed;
+ }
+
+ public Dog() {
+ }
+
+ @JsonbCreator
+ public Dog(
+ @JsonbProperty("className") String className
+ ) {
+ super(
+ className
+ );
+ }
+
+ /**
+ **/
+ public Dog breed(String breed) {
+ this.breed = breed;
+ return this;
+ }
+
+
+ @ApiModelProperty(value = "")
+ @JsonbProperty("breed")
+ public String getBreed() {
+ return breed;
+ }
+
+ @JsonbProperty("breed")
+ public void setBreed(String breed) {
+ this.breed = breed;
+ }
+
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ Dog dog = (Dog) o;
+ return Objects.equals(this.breed, dog.breed) &&
+ super.equals(o);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(breed, super.hashCode());
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class Dog {\n");
+ sb.append(" ").append(toIndentedString(super.toString())).append("\n");
+ sb.append(" breed: ").append(toIndentedString(breed)).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) {
+ return o == null ? "null" : o.toString().replace("\n", "\n ");
+ }
+
+
+ public static DogBuilder, ?> builder() {
+ return new DogBuilderImpl();
+ }
+
+ private static final class DogBuilderImpl extends DogBuilder {
+
+ @Override
+ protected DogBuilderImpl self() {
+ return this;
+ }
+
+ @Override
+ public Dog build() {
+ return new Dog(this);
+ }
+ }
+
+ public static abstract class DogBuilder> extends AnimalBuilder {
+ private String breed;
+
+ public B breed(String breed) {
+ this.breed = breed;
+ return self();
+ }
+ }
+}
diff --git a/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/EnumArrays.java
new file mode 100644
index 000000000000..817852cfef58
--- /dev/null
+++ b/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/EnumArrays.java
@@ -0,0 +1,294 @@
+package org.openapitools.model;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.io.Serializable;
+import jakarta.validation.constraints.*;
+import jakarta.validation.Valid;
+
+import io.swagger.annotations.*;
+import java.util.Objects;
+import jakarta.json.bind.annotation.JsonbCreator;
+import jakarta.json.bind.annotation.JsonbProperty;
+import jakarta.json.bind.annotation.JsonbTypeDeserializer;
+import jakarta.json.bind.annotation.JsonbTypeSerializer;
+import jakarta.json.bind.serializer.DeserializationContext;
+import jakarta.json.bind.serializer.JsonbDeserializer;
+import jakarta.json.bind.serializer.JsonbSerializer;
+import jakarta.json.bind.serializer.SerializationContext;
+import jakarta.json.stream.JsonGenerator;
+import jakarta.json.stream.JsonParser;
+
+
+
+@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 7.27.0-SNAPSHOT")
+public class EnumArrays implements Serializable {
+ @JsonbTypeSerializer(JustSymbolEnum.Serializer.class)
+ @JsonbTypeDeserializer(JustSymbolEnum.Deserializer.class)
+ public enum JustSymbolEnum {
+
+ GREATER_THAN_OR_EQUAL_TO(String.valueOf(">=")), DOLLAR(String.valueOf("$"));
+
+
+ private String value;
+
+ JustSymbolEnum (String v) {
+ value = v;
+ }
+
+ public String value() {
+ return value;
+ }
+
+ @Override
+ public String toString() {
+ return String.valueOf(value);
+ }
+
+ /**
+ * Convert a String into String, as specified in the
+ * See JAX RS 2.0 Specification, section 3.2, p. 12
+ */
+ public static JustSymbolEnum fromString(String s) {
+ for (JustSymbolEnum b : JustSymbolEnum.values()) {
+ // using Objects.toString() to be safe if value type non-object type
+ // because types like 'int' etc. will be auto-boxed
+ if (java.util.Objects.toString(b.value).equals(s)) {
+ return b;
+ }
+ }
+ throw new IllegalArgumentException("Unexpected string value '" + s + "'");
+ }
+
+ public static JustSymbolEnum fromValue(String value) {
+ for (JustSymbolEnum b : JustSymbolEnum.values()) {
+ if (b.value.equals(value)) {
+ return b;
+ }
+ }
+ throw new IllegalArgumentException("Unexpected value '" + value + "'");
+ }
+
+ public static final class Serializer implements JsonbSerializer {
+ @Override
+ public void serialize(JustSymbolEnum obj, JsonGenerator generator, SerializationContext ctx) {
+ ctx.serialize(obj.value, generator);
+ }
+ }
+
+ public static final class Deserializer implements JsonbDeserializer {
+ @Override
+ public JustSymbolEnum deserialize(JsonParser parser, DeserializationContext ctx, java.lang.reflect.Type rtType) {
+ if (parser.getValue().getValueType() == jakarta.json.JsonValue.ValueType.NULL) {
+ return null;
+ }
+ return fromValue(ctx.deserialize(String.class, parser));
+ }
+ }
+}
+
+ private JustSymbolEnum justSymbol;
+ @JsonbTypeSerializer(ArrayEnumEnum.Serializer.class)
+ @JsonbTypeDeserializer(ArrayEnumEnum.Deserializer.class)
+ public enum ArrayEnumEnum {
+
+ FISH(String.valueOf("fish")), CRAB(String.valueOf("crab"));
+
+
+ private String value;
+
+ ArrayEnumEnum (String v) {
+ value = v;
+ }
+
+ public String value() {
+ return value;
+ }
+
+ @Override
+ public String toString() {
+ return String.valueOf(value);
+ }
+
+ /**
+ * Convert a String into String, as specified in the
+ * See JAX RS 2.0 Specification, section 3.2, p. 12
+ */
+ public static ArrayEnumEnum fromString(String s) {
+ for (ArrayEnumEnum b : ArrayEnumEnum.values()) {
+ // using Objects.toString() to be safe if value type non-object type
+ // because types like 'int' etc. will be auto-boxed
+ if (java.util.Objects.toString(b.value).equals(s)) {
+ return b;
+ }
+ }
+ throw new IllegalArgumentException("Unexpected string value '" + s + "'");
+ }
+
+ public static ArrayEnumEnum fromValue(String value) {
+ for (ArrayEnumEnum b : ArrayEnumEnum.values()) {
+ if (b.value.equals(value)) {
+ return b;
+ }
+ }
+ throw new IllegalArgumentException("Unexpected value '" + value + "'");
+ }
+
+ public static final class Serializer implements JsonbSerializer {
+ @Override
+ public void serialize(ArrayEnumEnum obj, JsonGenerator generator, SerializationContext ctx) {
+ ctx.serialize(obj.value, generator);
+ }
+ }
+
+ public static final class Deserializer implements JsonbDeserializer {
+ @Override
+ public ArrayEnumEnum deserialize(JsonParser parser, DeserializationContext ctx, java.lang.reflect.Type rtType) {
+ if (parser.getValue().getValueType() == jakarta.json.JsonValue.ValueType.NULL) {
+ return null;
+ }
+ return fromValue(ctx.deserialize(String.class, parser));
+ }
+ }
+}
+
+ private List arrayEnum = new ArrayList<>();
+
+ protected EnumArrays(EnumArraysBuilder, ?> b) {
+ this.justSymbol = b.justSymbol;
+ this.arrayEnum = b.arrayEnum;
+ }
+
+ public EnumArrays() {
+ }
+
+ /**
+ **/
+ public EnumArrays justSymbol(JustSymbolEnum justSymbol) {
+ this.justSymbol = justSymbol;
+ return this;
+ }
+
+
+ @ApiModelProperty(value = "")
+ @JsonbProperty("just_symbol")
+ public JustSymbolEnum getJustSymbol() {
+ return justSymbol;
+ }
+
+ @JsonbProperty("just_symbol")
+ public void setJustSymbol(JustSymbolEnum justSymbol) {
+ this.justSymbol = justSymbol;
+ }
+
+ /**
+ **/
+ public EnumArrays arrayEnum(List arrayEnum) {
+ this.arrayEnum = arrayEnum;
+ return this;
+ }
+
+
+ @ApiModelProperty(value = "")
+ @JsonbProperty("array_enum")
+ public List getArrayEnum() {
+ return arrayEnum;
+ }
+
+ @JsonbProperty("array_enum")
+ public void setArrayEnum(List arrayEnum) {
+ this.arrayEnum = arrayEnum;
+ }
+
+ public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) {
+ if (this.arrayEnum == null) {
+ this.arrayEnum = new ArrayList<>();
+ }
+
+ this.arrayEnum.add(arrayEnumItem);
+ return this;
+ }
+
+ public EnumArrays removeArrayEnumItem(ArrayEnumEnum arrayEnumItem) {
+ if (arrayEnumItem != null && this.arrayEnum != null) {
+ this.arrayEnum.remove(arrayEnumItem);
+ }
+
+ return this;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ EnumArrays enumArrays = (EnumArrays) o;
+ return Objects.equals(this.justSymbol, enumArrays.justSymbol) &&
+ Objects.equals(this.arrayEnum, enumArrays.arrayEnum);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(justSymbol, arrayEnum);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class EnumArrays {\n");
+
+ sb.append(" justSymbol: ").append(toIndentedString(justSymbol)).append("\n");
+ sb.append(" arrayEnum: ").append(toIndentedString(arrayEnum)).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) {
+ return o == null ? "null" : o.toString().replace("\n", "\n ");
+ }
+
+
+ public static EnumArraysBuilder, ?> builder() {
+ return new EnumArraysBuilderImpl();
+ }
+
+ private static final class EnumArraysBuilderImpl extends EnumArraysBuilder {
+
+ @Override
+ protected EnumArraysBuilderImpl self() {
+ return this;
+ }
+
+ @Override
+ public EnumArrays build() {
+ return new EnumArrays(this);
+ }
+ }
+
+ public static abstract class EnumArraysBuilder> {
+ private JustSymbolEnum justSymbol;
+ private List arrayEnum = new ArrayList<>();
+ protected abstract B self();
+
+ public abstract C build();
+
+ public B justSymbol(JustSymbolEnum justSymbol) {
+ this.justSymbol = justSymbol;
+ return self();
+ }
+ public B arrayEnum(List arrayEnum) {
+ this.arrayEnum = arrayEnum;
+ return self();
+ }
+ }
+}
diff --git a/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/EnumClass.java b/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/EnumClass.java
new file mode 100644
index 000000000000..eab0a990a3ec
--- /dev/null
+++ b/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/EnumClass.java
@@ -0,0 +1,83 @@
+package org.openapitools.model;
+
+import java.io.Serializable;
+import jakarta.validation.constraints.*;
+import jakarta.validation.Valid;
+
+import jakarta.json.bind.annotation.JsonbTypeDeserializer;
+import jakarta.json.bind.annotation.JsonbTypeSerializer;
+import jakarta.json.bind.serializer.DeserializationContext;
+import jakarta.json.bind.serializer.JsonbDeserializer;
+import jakarta.json.bind.serializer.JsonbSerializer;
+import jakarta.json.bind.serializer.SerializationContext;
+import jakarta.json.stream.JsonGenerator;
+import jakarta.json.stream.JsonParser;
+
+/**
+ * Gets or Sets EnumClass
+ */
+@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 7.27.0-SNAPSHOT")
+@JsonbTypeSerializer(EnumClass.Serializer.class)
+@JsonbTypeDeserializer(EnumClass.Deserializer.class)
+public enum EnumClass {
+
+ _ABC("_abc"),
+
+ _EFG("-efg"),
+
+ _XYZ_("(xyz)");
+
+ private String value;
+
+ EnumClass(String value) {
+ this.value = value;
+ }
+
+ /**
+ * Convert a String into String, as specified in the
+ * See JAX RS 2.0 Specification, section 3.2, p. 12
+ */
+ public static EnumClass fromString(String s) {
+ for (EnumClass b : EnumClass.values()) {
+ // using Objects.toString() to be safe if value type non-object type
+ // because types like 'int' etc. will be auto-boxed
+ if (java.util.Objects.toString(b.value).equals(s)) {
+ return b;
+ }
+ }
+ throw new IllegalArgumentException("Unexpected string value '" + s + "'");
+ }
+
+ @Override
+ public String toString() {
+ return String.valueOf(value);
+ }
+
+ public static EnumClass fromValue(String value) {
+ for (EnumClass b : EnumClass.values()) {
+ if (b.value.equals(value)) {
+ return b;
+ }
+ }
+ throw new IllegalArgumentException("Unexpected value '" + value + "'");
+ }
+
+ public static final class Serializer implements JsonbSerializer {
+ @Override
+ public void serialize(EnumClass obj, JsonGenerator generator, SerializationContext ctx) {
+ ctx.serialize(obj.value, generator);
+ }
+ }
+
+ public static final class Deserializer implements JsonbDeserializer {
+ @Override
+ public EnumClass deserialize(JsonParser parser, DeserializationContext ctx, java.lang.reflect.Type rtType) {
+ if (parser.getValue().getValueType() == jakarta.json.JsonValue.ValueType.NULL) {
+ return null;
+ }
+ return fromValue(ctx.deserialize(String.class, parser));
+ }
+ }
+}
+
+
diff --git a/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/EnumTest.java
new file mode 100644
index 000000000000..c7ae53d3ca25
--- /dev/null
+++ b/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/EnumTest.java
@@ -0,0 +1,582 @@
+package org.openapitools.model;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import org.openapitools.model.OuterEnum;
+import org.openapitools.model.OuterEnumDefaultValue;
+import org.openapitools.model.OuterEnumInteger;
+import org.openapitools.model.OuterEnumIntegerDefaultValue;
+import java.io.Serializable;
+import jakarta.validation.constraints.*;
+import jakarta.validation.Valid;
+
+import io.swagger.annotations.*;
+import java.util.Objects;
+import jakarta.json.bind.annotation.JsonbCreator;
+import jakarta.json.bind.annotation.JsonbProperty;
+import jakarta.json.bind.annotation.JsonbTypeDeserializer;
+import jakarta.json.bind.annotation.JsonbTypeSerializer;
+import jakarta.json.bind.serializer.DeserializationContext;
+import jakarta.json.bind.serializer.JsonbDeserializer;
+import jakarta.json.bind.serializer.JsonbSerializer;
+import jakarta.json.bind.serializer.SerializationContext;
+import jakarta.json.stream.JsonGenerator;
+import jakarta.json.stream.JsonParser;
+
+
+
+@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 7.27.0-SNAPSHOT")
+public class EnumTest implements Serializable {
+ @JsonbTypeSerializer(EnumStringEnum.Serializer.class)
+ @JsonbTypeDeserializer(EnumStringEnum.Deserializer.class)
+ public enum EnumStringEnum {
+
+ UPPER(String.valueOf("UPPER")), LOWER(String.valueOf("lower")), EMPTY(String.valueOf(""));
+
+
+ private String value;
+
+ EnumStringEnum (String v) {
+ value = v;
+ }
+
+ public String value() {
+ return value;
+ }
+
+ @Override
+ public String toString() {
+ return String.valueOf(value);
+ }
+
+ /**
+ * Convert a String into String, as specified in the
+ * See JAX RS 2.0 Specification, section 3.2, p. 12
+ */
+ public static EnumStringEnum fromString(String s) {
+ for (EnumStringEnum b : EnumStringEnum.values()) {
+ // using Objects.toString() to be safe if value type non-object type
+ // because types like 'int' etc. will be auto-boxed
+ if (java.util.Objects.toString(b.value).equals(s)) {
+ return b;
+ }
+ }
+ throw new IllegalArgumentException("Unexpected string value '" + s + "'");
+ }
+
+ public static EnumStringEnum fromValue(String value) {
+ for (EnumStringEnum b : EnumStringEnum.values()) {
+ if (b.value.equals(value)) {
+ return b;
+ }
+ }
+ throw new IllegalArgumentException("Unexpected value '" + value + "'");
+ }
+
+ public static final class Serializer implements JsonbSerializer {
+ @Override
+ public void serialize(EnumStringEnum obj, JsonGenerator generator, SerializationContext ctx) {
+ ctx.serialize(obj.value, generator);
+ }
+ }
+
+ public static final class Deserializer implements JsonbDeserializer {
+ @Override
+ public EnumStringEnum deserialize(JsonParser parser, DeserializationContext ctx, java.lang.reflect.Type rtType) {
+ if (parser.getValue().getValueType() == jakarta.json.JsonValue.ValueType.NULL) {
+ return null;
+ }
+ return fromValue(ctx.deserialize(String.class, parser));
+ }
+ }
+}
+
+ private EnumStringEnum enumString;
+ @JsonbTypeSerializer(EnumStringRequiredEnum.Serializer.class)
+ @JsonbTypeDeserializer(EnumStringRequiredEnum.Deserializer.class)
+ public enum EnumStringRequiredEnum {
+
+ UPPER(String.valueOf("UPPER")), LOWER(String.valueOf("lower")), EMPTY(String.valueOf(""));
+
+
+ private String value;
+
+ EnumStringRequiredEnum (String v) {
+ value = v;
+ }
+
+ public String value() {
+ return value;
+ }
+
+ @Override
+ public String toString() {
+ return String.valueOf(value);
+ }
+
+ /**
+ * Convert a String into String, as specified in the
+ * See JAX RS 2.0 Specification, section 3.2, p. 12
+ */
+ public static EnumStringRequiredEnum fromString(String s) {
+ for (EnumStringRequiredEnum b : EnumStringRequiredEnum.values()) {
+ // using Objects.toString() to be safe if value type non-object type
+ // because types like 'int' etc. will be auto-boxed
+ if (java.util.Objects.toString(b.value).equals(s)) {
+ return b;
+ }
+ }
+ throw new IllegalArgumentException("Unexpected string value '" + s + "'");
+ }
+
+ public static EnumStringRequiredEnum fromValue(String value) {
+ for (EnumStringRequiredEnum b : EnumStringRequiredEnum.values()) {
+ if (b.value.equals(value)) {
+ return b;
+ }
+ }
+ throw new IllegalArgumentException("Unexpected value '" + value + "'");
+ }
+
+ public static final class Serializer implements JsonbSerializer {
+ @Override
+ public void serialize(EnumStringRequiredEnum obj, JsonGenerator generator, SerializationContext ctx) {
+ ctx.serialize(obj.value, generator);
+ }
+ }
+
+ public static final class Deserializer implements JsonbDeserializer {
+ @Override
+ public EnumStringRequiredEnum deserialize(JsonParser parser, DeserializationContext ctx, java.lang.reflect.Type rtType) {
+ if (parser.getValue().getValueType() == jakarta.json.JsonValue.ValueType.NULL) {
+ return null;
+ }
+ return fromValue(ctx.deserialize(String.class, parser));
+ }
+ }
+}
+
+ private EnumStringRequiredEnum enumStringRequired;
+ @JsonbTypeSerializer(EnumIntegerEnum.Serializer.class)
+ @JsonbTypeDeserializer(EnumIntegerEnum.Deserializer.class)
+ public enum EnumIntegerEnum {
+
+ NUMBER_1(Integer.valueOf(1)), NUMBER_MINUS_1(Integer.valueOf(-1));
+
+
+ private Integer value;
+
+ EnumIntegerEnum (Integer v) {
+ value = v;
+ }
+
+ public Integer value() {
+ return value;
+ }
+
+ @Override
+ public String toString() {
+ return String.valueOf(value);
+ }
+
+ /**
+ * Convert a String into Integer, as specified in the
+ * See JAX RS 2.0 Specification, section 3.2, p. 12
+ */
+ public static EnumIntegerEnum fromString(String s) {
+ for (EnumIntegerEnum b : EnumIntegerEnum.values()) {
+ // using Objects.toString() to be safe if value type non-object type
+ // because types like 'int' etc. will be auto-boxed
+ if (java.util.Objects.toString(b.value).equals(s)) {
+ return b;
+ }
+ }
+ throw new IllegalArgumentException("Unexpected string value '" + s + "'");
+ }
+
+ public static EnumIntegerEnum fromValue(Integer value) {
+ for (EnumIntegerEnum b : EnumIntegerEnum.values()) {
+ if (b.value.equals(value)) {
+ return b;
+ }
+ }
+ throw new IllegalArgumentException("Unexpected value '" + value + "'");
+ }
+
+ public static final class Serializer implements JsonbSerializer {
+ @Override
+ public void serialize(EnumIntegerEnum obj, JsonGenerator generator, SerializationContext ctx) {
+ ctx.serialize(obj.value, generator);
+ }
+ }
+
+ public static final class Deserializer implements JsonbDeserializer {
+ @Override
+ public EnumIntegerEnum deserialize(JsonParser parser, DeserializationContext ctx, java.lang.reflect.Type rtType) {
+ if (parser.getValue().getValueType() == jakarta.json.JsonValue.ValueType.NULL) {
+ return null;
+ }
+ return fromValue(ctx.deserialize(Integer.class, parser));
+ }
+ }
+}
+
+ private EnumIntegerEnum enumInteger;
+ @JsonbTypeSerializer(EnumNumberEnum.Serializer.class)
+ @JsonbTypeDeserializer(EnumNumberEnum.Deserializer.class)
+ public enum EnumNumberEnum {
+
+ NUMBER_1_DOT_1(Double.valueOf(1.1)), NUMBER_MINUS_1_DOT_2(Double.valueOf(-1.2));
+
+
+ private Double value;
+
+ EnumNumberEnum (Double v) {
+ value = v;
+ }
+
+ public Double value() {
+ return value;
+ }
+
+ @Override
+ public String toString() {
+ return String.valueOf(value);
+ }
+
+ /**
+ * Convert a String into Double, as specified in the
+ * See JAX RS 2.0 Specification, section 3.2, p. 12
+ */
+ public static EnumNumberEnum fromString(String s) {
+ for (EnumNumberEnum b : EnumNumberEnum.values()) {
+ // using Objects.toString() to be safe if value type non-object type
+ // because types like 'int' etc. will be auto-boxed
+ if (java.util.Objects.toString(b.value).equals(s)) {
+ return b;
+ }
+ }
+ throw new IllegalArgumentException("Unexpected string value '" + s + "'");
+ }
+
+ public static EnumNumberEnum fromValue(Double value) {
+ for (EnumNumberEnum b : EnumNumberEnum.values()) {
+ if (b.value.equals(value)) {
+ return b;
+ }
+ }
+ throw new IllegalArgumentException("Unexpected value '" + value + "'");
+ }
+
+ public static final class Serializer implements JsonbSerializer {
+ @Override
+ public void serialize(EnumNumberEnum obj, JsonGenerator generator, SerializationContext ctx) {
+ ctx.serialize(obj.value, generator);
+ }
+ }
+
+ public static final class Deserializer implements JsonbDeserializer {
+ @Override
+ public EnumNumberEnum deserialize(JsonParser parser, DeserializationContext ctx, java.lang.reflect.Type rtType) {
+ if (parser.getValue().getValueType() == jakarta.json.JsonValue.ValueType.NULL) {
+ return null;
+ }
+ return fromValue(ctx.deserialize(Double.class, parser));
+ }
+ }
+}
+
+ private EnumNumberEnum enumNumber;
+ private OuterEnum outerEnum;
+ private OuterEnumInteger outerEnumInteger;
+ private OuterEnumDefaultValue outerEnumDefaultValue = OuterEnumDefaultValue.PLACED;
+ private OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue = OuterEnumIntegerDefaultValue.NUMBER_0;
+
+ protected EnumTest(EnumTestBuilder, ?> b) {
+ this.enumString = b.enumString;
+ this.enumStringRequired = b.enumStringRequired;
+ this.enumInteger = b.enumInteger;
+ this.enumNumber = b.enumNumber;
+ this.outerEnum = b.outerEnum;
+ this.outerEnumInteger = b.outerEnumInteger;
+ this.outerEnumDefaultValue = b.outerEnumDefaultValue;
+ this.outerEnumIntegerDefaultValue = b.outerEnumIntegerDefaultValue;
+ }
+
+ public EnumTest() {
+ }
+
+ @JsonbCreator
+ public EnumTest(
+ @JsonbProperty("enum_string_required") EnumStringRequiredEnum enumStringRequired
+ ) {
+ this.enumStringRequired = enumStringRequired;
+ }
+
+ /**
+ **/
+ public EnumTest enumString(EnumStringEnum enumString) {
+ this.enumString = enumString;
+ return this;
+ }
+
+
+ @ApiModelProperty(value = "")
+ @JsonbProperty("enum_string")
+ public EnumStringEnum getEnumString() {
+ return enumString;
+ }
+
+ @JsonbProperty("enum_string")
+ public void setEnumString(EnumStringEnum enumString) {
+ this.enumString = enumString;
+ }
+
+ /**
+ **/
+ public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) {
+ this.enumStringRequired = enumStringRequired;
+ return this;
+ }
+
+
+ @ApiModelProperty(required = true, value = "")
+ @JsonbProperty("enum_string_required")
+ @NotNull public EnumStringRequiredEnum getEnumStringRequired() {
+ return enumStringRequired;
+ }
+
+ @JsonbProperty("enum_string_required")
+ public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) {
+ this.enumStringRequired = enumStringRequired;
+ }
+
+ /**
+ **/
+ public EnumTest enumInteger(EnumIntegerEnum enumInteger) {
+ this.enumInteger = enumInteger;
+ return this;
+ }
+
+
+ @ApiModelProperty(value = "")
+ @JsonbProperty("enum_integer")
+ public EnumIntegerEnum getEnumInteger() {
+ return enumInteger;
+ }
+
+ @JsonbProperty("enum_integer")
+ public void setEnumInteger(EnumIntegerEnum enumInteger) {
+ this.enumInteger = enumInteger;
+ }
+
+ /**
+ **/
+ public EnumTest enumNumber(EnumNumberEnum enumNumber) {
+ this.enumNumber = enumNumber;
+ return this;
+ }
+
+
+ @ApiModelProperty(value = "")
+ @JsonbProperty("enum_number")
+ public EnumNumberEnum getEnumNumber() {
+ return enumNumber;
+ }
+
+ @JsonbProperty("enum_number")
+ public void setEnumNumber(EnumNumberEnum enumNumber) {
+ this.enumNumber = enumNumber;
+ }
+
+ /**
+ **/
+ public EnumTest outerEnum(OuterEnum outerEnum) {
+ this.outerEnum = outerEnum;
+ return this;
+ }
+
+
+ @ApiModelProperty(value = "")
+ @JsonbProperty("outerEnum")
+ public OuterEnum getOuterEnum() {
+ return outerEnum;
+ }
+
+ @JsonbProperty("outerEnum")
+ public void setOuterEnum(OuterEnum outerEnum) {
+ this.outerEnum = outerEnum;
+ }
+
+ /**
+ **/
+ public EnumTest outerEnumInteger(OuterEnumInteger outerEnumInteger) {
+ this.outerEnumInteger = outerEnumInteger;
+ return this;
+ }
+
+
+ @ApiModelProperty(value = "")
+ @JsonbProperty("outerEnumInteger")
+ public OuterEnumInteger getOuterEnumInteger() {
+ return outerEnumInteger;
+ }
+
+ @JsonbProperty("outerEnumInteger")
+ public void setOuterEnumInteger(OuterEnumInteger outerEnumInteger) {
+ this.outerEnumInteger = outerEnumInteger;
+ }
+
+ /**
+ **/
+ public EnumTest outerEnumDefaultValue(OuterEnumDefaultValue outerEnumDefaultValue) {
+ this.outerEnumDefaultValue = outerEnumDefaultValue;
+ return this;
+ }
+
+
+ @ApiModelProperty(value = "")
+ @JsonbProperty("outerEnumDefaultValue")
+ public OuterEnumDefaultValue getOuterEnumDefaultValue() {
+ return outerEnumDefaultValue;
+ }
+
+ @JsonbProperty("outerEnumDefaultValue")
+ public void setOuterEnumDefaultValue(OuterEnumDefaultValue outerEnumDefaultValue) {
+ this.outerEnumDefaultValue = outerEnumDefaultValue;
+ }
+
+ /**
+ **/
+ public EnumTest outerEnumIntegerDefaultValue(OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue) {
+ this.outerEnumIntegerDefaultValue = outerEnumIntegerDefaultValue;
+ return this;
+ }
+
+
+ @ApiModelProperty(value = "")
+ @JsonbProperty("outerEnumIntegerDefaultValue")
+ public OuterEnumIntegerDefaultValue getOuterEnumIntegerDefaultValue() {
+ return outerEnumIntegerDefaultValue;
+ }
+
+ @JsonbProperty("outerEnumIntegerDefaultValue")
+ public void setOuterEnumIntegerDefaultValue(OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue) {
+ this.outerEnumIntegerDefaultValue = outerEnumIntegerDefaultValue;
+ }
+
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ EnumTest enumTest = (EnumTest) o;
+ return Objects.equals(this.enumString, enumTest.enumString) &&
+ Objects.equals(this.enumStringRequired, enumTest.enumStringRequired) &&
+ Objects.equals(this.enumInteger, enumTest.enumInteger) &&
+ Objects.equals(this.enumNumber, enumTest.enumNumber) &&
+ Objects.equals(this.outerEnum, enumTest.outerEnum) &&
+ Objects.equals(this.outerEnumInteger, enumTest.outerEnumInteger) &&
+ Objects.equals(this.outerEnumDefaultValue, enumTest.outerEnumDefaultValue) &&
+ Objects.equals(this.outerEnumIntegerDefaultValue, enumTest.outerEnumIntegerDefaultValue);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(enumString, enumStringRequired, enumInteger, enumNumber, outerEnum, outerEnumInteger, outerEnumDefaultValue, outerEnumIntegerDefaultValue);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class EnumTest {\n");
+
+ sb.append(" enumString: ").append(toIndentedString(enumString)).append("\n");
+ sb.append(" enumStringRequired: ").append(toIndentedString(enumStringRequired)).append("\n");
+ sb.append(" enumInteger: ").append(toIndentedString(enumInteger)).append("\n");
+ sb.append(" enumNumber: ").append(toIndentedString(enumNumber)).append("\n");
+ sb.append(" outerEnum: ").append(toIndentedString(outerEnum)).append("\n");
+ sb.append(" outerEnumInteger: ").append(toIndentedString(outerEnumInteger)).append("\n");
+ sb.append(" outerEnumDefaultValue: ").append(toIndentedString(outerEnumDefaultValue)).append("\n");
+ sb.append(" outerEnumIntegerDefaultValue: ").append(toIndentedString(outerEnumIntegerDefaultValue)).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) {
+ return o == null ? "null" : o.toString().replace("\n", "\n ");
+ }
+
+
+ public static EnumTestBuilder, ?> builder() {
+ return new EnumTestBuilderImpl();
+ }
+
+ private static final class EnumTestBuilderImpl extends EnumTestBuilder {
+
+ @Override
+ protected EnumTestBuilderImpl self() {
+ return this;
+ }
+
+ @Override
+ public EnumTest build() {
+ return new EnumTest(this);
+ }
+ }
+
+ public static abstract class EnumTestBuilder> {
+ private EnumStringEnum enumString;
+ private EnumStringRequiredEnum enumStringRequired;
+ private EnumIntegerEnum enumInteger;
+ private EnumNumberEnum enumNumber;
+ private OuterEnum outerEnum;
+ private OuterEnumInteger outerEnumInteger;
+ private OuterEnumDefaultValue outerEnumDefaultValue = OuterEnumDefaultValue.PLACED;
+ private OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue = OuterEnumIntegerDefaultValue.NUMBER_0;
+ protected abstract B self();
+
+ public abstract C build();
+
+ public B enumString(EnumStringEnum enumString) {
+ this.enumString = enumString;
+ return self();
+ }
+ public B enumStringRequired(EnumStringRequiredEnum enumStringRequired) {
+ this.enumStringRequired = enumStringRequired;
+ return self();
+ }
+ public B enumInteger(EnumIntegerEnum enumInteger) {
+ this.enumInteger = enumInteger;
+ return self();
+ }
+ public B enumNumber(EnumNumberEnum enumNumber) {
+ this.enumNumber = enumNumber;
+ return self();
+ }
+ public B outerEnum(OuterEnum outerEnum) {
+ this.outerEnum = outerEnum;
+ return self();
+ }
+ public B outerEnumInteger(OuterEnumInteger outerEnumInteger) {
+ this.outerEnumInteger = outerEnumInteger;
+ return self();
+ }
+ public B outerEnumDefaultValue(OuterEnumDefaultValue outerEnumDefaultValue) {
+ this.outerEnumDefaultValue = outerEnumDefaultValue;
+ return self();
+ }
+ public B outerEnumIntegerDefaultValue(OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue) {
+ this.outerEnumIntegerDefaultValue = outerEnumIntegerDefaultValue;
+ return self();
+ }
+ }
+}
diff --git a/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/FakeBigDecimalMap200Response.java b/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/FakeBigDecimalMap200Response.java
new file mode 100644
index 000000000000..8c82c45e9dba
--- /dev/null
+++ b/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/FakeBigDecimalMap200Response.java
@@ -0,0 +1,158 @@
+package org.openapitools.model;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.math.BigDecimal;
+import java.util.HashMap;
+import java.util.Map;
+import java.io.Serializable;
+import jakarta.validation.constraints.*;
+import jakarta.validation.Valid;
+
+import io.swagger.annotations.*;
+import java.util.Objects;
+import jakarta.json.bind.annotation.JsonbCreator;
+import jakarta.json.bind.annotation.JsonbProperty;
+
+
+
+@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 7.27.0-SNAPSHOT")
+public class FakeBigDecimalMap200Response implements Serializable {
+ private BigDecimal someId;
+ private Map someMap = new HashMap<>();
+
+ protected FakeBigDecimalMap200Response(FakeBigDecimalMap200ResponseBuilder, ?> b) {
+ this.someId = b.someId;
+ this.someMap = b.someMap;
+ }
+
+ public FakeBigDecimalMap200Response() {
+ }
+
+ /**
+ **/
+ public FakeBigDecimalMap200Response someId(BigDecimal someId) {
+ this.someId = someId;
+ return this;
+ }
+
+
+ @ApiModelProperty(value = "")
+ @JsonbProperty("someId")
+ @Valid public BigDecimal getSomeId() {
+ return someId;
+ }
+
+ @JsonbProperty("someId")
+ public void setSomeId(BigDecimal someId) {
+ this.someId = someId;
+ }
+
+ /**
+ **/
+ public FakeBigDecimalMap200Response someMap(Map someMap) {
+ this.someMap = someMap;
+ return this;
+ }
+
+
+ @ApiModelProperty(value = "")
+ @JsonbProperty("someMap")
+ public Map getSomeMap() {
+ return someMap;
+ }
+
+ @JsonbProperty("someMap")
+ public void setSomeMap(Map someMap) {
+ this.someMap = someMap;
+ }
+
+ public FakeBigDecimalMap200Response putSomeMapItem(String key, BigDecimal someMapItem) {
+ if (this.someMap == null) {
+ this.someMap = new HashMap<>();
+ }
+
+ this.someMap.put(key, someMapItem);
+ return this;
+ }
+
+ public FakeBigDecimalMap200Response removeSomeMapItem(String key) {
+ if (this.someMap != null) {
+ this.someMap.remove(key);
+ }
+
+ return this;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ FakeBigDecimalMap200Response fakeBigDecimalMap200Response = (FakeBigDecimalMap200Response) o;
+ return Objects.equals(this.someId, fakeBigDecimalMap200Response.someId) &&
+ Objects.equals(this.someMap, fakeBigDecimalMap200Response.someMap);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(someId, someMap);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class FakeBigDecimalMap200Response {\n");
+
+ sb.append(" someId: ").append(toIndentedString(someId)).append("\n");
+ sb.append(" someMap: ").append(toIndentedString(someMap)).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) {
+ return o == null ? "null" : o.toString().replace("\n", "\n ");
+ }
+
+
+ public static FakeBigDecimalMap200ResponseBuilder, ?> builder() {
+ return new FakeBigDecimalMap200ResponseBuilderImpl();
+ }
+
+ private static final class FakeBigDecimalMap200ResponseBuilderImpl extends FakeBigDecimalMap200ResponseBuilder {
+
+ @Override
+ protected FakeBigDecimalMap200ResponseBuilderImpl self() {
+ return this;
+ }
+
+ @Override
+ public FakeBigDecimalMap200Response build() {
+ return new FakeBigDecimalMap200Response(this);
+ }
+ }
+
+ public static abstract class FakeBigDecimalMap200ResponseBuilder> {
+ private BigDecimal someId;
+ private Map someMap = new HashMap<>();
+ protected abstract B self();
+
+ public abstract C build();
+
+ public B someId(BigDecimal someId) {
+ this.someId = someId;
+ return self();
+ }
+ public B someMap(Map someMap) {
+ this.someMap = someMap;
+ return self();
+ }
+ }
+}
diff --git a/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/FakeTestsDefaultsDefaultResponse.java b/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/FakeTestsDefaultsDefaultResponse.java
new file mode 100644
index 000000000000..b6e4f3d79e82
--- /dev/null
+++ b/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/FakeTestsDefaultsDefaultResponse.java
@@ -0,0 +1,333 @@
+package org.openapitools.model;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import org.openapitools.model.IntegerEnum;
+import org.openapitools.model.StringEnum;
+import java.io.Serializable;
+import jakarta.validation.constraints.*;
+import jakarta.validation.Valid;
+
+import io.swagger.annotations.*;
+import java.util.Objects;
+import jakarta.json.bind.annotation.JsonbCreator;
+import jakarta.json.bind.annotation.JsonbProperty;
+import jakarta.json.bind.annotation.JsonbTypeDeserializer;
+import jakarta.json.bind.annotation.JsonbTypeSerializer;
+import jakarta.json.bind.serializer.DeserializationContext;
+import jakarta.json.bind.serializer.JsonbDeserializer;
+import jakarta.json.bind.serializer.JsonbSerializer;
+import jakarta.json.bind.serializer.SerializationContext;
+import jakarta.json.stream.JsonGenerator;
+import jakarta.json.stream.JsonParser;
+
+
+
+@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 7.27.0-SNAPSHOT")
+public class FakeTestsDefaultsDefaultResponse implements Serializable {
+ private StringEnum stringEnum = StringEnum.FOO;
+ private IntegerEnum integerEnum = IntegerEnum.NUMBER_1;
+ @JsonbTypeSerializer(StringEnumInlineEnum.Serializer.class)
+ @JsonbTypeDeserializer(StringEnumInlineEnum.Deserializer.class)
+ public enum StringEnumInlineEnum {
+
+ FOO(String.valueOf("foo")), BAR(String.valueOf("bar")), BAZ(String.valueOf("baz"));
+
+
+ private String value;
+
+ StringEnumInlineEnum (String v) {
+ value = v;
+ }
+
+ public String value() {
+ return value;
+ }
+
+ @Override
+ public String toString() {
+ return String.valueOf(value);
+ }
+
+ /**
+ * Convert a String into String, as specified in the
+ * See JAX RS 2.0 Specification, section 3.2, p. 12
+ */
+ public static StringEnumInlineEnum fromString(String s) {
+ for (StringEnumInlineEnum b : StringEnumInlineEnum.values()) {
+ // using Objects.toString() to be safe if value type non-object type
+ // because types like 'int' etc. will be auto-boxed
+ if (java.util.Objects.toString(b.value).equals(s)) {
+ return b;
+ }
+ }
+ throw new IllegalArgumentException("Unexpected string value '" + s + "'");
+ }
+
+ public static StringEnumInlineEnum fromValue(String value) {
+ for (StringEnumInlineEnum b : StringEnumInlineEnum.values()) {
+ if (b.value.equals(value)) {
+ return b;
+ }
+ }
+ throw new IllegalArgumentException("Unexpected value '" + value + "'");
+ }
+
+ public static final class Serializer implements JsonbSerializer {
+ @Override
+ public void serialize(StringEnumInlineEnum obj, JsonGenerator generator, SerializationContext ctx) {
+ ctx.serialize(obj.value, generator);
+ }
+ }
+
+ public static final class Deserializer implements JsonbDeserializer {
+ @Override
+ public StringEnumInlineEnum deserialize(JsonParser parser, DeserializationContext ctx, java.lang.reflect.Type rtType) {
+ if (parser.getValue().getValueType() == jakarta.json.JsonValue.ValueType.NULL) {
+ return null;
+ }
+ return fromValue(ctx.deserialize(String.class, parser));
+ }
+ }
+}
+
+ private StringEnumInlineEnum stringEnumInline = StringEnumInlineEnum.FOO;
+ @JsonbTypeSerializer(IntegerEnumInlineEnum.Serializer.class)
+ @JsonbTypeDeserializer(IntegerEnumInlineEnum.Deserializer.class)
+ public enum IntegerEnumInlineEnum {
+
+ NUMBER_1(Integer.valueOf(1)), NUMBER_2(Integer.valueOf(2)), NUMBER_3(Integer.valueOf(3));
+
+
+ private Integer value;
+
+ IntegerEnumInlineEnum (Integer v) {
+ value = v;
+ }
+
+ public Integer value() {
+ return value;
+ }
+
+ @Override
+ public String toString() {
+ return String.valueOf(value);
+ }
+
+ /**
+ * Convert a String into Integer, as specified in the
+ * See JAX RS 2.0 Specification, section 3.2, p. 12
+ */
+ public static IntegerEnumInlineEnum fromString(String s) {
+ for (IntegerEnumInlineEnum b : IntegerEnumInlineEnum.values()) {
+ // using Objects.toString() to be safe if value type non-object type
+ // because types like 'int' etc. will be auto-boxed
+ if (java.util.Objects.toString(b.value).equals(s)) {
+ return b;
+ }
+ }
+ throw new IllegalArgumentException("Unexpected string value '" + s + "'");
+ }
+
+ public static IntegerEnumInlineEnum fromValue(Integer value) {
+ for (IntegerEnumInlineEnum b : IntegerEnumInlineEnum.values()) {
+ if (b.value.equals(value)) {
+ return b;
+ }
+ }
+ throw new IllegalArgumentException("Unexpected value '" + value + "'");
+ }
+
+ public static final class Serializer implements JsonbSerializer {
+ @Override
+ public void serialize(IntegerEnumInlineEnum obj, JsonGenerator generator, SerializationContext ctx) {
+ ctx.serialize(obj.value, generator);
+ }
+ }
+
+ public static final class Deserializer implements JsonbDeserializer {
+ @Override
+ public IntegerEnumInlineEnum deserialize(JsonParser parser, DeserializationContext ctx, java.lang.reflect.Type rtType) {
+ if (parser.getValue().getValueType() == jakarta.json.JsonValue.ValueType.NULL) {
+ return null;
+ }
+ return fromValue(ctx.deserialize(Integer.class, parser));
+ }
+ }
+}
+
+ private IntegerEnumInlineEnum integerEnumInline = IntegerEnumInlineEnum.NUMBER_1;
+
+ protected FakeTestsDefaultsDefaultResponse(FakeTestsDefaultsDefaultResponseBuilder, ?> b) {
+ this.stringEnum = b.stringEnum;
+ this.integerEnum = b.integerEnum;
+ this.stringEnumInline = b.stringEnumInline;
+ this.integerEnumInline = b.integerEnumInline;
+ }
+
+ public FakeTestsDefaultsDefaultResponse() {
+ }
+
+ /**
+ **/
+ public FakeTestsDefaultsDefaultResponse stringEnum(StringEnum stringEnum) {
+ this.stringEnum = stringEnum;
+ return this;
+ }
+
+
+ @ApiModelProperty(value = "")
+ @JsonbProperty("stringEnum")
+ public StringEnum getStringEnum() {
+ return stringEnum;
+ }
+
+ @JsonbProperty("stringEnum")
+ public void setStringEnum(StringEnum stringEnum) {
+ this.stringEnum = stringEnum;
+ }
+
+ /**
+ **/
+ public FakeTestsDefaultsDefaultResponse integerEnum(IntegerEnum integerEnum) {
+ this.integerEnum = integerEnum;
+ return this;
+ }
+
+
+ @ApiModelProperty(value = "")
+ @JsonbProperty("integerEnum")
+ public IntegerEnum getIntegerEnum() {
+ return integerEnum;
+ }
+
+ @JsonbProperty("integerEnum")
+ public void setIntegerEnum(IntegerEnum integerEnum) {
+ this.integerEnum = integerEnum;
+ }
+
+ /**
+ **/
+ public FakeTestsDefaultsDefaultResponse stringEnumInline(StringEnumInlineEnum stringEnumInline) {
+ this.stringEnumInline = stringEnumInline;
+ return this;
+ }
+
+
+ @ApiModelProperty(value = "")
+ @JsonbProperty("stringEnumInline")
+ public StringEnumInlineEnum getStringEnumInline() {
+ return stringEnumInline;
+ }
+
+ @JsonbProperty("stringEnumInline")
+ public void setStringEnumInline(StringEnumInlineEnum stringEnumInline) {
+ this.stringEnumInline = stringEnumInline;
+ }
+
+ /**
+ **/
+ public FakeTestsDefaultsDefaultResponse integerEnumInline(IntegerEnumInlineEnum integerEnumInline) {
+ this.integerEnumInline = integerEnumInline;
+ return this;
+ }
+
+
+ @ApiModelProperty(value = "")
+ @JsonbProperty("integerEnumInline")
+ public IntegerEnumInlineEnum getIntegerEnumInline() {
+ return integerEnumInline;
+ }
+
+ @JsonbProperty("integerEnumInline")
+ public void setIntegerEnumInline(IntegerEnumInlineEnum integerEnumInline) {
+ this.integerEnumInline = integerEnumInline;
+ }
+
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ FakeTestsDefaultsDefaultResponse fakeTestsDefaultsDefaultResponse = (FakeTestsDefaultsDefaultResponse) o;
+ return Objects.equals(this.stringEnum, fakeTestsDefaultsDefaultResponse.stringEnum) &&
+ Objects.equals(this.integerEnum, fakeTestsDefaultsDefaultResponse.integerEnum) &&
+ Objects.equals(this.stringEnumInline, fakeTestsDefaultsDefaultResponse.stringEnumInline) &&
+ Objects.equals(this.integerEnumInline, fakeTestsDefaultsDefaultResponse.integerEnumInline);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(stringEnum, integerEnum, stringEnumInline, integerEnumInline);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class FakeTestsDefaultsDefaultResponse {\n");
+
+ sb.append(" stringEnum: ").append(toIndentedString(stringEnum)).append("\n");
+ sb.append(" integerEnum: ").append(toIndentedString(integerEnum)).append("\n");
+ sb.append(" stringEnumInline: ").append(toIndentedString(stringEnumInline)).append("\n");
+ sb.append(" integerEnumInline: ").append(toIndentedString(integerEnumInline)).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) {
+ return o == null ? "null" : o.toString().replace("\n", "\n ");
+ }
+
+
+ public static FakeTestsDefaultsDefaultResponseBuilder, ?> builder() {
+ return new FakeTestsDefaultsDefaultResponseBuilderImpl();
+ }
+
+ private static final class FakeTestsDefaultsDefaultResponseBuilderImpl extends FakeTestsDefaultsDefaultResponseBuilder {
+
+ @Override
+ protected FakeTestsDefaultsDefaultResponseBuilderImpl self() {
+ return this;
+ }
+
+ @Override
+ public FakeTestsDefaultsDefaultResponse build() {
+ return new FakeTestsDefaultsDefaultResponse(this);
+ }
+ }
+
+ public static abstract class FakeTestsDefaultsDefaultResponseBuilder> {
+ private StringEnum stringEnum = StringEnum.FOO;
+ private IntegerEnum integerEnum = IntegerEnum.NUMBER_1;
+ private StringEnumInlineEnum stringEnumInline = StringEnumInlineEnum.FOO;
+ private IntegerEnumInlineEnum integerEnumInline = IntegerEnumInlineEnum.NUMBER_1;
+ protected abstract B self();
+
+ public abstract C build();
+
+ public B stringEnum(StringEnum stringEnum) {
+ this.stringEnum = stringEnum;
+ return self();
+ }
+ public B integerEnum(IntegerEnum integerEnum) {
+ this.integerEnum = integerEnum;
+ return self();
+ }
+ public B stringEnumInline(StringEnumInlineEnum stringEnumInline) {
+ this.stringEnumInline = stringEnumInline;
+ return self();
+ }
+ public B integerEnumInline(IntegerEnumInlineEnum integerEnumInline) {
+ this.integerEnumInline = integerEnumInline;
+ return self();
+ }
+ }
+}
diff --git a/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/FileSchemaTestClass.java
new file mode 100644
index 000000000000..f87a22f8cb94
--- /dev/null
+++ b/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/FileSchemaTestClass.java
@@ -0,0 +1,159 @@
+package org.openapitools.model;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import org.openapitools.model.ModelFile;
+import java.io.Serializable;
+import jakarta.validation.constraints.*;
+import jakarta.validation.Valid;
+
+import io.swagger.annotations.*;
+import java.util.Objects;
+import jakarta.json.bind.annotation.JsonbCreator;
+import jakarta.json.bind.annotation.JsonbProperty;
+
+
+
+@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 7.27.0-SNAPSHOT")
+public class FileSchemaTestClass implements Serializable {
+ private ModelFile _file;
+ private List<@Valid ModelFile> files = new ArrayList<>();
+
+ protected FileSchemaTestClass(FileSchemaTestClassBuilder, ?> b) {
+ this._file = b._file;
+ this.files = b.files;
+ }
+
+ public FileSchemaTestClass() {
+ }
+
+ /**
+ **/
+ public FileSchemaTestClass _file(ModelFile _file) {
+ this._file = _file;
+ return this;
+ }
+
+
+ @ApiModelProperty(value = "")
+ @JsonbProperty("file")
+ @Valid public ModelFile getFile() {
+ return _file;
+ }
+
+ @JsonbProperty("file")
+ public void setFile(ModelFile _file) {
+ this._file = _file;
+ }
+
+ /**
+ **/
+ public FileSchemaTestClass files(List<@Valid ModelFile> files) {
+ this.files = files;
+ return this;
+ }
+
+
+ @ApiModelProperty(value = "")
+ @JsonbProperty("files")
+ public List<@Valid ModelFile> getFiles() {
+ return files;
+ }
+
+ @JsonbProperty("files")
+ public void setFiles(List<@Valid ModelFile> files) {
+ this.files = files;
+ }
+
+ public FileSchemaTestClass addFilesItem(ModelFile filesItem) {
+ if (this.files == null) {
+ this.files = new ArrayList<>();
+ }
+
+ this.files.add(filesItem);
+ return this;
+ }
+
+ public FileSchemaTestClass removeFilesItem(ModelFile filesItem) {
+ if (filesItem != null && this.files != null) {
+ this.files.remove(filesItem);
+ }
+
+ return this;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ FileSchemaTestClass fileSchemaTestClass = (FileSchemaTestClass) o;
+ return Objects.equals(this._file, fileSchemaTestClass._file) &&
+ Objects.equals(this.files, fileSchemaTestClass.files);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(_file, files);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class FileSchemaTestClass {\n");
+
+ sb.append(" _file: ").append(toIndentedString(_file)).append("\n");
+ sb.append(" files: ").append(toIndentedString(files)).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) {
+ return o == null ? "null" : o.toString().replace("\n", "\n ");
+ }
+
+
+ public static FileSchemaTestClassBuilder, ?> builder() {
+ return new FileSchemaTestClassBuilderImpl();
+ }
+
+ private static final class FileSchemaTestClassBuilderImpl extends FileSchemaTestClassBuilder {
+
+ @Override
+ protected FileSchemaTestClassBuilderImpl self() {
+ return this;
+ }
+
+ @Override
+ public FileSchemaTestClass build() {
+ return new FileSchemaTestClass(this);
+ }
+ }
+
+ public static abstract class FileSchemaTestClassBuilder> {
+ private ModelFile _file;
+ private List files = new ArrayList<>();
+ protected abstract B self();
+
+ public abstract C build();
+
+ public B _file(ModelFile _file) {
+ this._file = _file;
+ return self();
+ }
+ public B files(List files) {
+ this.files = files;
+ return self();
+ }
+ }
+}
diff --git a/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/Foo.java b/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/Foo.java
new file mode 100644
index 000000000000..362d6a7172b6
--- /dev/null
+++ b/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/Foo.java
@@ -0,0 +1,111 @@
+package org.openapitools.model;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.io.Serializable;
+import jakarta.validation.constraints.*;
+import jakarta.validation.Valid;
+
+import io.swagger.annotations.*;
+import java.util.Objects;
+import jakarta.json.bind.annotation.JsonbCreator;
+import jakarta.json.bind.annotation.JsonbProperty;
+
+
+
+@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 7.27.0-SNAPSHOT")
+public class Foo implements Serializable {
+ private String bar = "bar";
+
+ protected Foo(FooBuilder, ?> b) {
+ this.bar = b.bar;
+ }
+
+ public Foo() {
+ }
+
+ /**
+ **/
+ public Foo bar(String bar) {
+ this.bar = bar;
+ return this;
+ }
+
+
+ @ApiModelProperty(value = "")
+ @JsonbProperty("bar")
+ public String getBar() {
+ return bar;
+ }
+
+ @JsonbProperty("bar")
+ public void setBar(String bar) {
+ this.bar = bar;
+ }
+
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ Foo foo = (Foo) o;
+ return Objects.equals(this.bar, foo.bar);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(bar);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class Foo {\n");
+
+ sb.append(" bar: ").append(toIndentedString(bar)).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) {
+ return o == null ? "null" : o.toString().replace("\n", "\n ");
+ }
+
+
+ public static FooBuilder, ?> builder() {
+ return new FooBuilderImpl();
+ }
+
+ private static final class FooBuilderImpl extends FooBuilder {
+
+ @Override
+ protected FooBuilderImpl self() {
+ return this;
+ }
+
+ @Override
+ public Foo build() {
+ return new Foo(this);
+ }
+ }
+
+ public static abstract class FooBuilder> {
+ private String bar = "bar";
+ protected abstract B self();
+
+ public abstract C build();
+
+ public B bar(String bar) {
+ this.bar = bar;
+ return self();
+ }
+ }
+}
diff --git a/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/FooGetDefaultResponse.java b/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/FooGetDefaultResponse.java
new file mode 100644
index 000000000000..fcefed713eff
--- /dev/null
+++ b/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/FooGetDefaultResponse.java
@@ -0,0 +1,112 @@
+package org.openapitools.model;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import org.openapitools.model.Foo;
+import java.io.Serializable;
+import jakarta.validation.constraints.*;
+import jakarta.validation.Valid;
+
+import io.swagger.annotations.*;
+import java.util.Objects;
+import jakarta.json.bind.annotation.JsonbCreator;
+import jakarta.json.bind.annotation.JsonbProperty;
+
+
+
+@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 7.27.0-SNAPSHOT")
+public class FooGetDefaultResponse implements Serializable {
+ private Foo string;
+
+ protected FooGetDefaultResponse(FooGetDefaultResponseBuilder, ?> b) {
+ this.string = b.string;
+ }
+
+ public FooGetDefaultResponse() {
+ }
+
+ /**
+ **/
+ public FooGetDefaultResponse string(Foo string) {
+ this.string = string;
+ return this;
+ }
+
+
+ @ApiModelProperty(value = "")
+ @JsonbProperty("string")
+ @Valid public Foo getString() {
+ return string;
+ }
+
+ @JsonbProperty("string")
+ public void setString(Foo string) {
+ this.string = string;
+ }
+
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ FooGetDefaultResponse fooGetDefaultResponse = (FooGetDefaultResponse) o;
+ return Objects.equals(this.string, fooGetDefaultResponse.string);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(string);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class FooGetDefaultResponse {\n");
+
+ sb.append(" string: ").append(toIndentedString(string)).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) {
+ return o == null ? "null" : o.toString().replace("\n", "\n ");
+ }
+
+
+ public static FooGetDefaultResponseBuilder, ?> builder() {
+ return new FooGetDefaultResponseBuilderImpl();
+ }
+
+ private static final class FooGetDefaultResponseBuilderImpl extends FooGetDefaultResponseBuilder {
+
+ @Override
+ protected FooGetDefaultResponseBuilderImpl self() {
+ return this;
+ }
+
+ @Override
+ public FooGetDefaultResponse build() {
+ return new FooGetDefaultResponse(this);
+ }
+ }
+
+ public static abstract class FooGetDefaultResponseBuilder> {
+ private Foo string;
+ protected abstract B self();
+
+ public abstract C build();
+
+ public B string(Foo string) {
+ this.string = string;
+ return self();
+ }
+ }
+}
diff --git a/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/FormatTest.java
new file mode 100644
index 000000000000..2a93b712f14e
--- /dev/null
+++ b/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/FormatTest.java
@@ -0,0 +1,562 @@
+package org.openapitools.model;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.io.File;
+import java.math.BigDecimal;
+import java.time.LocalDate;
+import java.time.OffsetDateTime;
+import java.util.Arrays;
+import java.util.UUID;
+import java.io.Serializable;
+import jakarta.validation.constraints.*;
+import jakarta.validation.Valid;
+
+import io.swagger.annotations.*;
+import java.util.Objects;
+import jakarta.json.bind.annotation.JsonbCreator;
+import jakarta.json.bind.annotation.JsonbProperty;
+
+
+
+@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 7.27.0-SNAPSHOT")
+public class FormatTest implements Serializable {
+ private Integer integer;
+ private Integer int32;
+ private Long int64;
+ private BigDecimal number;
+ private Float _float;
+ private Double _double;
+ private BigDecimal decimal;
+ private String string;
+ private byte[] _byte;
+ private File binary;
+ private LocalDate date;
+ private OffsetDateTime dateTime;
+ private UUID uuid;
+ private String password;
+ private String patternWithDigits;
+ private String patternWithDigitsAndDelimiter;
+
+ protected FormatTest(FormatTestBuilder, ?> b) {
+ this.integer = b.integer;
+ this.int32 = b.int32;
+ this.int64 = b.int64;
+ this.number = b.number;
+ this._float = b._float;
+ this._double = b._double;
+ this.decimal = b.decimal;
+ this.string = b.string;
+ this._byte = b._byte;
+ this.binary = b.binary;
+ this.date = b.date;
+ this.dateTime = b.dateTime;
+ this.uuid = b.uuid;
+ this.password = b.password;
+ this.patternWithDigits = b.patternWithDigits;
+ this.patternWithDigitsAndDelimiter = b.patternWithDigitsAndDelimiter;
+ }
+
+ public FormatTest() {
+ }
+
+ @JsonbCreator
+ public FormatTest(
+ @JsonbProperty("number") BigDecimal number,
+ @JsonbProperty("byte") byte[] _byte,
+ @JsonbProperty("date") LocalDate date,
+ @JsonbProperty("password") String password
+ ) {
+ this.number = number;
+ this._byte = _byte;
+ this.date = date;
+ this.password = password;
+ }
+
+ /**
+ * minimum: 10
+ * maximum: 100
+ **/
+ public FormatTest integer(Integer integer) {
+ this.integer = integer;
+ return this;
+ }
+
+
+ @ApiModelProperty(value = "")
+ @JsonbProperty("integer")
+ @Min(10) @Max(100)public Integer getInteger() {
+ return integer;
+ }
+
+ @JsonbProperty("integer")
+ public void setInteger(Integer integer) {
+ this.integer = integer;
+ }
+
+ /**
+ * minimum: 20
+ * maximum: 200
+ **/
+ public FormatTest int32(Integer int32) {
+ this.int32 = int32;
+ return this;
+ }
+
+
+ @ApiModelProperty(value = "")
+ @JsonbProperty("int32")
+ @Min(20) @Max(200)public Integer getInt32() {
+ return int32;
+ }
+
+ @JsonbProperty("int32")
+ public void setInt32(Integer int32) {
+ this.int32 = int32;
+ }
+
+ /**
+ **/
+ public FormatTest int64(Long int64) {
+ this.int64 = int64;
+ return this;
+ }
+
+
+ @ApiModelProperty(value = "")
+ @JsonbProperty("int64")
+ public Long getInt64() {
+ return int64;
+ }
+
+ @JsonbProperty("int64")
+ public void setInt64(Long int64) {
+ this.int64 = int64;
+ }
+
+ /**
+ * minimum: 32.1
+ * maximum: 543.2
+ **/
+ public FormatTest number(BigDecimal number) {
+ this.number = number;
+ return this;
+ }
+
+
+ @ApiModelProperty(required = true, value = "")
+ @JsonbProperty("number")
+ @NotNull @Valid @DecimalMin("32.1") @DecimalMax("543.2")public BigDecimal getNumber() {
+ return number;
+ }
+
+ @JsonbProperty("number")
+ public void setNumber(BigDecimal number) {
+ this.number = number;
+ }
+
+ /**
+ * minimum: 54.3
+ * maximum: 987.6
+ **/
+ public FormatTest _float(Float _float) {
+ this._float = _float;
+ return this;
+ }
+
+
+ @ApiModelProperty(value = "")
+ @JsonbProperty("float")
+ @DecimalMin("54.3") @DecimalMax("987.6")public Float getFloat() {
+ return _float;
+ }
+
+ @JsonbProperty("float")
+ public void setFloat(Float _float) {
+ this._float = _float;
+ }
+
+ /**
+ * minimum: 67.8
+ * maximum: 123.4
+ **/
+ public FormatTest _double(Double _double) {
+ this._double = _double;
+ return this;
+ }
+
+
+ @ApiModelProperty(value = "")
+ @JsonbProperty("double")
+ @DecimalMin("67.8") @DecimalMax("123.4")public Double getDouble() {
+ return _double;
+ }
+
+ @JsonbProperty("double")
+ public void setDouble(Double _double) {
+ this._double = _double;
+ }
+
+ /**
+ **/
+ public FormatTest decimal(BigDecimal decimal) {
+ this.decimal = decimal;
+ return this;
+ }
+
+
+ @ApiModelProperty(value = "")
+ @JsonbProperty("decimal")
+ @Valid public BigDecimal getDecimal() {
+ return decimal;
+ }
+
+ @JsonbProperty("decimal")
+ public void setDecimal(BigDecimal decimal) {
+ this.decimal = decimal;
+ }
+
+ /**
+ **/
+ public FormatTest string(String string) {
+ this.string = string;
+ return this;
+ }
+
+
+ @ApiModelProperty(value = "")
+ @JsonbProperty("string")
+ @Pattern(regexp="/[a-z]/i")public String getString() {
+ return string;
+ }
+
+ @JsonbProperty("string")
+ public void setString(String string) {
+ this.string = string;
+ }
+
+ /**
+ **/
+ public FormatTest _byte(byte[] _byte) {
+ this._byte = _byte;
+ return this;
+ }
+
+
+ @ApiModelProperty(required = true, value = "")
+ @JsonbProperty("byte")
+ @NotNull public byte[] getByte() {
+ return _byte;
+ }
+
+ @JsonbProperty("byte")
+ public void setByte(byte[] _byte) {
+ this._byte = _byte;
+ }
+
+ /**
+ **/
+ public FormatTest binary(File binary) {
+ this.binary = binary;
+ return this;
+ }
+
+
+ @ApiModelProperty(value = "")
+ @JsonbProperty("binary")
+ public File getBinary() {
+ return binary;
+ }
+
+ @JsonbProperty("binary")
+ public void setBinary(File binary) {
+ this.binary = binary;
+ }
+
+ /**
+ **/
+ public FormatTest date(LocalDate date) {
+ this.date = date;
+ return this;
+ }
+
+
+ @ApiModelProperty(required = true, value = "")
+ @JsonbProperty("date")
+ @NotNull public LocalDate getDate() {
+ return date;
+ }
+
+ @JsonbProperty("date")
+ public void setDate(LocalDate date) {
+ this.date = date;
+ }
+
+ /**
+ **/
+ public FormatTest dateTime(OffsetDateTime dateTime) {
+ this.dateTime = dateTime;
+ return this;
+ }
+
+
+ @ApiModelProperty(value = "")
+ @JsonbProperty("dateTime")
+ public OffsetDateTime getDateTime() {
+ return dateTime;
+ }
+
+ @JsonbProperty("dateTime")
+ public void setDateTime(OffsetDateTime dateTime) {
+ this.dateTime = dateTime;
+ }
+
+ /**
+ **/
+ public FormatTest uuid(UUID uuid) {
+ this.uuid = uuid;
+ return this;
+ }
+
+
+ @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "")
+ @JsonbProperty("uuid")
+ public UUID getUuid() {
+ return uuid;
+ }
+
+ @JsonbProperty("uuid")
+ public void setUuid(UUID uuid) {
+ this.uuid = uuid;
+ }
+
+ /**
+ **/
+ public FormatTest password(String password) {
+ this.password = password;
+ return this;
+ }
+
+
+ @ApiModelProperty(required = true, value = "")
+ @JsonbProperty("password")
+ @NotNull @Size(min=10,max=64)public String getPassword() {
+ return password;
+ }
+
+ @JsonbProperty("password")
+ public void setPassword(String password) {
+ this.password = password;
+ }
+
+ /**
+ * A string that is a 10 digit number. Can have leading zeros.
+ **/
+ public FormatTest patternWithDigits(String patternWithDigits) {
+ this.patternWithDigits = patternWithDigits;
+ return this;
+ }
+
+
+ @ApiModelProperty(value = "A string that is a 10 digit number. Can have leading zeros.")
+ @JsonbProperty("pattern_with_digits")
+ @Pattern(regexp="^\\d{10}$")public String getPatternWithDigits() {
+ return patternWithDigits;
+ }
+
+ @JsonbProperty("pattern_with_digits")
+ public void setPatternWithDigits(String patternWithDigits) {
+ this.patternWithDigits = patternWithDigits;
+ }
+
+ /**
+ * A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01.
+ **/
+ public FormatTest patternWithDigitsAndDelimiter(String patternWithDigitsAndDelimiter) {
+ this.patternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter;
+ return this;
+ }
+
+
+ @ApiModelProperty(value = "A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01.")
+ @JsonbProperty("pattern_with_digits_and_delimiter")
+ @Pattern(regexp="/^image_\\d{1,3}$/i")public String getPatternWithDigitsAndDelimiter() {
+ return patternWithDigitsAndDelimiter;
+ }
+
+ @JsonbProperty("pattern_with_digits_and_delimiter")
+ public void setPatternWithDigitsAndDelimiter(String patternWithDigitsAndDelimiter) {
+ this.patternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter;
+ }
+
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ FormatTest formatTest = (FormatTest) o;
+ return Objects.equals(this.integer, formatTest.integer) &&
+ Objects.equals(this.int32, formatTest.int32) &&
+ Objects.equals(this.int64, formatTest.int64) &&
+ Objects.equals(this.number, formatTest.number) &&
+ Objects.equals(this._float, formatTest._float) &&
+ Objects.equals(this._double, formatTest._double) &&
+ Objects.equals(this.decimal, formatTest.decimal) &&
+ Objects.equals(this.string, formatTest.string) &&
+ Arrays.equals(this._byte, formatTest._byte) &&
+ Objects.equals(this.binary, formatTest.binary) &&
+ Objects.equals(this.date, formatTest.date) &&
+ Objects.equals(this.dateTime, formatTest.dateTime) &&
+ Objects.equals(this.uuid, formatTest.uuid) &&
+ Objects.equals(this.password, formatTest.password) &&
+ Objects.equals(this.patternWithDigits, formatTest.patternWithDigits) &&
+ Objects.equals(this.patternWithDigitsAndDelimiter, formatTest.patternWithDigitsAndDelimiter);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(integer, int32, int64, number, _float, _double, decimal, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password, patternWithDigits, patternWithDigitsAndDelimiter);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class FormatTest {\n");
+
+ sb.append(" integer: ").append(toIndentedString(integer)).append("\n");
+ sb.append(" int32: ").append(toIndentedString(int32)).append("\n");
+ sb.append(" int64: ").append(toIndentedString(int64)).append("\n");
+ sb.append(" number: ").append(toIndentedString(number)).append("\n");
+ sb.append(" _float: ").append(toIndentedString(_float)).append("\n");
+ sb.append(" _double: ").append(toIndentedString(_double)).append("\n");
+ sb.append(" decimal: ").append(toIndentedString(decimal)).append("\n");
+ sb.append(" string: ").append(toIndentedString(string)).append("\n");
+ sb.append(" _byte: ").append(toIndentedString(_byte)).append("\n");
+ sb.append(" binary: ").append(toIndentedString(binary)).append("\n");
+ sb.append(" date: ").append(toIndentedString(date)).append("\n");
+ sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n");
+ sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n");
+ sb.append(" password: ").append("*").append("\n");
+ sb.append(" patternWithDigits: ").append(toIndentedString(patternWithDigits)).append("\n");
+ sb.append(" patternWithDigitsAndDelimiter: ").append(toIndentedString(patternWithDigitsAndDelimiter)).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) {
+ return o == null ? "null" : o.toString().replace("\n", "\n ");
+ }
+
+
+ public static FormatTestBuilder, ?> builder() {
+ return new FormatTestBuilderImpl();
+ }
+
+ private static final class FormatTestBuilderImpl extends FormatTestBuilder {
+
+ @Override
+ protected FormatTestBuilderImpl self() {
+ return this;
+ }
+
+ @Override
+ public FormatTest build() {
+ return new FormatTest(this);
+ }
+ }
+
+ public static abstract class FormatTestBuilder> {
+ private Integer integer;
+ private Integer int32;
+ private Long int64;
+ private BigDecimal number;
+ private Float _float;
+ private Double _double;
+ private BigDecimal decimal;
+ private String string;
+ private byte[] _byte;
+ private File binary;
+ private LocalDate date;
+ private OffsetDateTime dateTime;
+ private UUID uuid;
+ private String password;
+ private String patternWithDigits;
+ private String patternWithDigitsAndDelimiter;
+ protected abstract B self();
+
+ public abstract C build();
+
+ public B integer(Integer integer) {
+ this.integer = integer;
+ return self();
+ }
+ public B int32(Integer int32) {
+ this.int32 = int32;
+ return self();
+ }
+ public B int64(Long int64) {
+ this.int64 = int64;
+ return self();
+ }
+ public B number(BigDecimal number) {
+ this.number = number;
+ return self();
+ }
+ public B _float(Float _float) {
+ this._float = _float;
+ return self();
+ }
+ public B _double(Double _double) {
+ this._double = _double;
+ return self();
+ }
+ public B decimal(BigDecimal decimal) {
+ this.decimal = decimal;
+ return self();
+ }
+ public B string(String string) {
+ this.string = string;
+ return self();
+ }
+ public B _byte(byte[] _byte) {
+ this._byte = _byte;
+ return self();
+ }
+ public B binary(File binary) {
+ this.binary = binary;
+ return self();
+ }
+ public B date(LocalDate date) {
+ this.date = date;
+ return self();
+ }
+ public B dateTime(OffsetDateTime dateTime) {
+ this.dateTime = dateTime;
+ return self();
+ }
+ public B uuid(UUID uuid) {
+ this.uuid = uuid;
+ return self();
+ }
+ public B password(String password) {
+ this.password = password;
+ return self();
+ }
+ public B patternWithDigits(String patternWithDigits) {
+ this.patternWithDigits = patternWithDigits;
+ return self();
+ }
+ public B patternWithDigitsAndDelimiter(String patternWithDigitsAndDelimiter) {
+ this.patternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter;
+ return self();
+ }
+ }
+}
diff --git a/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java
new file mode 100644
index 000000000000..7404028417a9
--- /dev/null
+++ b/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java
@@ -0,0 +1,139 @@
+package org.openapitools.model;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.io.Serializable;
+import jakarta.validation.constraints.*;
+import jakarta.validation.Valid;
+
+import io.swagger.annotations.*;
+import java.util.Objects;
+import jakarta.json.bind.annotation.JsonbCreator;
+import jakarta.json.bind.annotation.JsonbProperty;
+
+
+
+@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 7.27.0-SNAPSHOT")
+public class HasOnlyReadOnly implements Serializable {
+ private String bar;
+ private String foo;
+
+ protected HasOnlyReadOnly(HasOnlyReadOnlyBuilder, ?> b) {
+ this.bar = b.bar;
+ this.foo = b.foo;
+ }
+
+ public HasOnlyReadOnly() {
+ }
+
+ /**
+ **/
+ public HasOnlyReadOnly bar(String bar) {
+ this.bar = bar;
+ return this;
+ }
+
+
+ @ApiModelProperty(value = "")
+ @JsonbProperty("bar")
+ public String getBar() {
+ return bar;
+ }
+
+ @JsonbProperty("bar")
+ public void setBar(String bar) {
+ this.bar = bar;
+ }
+
+ /**
+ **/
+ public HasOnlyReadOnly foo(String foo) {
+ this.foo = foo;
+ return this;
+ }
+
+
+ @ApiModelProperty(value = "")
+ @JsonbProperty("foo")
+ public String getFoo() {
+ return foo;
+ }
+
+ @JsonbProperty("foo")
+ public void setFoo(String foo) {
+ this.foo = foo;
+ }
+
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ HasOnlyReadOnly hasOnlyReadOnly = (HasOnlyReadOnly) o;
+ return Objects.equals(this.bar, hasOnlyReadOnly.bar) &&
+ Objects.equals(this.foo, hasOnlyReadOnly.foo);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(bar, foo);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class HasOnlyReadOnly {\n");
+
+ sb.append(" bar: ").append(toIndentedString(bar)).append("\n");
+ sb.append(" foo: ").append(toIndentedString(foo)).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) {
+ return o == null ? "null" : o.toString().replace("\n", "\n ");
+ }
+
+
+ public static HasOnlyReadOnlyBuilder, ?> builder() {
+ return new HasOnlyReadOnlyBuilderImpl();
+ }
+
+ private static final class HasOnlyReadOnlyBuilderImpl extends HasOnlyReadOnlyBuilder {
+
+ @Override
+ protected HasOnlyReadOnlyBuilderImpl self() {
+ return this;
+ }
+
+ @Override
+ public HasOnlyReadOnly build() {
+ return new HasOnlyReadOnly(this);
+ }
+ }
+
+ public static abstract class HasOnlyReadOnlyBuilder> {
+ private String bar;
+ private String foo;
+ protected abstract B self();
+
+ public abstract C build();
+
+ public B bar(String bar) {
+ this.bar = bar;
+ return self();
+ }
+ public B foo(String foo) {
+ this.foo = foo;
+ return self();
+ }
+ }
+}
diff --git a/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/HealthCheckResult.java b/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/HealthCheckResult.java
new file mode 100644
index 000000000000..ef7f23df653a
--- /dev/null
+++ b/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/HealthCheckResult.java
@@ -0,0 +1,113 @@
+package org.openapitools.model;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.io.Serializable;
+import jakarta.validation.constraints.*;
+import jakarta.validation.Valid;
+
+import io.swagger.annotations.*;
+import java.util.Objects;
+import jakarta.json.bind.annotation.JsonbCreator;
+import jakarta.json.bind.annotation.JsonbProperty;
+
+/**
+ * Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model.
+ **/
+@ApiModel(description = "Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model.")
+@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 7.27.0-SNAPSHOT")
+public class HealthCheckResult implements Serializable {
+ private String nullableMessage;
+
+ protected HealthCheckResult(HealthCheckResultBuilder, ?> b) {
+ this.nullableMessage = b.nullableMessage;
+ }
+
+ public HealthCheckResult() {
+ }
+
+ /**
+ **/
+ public HealthCheckResult nullableMessage(String nullableMessage) {
+ this.nullableMessage = nullableMessage;
+ return this;
+ }
+
+
+ @ApiModelProperty(value = "")
+ @JsonbProperty("NullableMessage")
+ public String getNullableMessage() {
+ return nullableMessage;
+ }
+
+ @JsonbProperty("NullableMessage")
+ public void setNullableMessage(String nullableMessage) {
+ this.nullableMessage = nullableMessage;
+ }
+
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ HealthCheckResult healthCheckResult = (HealthCheckResult) o;
+ return Objects.equals(this.nullableMessage, healthCheckResult.nullableMessage);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(nullableMessage);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class HealthCheckResult {\n");
+
+ sb.append(" nullableMessage: ").append(toIndentedString(nullableMessage)).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) {
+ return o == null ? "null" : o.toString().replace("\n", "\n ");
+ }
+
+
+ public static HealthCheckResultBuilder, ?> builder() {
+ return new HealthCheckResultBuilderImpl();
+ }
+
+ private static final class HealthCheckResultBuilderImpl extends HealthCheckResultBuilder {
+
+ @Override
+ protected HealthCheckResultBuilderImpl self() {
+ return this;
+ }
+
+ @Override
+ public HealthCheckResult build() {
+ return new HealthCheckResult(this);
+ }
+ }
+
+ public static abstract class HealthCheckResultBuilder> {
+ private String nullableMessage;
+ protected abstract B self();
+
+ public abstract C build();
+
+ public B nullableMessage(String nullableMessage) {
+ this.nullableMessage = nullableMessage;
+ return self();
+ }
+ }
+}
diff --git a/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/IntegerEnum.java b/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/IntegerEnum.java
new file mode 100644
index 000000000000..7fcd31cc3440
--- /dev/null
+++ b/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/IntegerEnum.java
@@ -0,0 +1,83 @@
+package org.openapitools.model;
+
+import java.io.Serializable;
+import jakarta.validation.constraints.*;
+import jakarta.validation.Valid;
+
+import jakarta.json.bind.annotation.JsonbTypeDeserializer;
+import jakarta.json.bind.annotation.JsonbTypeSerializer;
+import jakarta.json.bind.serializer.DeserializationContext;
+import jakarta.json.bind.serializer.JsonbDeserializer;
+import jakarta.json.bind.serializer.JsonbSerializer;
+import jakarta.json.bind.serializer.SerializationContext;
+import jakarta.json.stream.JsonGenerator;
+import jakarta.json.stream.JsonParser;
+
+/**
+ * Gets or Sets IntegerEnum
+ */
+@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 7.27.0-SNAPSHOT")
+@JsonbTypeSerializer(IntegerEnum.Serializer.class)
+@JsonbTypeDeserializer(IntegerEnum.Deserializer.class)
+public enum IntegerEnum {
+
+ NUMBER_1(1),
+
+ NUMBER_2(2),
+
+ NUMBER_3(3);
+
+ private Integer value;
+
+ IntegerEnum(Integer value) {
+ this.value = value;
+ }
+
+ /**
+ * Convert a String into Integer, as specified in the
+ * See JAX RS 2.0 Specification, section 3.2, p. 12
+ */
+ public static IntegerEnum fromString(String s) {
+ for (IntegerEnum b : IntegerEnum.values()) {
+ // using Objects.toString() to be safe if value type non-object type
+ // because types like 'int' etc. will be auto-boxed
+ if (java.util.Objects.toString(b.value).equals(s)) {
+ return b;
+ }
+ }
+ throw new IllegalArgumentException("Unexpected string value '" + s + "'");
+ }
+
+ @Override
+ public String toString() {
+ return String.valueOf(value);
+ }
+
+ public static IntegerEnum fromValue(Integer value) {
+ for (IntegerEnum b : IntegerEnum.values()) {
+ if (b.value.equals(value)) {
+ return b;
+ }
+ }
+ throw new IllegalArgumentException("Unexpected value '" + value + "'");
+ }
+
+ public static final class Serializer implements JsonbSerializer {
+ @Override
+ public void serialize(IntegerEnum obj, JsonGenerator generator, SerializationContext ctx) {
+ ctx.serialize(obj.value, generator);
+ }
+ }
+
+ public static final class Deserializer implements JsonbDeserializer {
+ @Override
+ public IntegerEnum deserialize(JsonParser parser, DeserializationContext ctx, java.lang.reflect.Type rtType) {
+ if (parser.getValue().getValueType() == jakarta.json.JsonValue.ValueType.NULL) {
+ return null;
+ }
+ return fromValue(ctx.deserialize(Integer.class, parser));
+ }
+ }
+}
+
+
diff --git a/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/MapTest.java b/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/MapTest.java
new file mode 100644
index 000000000000..4ebadf4820e1
--- /dev/null
+++ b/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/MapTest.java
@@ -0,0 +1,333 @@
+package org.openapitools.model;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.util.HashMap;
+import java.util.Map;
+import java.io.Serializable;
+import jakarta.validation.constraints.*;
+import jakarta.validation.Valid;
+
+import io.swagger.annotations.*;
+import java.util.Objects;
+import jakarta.json.bind.annotation.JsonbCreator;
+import jakarta.json.bind.annotation.JsonbProperty;
+import jakarta.json.bind.annotation.JsonbTypeDeserializer;
+import jakarta.json.bind.annotation.JsonbTypeSerializer;
+import jakarta.json.bind.serializer.DeserializationContext;
+import jakarta.json.bind.serializer.JsonbDeserializer;
+import jakarta.json.bind.serializer.JsonbSerializer;
+import jakarta.json.bind.serializer.SerializationContext;
+import jakarta.json.stream.JsonGenerator;
+import jakarta.json.stream.JsonParser;
+
+
+
+@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 7.27.0-SNAPSHOT")
+public class MapTest implements Serializable {
+ private Map> mapMapOfString = new HashMap<>();
+ @JsonbTypeSerializer(InnerEnum.Serializer.class)
+ @JsonbTypeDeserializer(InnerEnum.Deserializer.class)
+ public enum InnerEnum {
+
+ UPPER(String.valueOf("UPPER")), LOWER(String.valueOf("lower"));
+
+
+ private String value;
+
+ InnerEnum (String v) {
+ value = v;
+ }
+
+ public String value() {
+ return value;
+ }
+
+ @Override
+ public String toString() {
+ return String.valueOf(value);
+ }
+
+ /**
+ * Convert a String into String, as specified in the
+ * See JAX RS 2.0 Specification, section 3.2, p. 12
+ */
+ public static InnerEnum fromString(String s) {
+ for (InnerEnum b : InnerEnum.values()) {
+ // using Objects.toString() to be safe if value type non-object type
+ // because types like 'int' etc. will be auto-boxed
+ if (java.util.Objects.toString(b.value).equals(s)) {
+ return b;
+ }
+ }
+ throw new IllegalArgumentException("Unexpected string value '" + s + "'");
+ }
+
+ public static InnerEnum fromValue(String value) {
+ for (InnerEnum b : InnerEnum.values()) {
+ if (b.value.equals(value)) {
+ return b;
+ }
+ }
+ throw new IllegalArgumentException("Unexpected value '" + value + "'");
+ }
+
+ public static final class Serializer implements JsonbSerializer {
+ @Override
+ public void serialize(InnerEnum obj, JsonGenerator generator, SerializationContext ctx) {
+ ctx.serialize(obj.value, generator);
+ }
+ }
+
+ public static final class Deserializer implements JsonbDeserializer {
+ @Override
+ public InnerEnum deserialize(JsonParser parser, DeserializationContext ctx, java.lang.reflect.Type rtType) {
+ if (parser.getValue().getValueType() == jakarta.json.JsonValue.ValueType.NULL) {
+ return null;
+ }
+ return fromValue(ctx.deserialize(String.class, parser));
+ }
+ }
+}
+
+ private Map mapOfEnumString = new HashMap<>();
+ private Map directMap = new HashMap<>();
+ private Map indirectMap = new HashMap<>();
+
+ protected MapTest(MapTestBuilder, ?> b) {
+ this.mapMapOfString = b.mapMapOfString;
+ this.mapOfEnumString = b.mapOfEnumString;
+ this.directMap = b.directMap;
+ this.indirectMap = b.indirectMap;
+ }
+
+ public MapTest() {
+ }
+
+ /**
+ **/
+ public MapTest mapMapOfString(Map> mapMapOfString) {
+ this.mapMapOfString = mapMapOfString;
+ return this;
+ }
+
+
+ @ApiModelProperty(value = "")
+ @JsonbProperty("map_map_of_string")
+ public Map> getMapMapOfString() {
+ return mapMapOfString;
+ }
+
+ @JsonbProperty("map_map_of_string")
+ public void setMapMapOfString(Map> mapMapOfString) {
+ this.mapMapOfString = mapMapOfString;
+ }
+
+ public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) {
+ if (this.mapMapOfString == null) {
+ this.mapMapOfString = new HashMap<>();
+ }
+
+ this.mapMapOfString.put(key, mapMapOfStringItem);
+ return this;
+ }
+
+ public MapTest removeMapMapOfStringItem(String key) {
+ if (this.mapMapOfString != null) {
+ this.mapMapOfString.remove(key);
+ }
+
+ return this;
+ }
+ /**
+ **/
+ public MapTest mapOfEnumString(Map mapOfEnumString) {
+ this.mapOfEnumString = mapOfEnumString;
+ return this;
+ }
+
+
+ @ApiModelProperty(value = "")
+ @JsonbProperty("map_of_enum_string")
+ public Map getMapOfEnumString() {
+ return mapOfEnumString;
+ }
+
+ @JsonbProperty("map_of_enum_string")
+ public void setMapOfEnumString(Map mapOfEnumString) {
+ this.mapOfEnumString = mapOfEnumString;
+ }
+
+ public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) {
+ if (this.mapOfEnumString == null) {
+ this.mapOfEnumString = new HashMap<>();
+ }
+
+ this.mapOfEnumString.put(key, mapOfEnumStringItem);
+ return this;
+ }
+
+ public MapTest removeMapOfEnumStringItem(String key) {
+ if (this.mapOfEnumString != null) {
+ this.mapOfEnumString.remove(key);
+ }
+
+ return this;
+ }
+ /**
+ **/
+ public MapTest directMap(Map directMap) {
+ this.directMap = directMap;
+ return this;
+ }
+
+
+ @ApiModelProperty(value = "")
+ @JsonbProperty("direct_map")
+ public Map getDirectMap() {
+ return directMap;
+ }
+
+ @JsonbProperty("direct_map")
+ public void setDirectMap(Map directMap) {
+ this.directMap = directMap;
+ }
+
+ public MapTest putDirectMapItem(String key, Boolean directMapItem) {
+ if (this.directMap == null) {
+ this.directMap = new HashMap<>();
+ }
+
+ this.directMap.put(key, directMapItem);
+ return this;
+ }
+
+ public MapTest removeDirectMapItem(String key) {
+ if (this.directMap != null) {
+ this.directMap.remove(key);
+ }
+
+ return this;
+ }
+ /**
+ **/
+ public MapTest indirectMap(Map indirectMap) {
+ this.indirectMap = indirectMap;
+ return this;
+ }
+
+
+ @ApiModelProperty(value = "")
+ @JsonbProperty("indirect_map")
+ public Map getIndirectMap() {
+ return indirectMap;
+ }
+
+ @JsonbProperty("indirect_map")
+ public void setIndirectMap(Map indirectMap) {
+ this.indirectMap = indirectMap;
+ }
+
+ public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) {
+ if (this.indirectMap == null) {
+ this.indirectMap = new HashMap<>();
+ }
+
+ this.indirectMap.put(key, indirectMapItem);
+ return this;
+ }
+
+ public MapTest removeIndirectMapItem(String key) {
+ if (this.indirectMap != null) {
+ this.indirectMap.remove(key);
+ }
+
+ return this;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ MapTest mapTest = (MapTest) o;
+ return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) &&
+ Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString) &&
+ Objects.equals(this.directMap, mapTest.directMap) &&
+ Objects.equals(this.indirectMap, mapTest.indirectMap);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class MapTest {\n");
+
+ sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n");
+ sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n");
+ sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n");
+ sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).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) {
+ return o == null ? "null" : o.toString().replace("\n", "\n ");
+ }
+
+
+ public static MapTestBuilder, ?> builder() {
+ return new MapTestBuilderImpl();
+ }
+
+ private static final class MapTestBuilderImpl extends MapTestBuilder {
+
+ @Override
+ protected MapTestBuilderImpl self() {
+ return this;
+ }
+
+ @Override
+ public MapTest build() {
+ return new MapTest(this);
+ }
+ }
+
+ public static abstract class MapTestBuilder> {
+ private Map> mapMapOfString = new HashMap<>();
+ private Map mapOfEnumString = new HashMap<>();
+ private Map directMap = new HashMap<>();
+ private Map indirectMap = new HashMap<>();
+ protected abstract B self();
+
+ public abstract C build();
+
+ public B mapMapOfString(Map> mapMapOfString) {
+ this.mapMapOfString = mapMapOfString;
+ return self();
+ }
+ public B mapOfEnumString(Map mapOfEnumString) {
+ this.mapOfEnumString = mapOfEnumString;
+ return self();
+ }
+ public B directMap(Map directMap) {
+ this.directMap = directMap;
+ return self();
+ }
+ public B indirectMap(Map indirectMap) {
+ this.indirectMap = indirectMap;
+ return self();
+ }
+ }
+}
diff --git a/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java
new file mode 100644
index 000000000000..cfd6aa3fe2a1
--- /dev/null
+++ b/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java
@@ -0,0 +1,188 @@
+package org.openapitools.model;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.time.OffsetDateTime;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.UUID;
+import org.openapitools.model.Animal;
+import java.io.Serializable;
+import jakarta.validation.constraints.*;
+import jakarta.validation.Valid;
+
+import io.swagger.annotations.*;
+import java.util.Objects;
+import jakarta.json.bind.annotation.JsonbCreator;
+import jakarta.json.bind.annotation.JsonbProperty;
+
+
+
+@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 7.27.0-SNAPSHOT")
+public class MixedPropertiesAndAdditionalPropertiesClass implements Serializable {
+ private UUID uuid;
+ private OffsetDateTime dateTime;
+ private Map map = new HashMap<>();
+
+ protected MixedPropertiesAndAdditionalPropertiesClass(MixedPropertiesAndAdditionalPropertiesClassBuilder, ?> b) {
+ this.uuid = b.uuid;
+ this.dateTime = b.dateTime;
+ this.map = b.map;
+ }
+
+ public MixedPropertiesAndAdditionalPropertiesClass() {
+ }
+
+ /**
+ **/
+ public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) {
+ this.uuid = uuid;
+ return this;
+ }
+
+
+ @ApiModelProperty(value = "")
+ @JsonbProperty("uuid")
+ public UUID getUuid() {
+ return uuid;
+ }
+
+ @JsonbProperty("uuid")
+ public void setUuid(UUID uuid) {
+ this.uuid = uuid;
+ }
+
+ /**
+ **/
+ public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateTime) {
+ this.dateTime = dateTime;
+ return this;
+ }
+
+
+ @ApiModelProperty(value = "")
+ @JsonbProperty("dateTime")
+ public OffsetDateTime getDateTime() {
+ return dateTime;
+ }
+
+ @JsonbProperty("dateTime")
+ public void setDateTime(OffsetDateTime dateTime) {
+ this.dateTime = dateTime;
+ }
+
+ /**
+ **/
+ public MixedPropertiesAndAdditionalPropertiesClass map(Map map) {
+ this.map = map;
+ return this;
+ }
+
+
+ @ApiModelProperty(value = "")
+ @JsonbProperty("map")
+ public Map getMap() {
+ return map;
+ }
+
+ @JsonbProperty("map")
+ public void setMap(Map map) {
+ this.map = map;
+ }
+
+ public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) {
+ if (this.map == null) {
+ this.map = new HashMap<>();
+ }
+
+ this.map.put(key, mapItem);
+ return this;
+ }
+
+ public MixedPropertiesAndAdditionalPropertiesClass removeMapItem(String key) {
+ if (this.map != null) {
+ this.map.remove(key);
+ }
+
+ return this;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ MixedPropertiesAndAdditionalPropertiesClass mixedPropertiesAndAdditionalPropertiesClass = (MixedPropertiesAndAdditionalPropertiesClass) o;
+ return Objects.equals(this.uuid, mixedPropertiesAndAdditionalPropertiesClass.uuid) &&
+ Objects.equals(this.dateTime, mixedPropertiesAndAdditionalPropertiesClass.dateTime) &&
+ Objects.equals(this.map, mixedPropertiesAndAdditionalPropertiesClass.map);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(uuid, dateTime, map);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class MixedPropertiesAndAdditionalPropertiesClass {\n");
+
+ sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n");
+ sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n");
+ sb.append(" map: ").append(toIndentedString(map)).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) {
+ return o == null ? "null" : o.toString().replace("\n", "\n ");
+ }
+
+
+ public static MixedPropertiesAndAdditionalPropertiesClassBuilder, ?> builder() {
+ return new MixedPropertiesAndAdditionalPropertiesClassBuilderImpl();
+ }
+
+ private static final class MixedPropertiesAndAdditionalPropertiesClassBuilderImpl extends MixedPropertiesAndAdditionalPropertiesClassBuilder {
+
+ @Override
+ protected MixedPropertiesAndAdditionalPropertiesClassBuilderImpl self() {
+ return this;
+ }
+
+ @Override
+ public MixedPropertiesAndAdditionalPropertiesClass build() {
+ return new MixedPropertiesAndAdditionalPropertiesClass(this);
+ }
+ }
+
+ public static abstract class MixedPropertiesAndAdditionalPropertiesClassBuilder> {
+ private UUID uuid;
+ private OffsetDateTime dateTime;
+ private Map map = new HashMap<>();
+ protected abstract B self();
+
+ public abstract C build();
+
+ public B uuid(UUID uuid) {
+ this.uuid = uuid;
+ return self();
+ }
+ public B dateTime(OffsetDateTime dateTime) {
+ this.dateTime = dateTime;
+ return self();
+ }
+ public B map(Map map) {
+ this.map = map;
+ return self();
+ }
+ }
+}
diff --git a/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/Model200Response.java
new file mode 100644
index 000000000000..df05285aea14
--- /dev/null
+++ b/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/Model200Response.java
@@ -0,0 +1,141 @@
+package org.openapitools.model;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.io.Serializable;
+import jakarta.validation.constraints.*;
+import jakarta.validation.Valid;
+
+import io.swagger.annotations.*;
+import java.util.Objects;
+import jakarta.json.bind.annotation.JsonbCreator;
+import jakarta.json.bind.annotation.JsonbProperty;
+
+/**
+ * Model for testing model name starting with number
+ **/
+@ApiModel(description = "Model for testing model name starting with number")
+@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 7.27.0-SNAPSHOT")
+public class Model200Response implements Serializable {
+ private Integer name;
+ private String propertyClass;
+
+ protected Model200Response(Model200ResponseBuilder, ?> b) {
+ this.name = b.name;
+ this.propertyClass = b.propertyClass;
+ }
+
+ public Model200Response() {
+ }
+
+ /**
+ **/
+ public Model200Response name(Integer name) {
+ this.name = name;
+ return this;
+ }
+
+
+ @ApiModelProperty(value = "")
+ @JsonbProperty("name")
+ public Integer getName() {
+ return name;
+ }
+
+ @JsonbProperty("name")
+ public void setName(Integer name) {
+ this.name = name;
+ }
+
+ /**
+ **/
+ public Model200Response propertyClass(String propertyClass) {
+ this.propertyClass = propertyClass;
+ return this;
+ }
+
+
+ @ApiModelProperty(value = "")
+ @JsonbProperty("class")
+ public String getPropertyClass() {
+ return propertyClass;
+ }
+
+ @JsonbProperty("class")
+ public void setPropertyClass(String propertyClass) {
+ this.propertyClass = propertyClass;
+ }
+
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ Model200Response _200response = (Model200Response) o;
+ return Objects.equals(this.name, _200response.name) &&
+ Objects.equals(this.propertyClass, _200response.propertyClass);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(name, propertyClass);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class Model200Response {\n");
+
+ sb.append(" name: ").append(toIndentedString(name)).append("\n");
+ sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).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) {
+ return o == null ? "null" : o.toString().replace("\n", "\n ");
+ }
+
+
+ public static Model200ResponseBuilder, ?> builder() {
+ return new Model200ResponseBuilderImpl();
+ }
+
+ private static final class Model200ResponseBuilderImpl extends Model200ResponseBuilder {
+
+ @Override
+ protected Model200ResponseBuilderImpl self() {
+ return this;
+ }
+
+ @Override
+ public Model200Response build() {
+ return new Model200Response(this);
+ }
+ }
+
+ public static abstract class Model200ResponseBuilder> {
+ private Integer name;
+ private String propertyClass;
+ protected abstract B self();
+
+ public abstract C build();
+
+ public B name(Integer name) {
+ this.name = name;
+ return self();
+ }
+ public B propertyClass(String propertyClass) {
+ this.propertyClass = propertyClass;
+ return self();
+ }
+ }
+}
diff --git a/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/ModelApiResponse.java
new file mode 100644
index 000000000000..de8ef112e0d8
--- /dev/null
+++ b/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/ModelApiResponse.java
@@ -0,0 +1,167 @@
+package org.openapitools.model;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.io.Serializable;
+import jakarta.validation.constraints.*;
+import jakarta.validation.Valid;
+
+import io.swagger.annotations.*;
+import java.util.Objects;
+import jakarta.json.bind.annotation.JsonbCreator;
+import jakarta.json.bind.annotation.JsonbProperty;
+
+
+
+@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 7.27.0-SNAPSHOT")
+public class ModelApiResponse implements Serializable {
+ private Integer code;
+ private String type;
+ private String message;
+
+ protected ModelApiResponse(ModelApiResponseBuilder, ?> b) {
+ this.code = b.code;
+ this.type = b.type;
+ this.message = b.message;
+ }
+
+ public ModelApiResponse() {
+ }
+
+ /**
+ **/
+ public ModelApiResponse code(Integer code) {
+ this.code = code;
+ return this;
+ }
+
+
+ @ApiModelProperty(value = "")
+ @JsonbProperty("code")
+ public Integer getCode() {
+ return code;
+ }
+
+ @JsonbProperty("code")
+ public void setCode(Integer code) {
+ this.code = code;
+ }
+
+ /**
+ **/
+ public ModelApiResponse type(String type) {
+ this.type = type;
+ return this;
+ }
+
+
+ @ApiModelProperty(value = "")
+ @JsonbProperty("type")
+ public String getType() {
+ return type;
+ }
+
+ @JsonbProperty("type")
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ /**
+ **/
+ public ModelApiResponse message(String message) {
+ this.message = message;
+ return this;
+ }
+
+
+ @ApiModelProperty(value = "")
+ @JsonbProperty("message")
+ public String getMessage() {
+ return message;
+ }
+
+ @JsonbProperty("message")
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ ModelApiResponse _apiResponse = (ModelApiResponse) o;
+ return Objects.equals(this.code, _apiResponse.code) &&
+ Objects.equals(this.type, _apiResponse.type) &&
+ Objects.equals(this.message, _apiResponse.message);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(code, type, message);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class ModelApiResponse {\n");
+
+ sb.append(" code: ").append(toIndentedString(code)).append("\n");
+ sb.append(" type: ").append(toIndentedString(type)).append("\n");
+ sb.append(" message: ").append(toIndentedString(message)).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) {
+ return o == null ? "null" : o.toString().replace("\n", "\n ");
+ }
+
+
+ public static ModelApiResponseBuilder, ?> builder() {
+ return new ModelApiResponseBuilderImpl();
+ }
+
+ private static final class ModelApiResponseBuilderImpl extends ModelApiResponseBuilder {
+
+ @Override
+ protected ModelApiResponseBuilderImpl self() {
+ return this;
+ }
+
+ @Override
+ public ModelApiResponse build() {
+ return new ModelApiResponse(this);
+ }
+ }
+
+ public static abstract class ModelApiResponseBuilder> {
+ private Integer code;
+ private String type;
+ private String message;
+ protected abstract B self();
+
+ public abstract C build();
+
+ public B code(Integer code) {
+ this.code = code;
+ return self();
+ }
+ public B type(String type) {
+ this.type = type;
+ return self();
+ }
+ public B message(String message) {
+ this.message = message;
+ return self();
+ }
+ }
+}
diff --git a/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/ModelFile.java b/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/ModelFile.java
new file mode 100644
index 000000000000..fc6185474e4f
--- /dev/null
+++ b/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/ModelFile.java
@@ -0,0 +1,114 @@
+package org.openapitools.model;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.io.Serializable;
+import jakarta.validation.constraints.*;
+import jakarta.validation.Valid;
+
+import io.swagger.annotations.*;
+import java.util.Objects;
+import jakarta.json.bind.annotation.JsonbCreator;
+import jakarta.json.bind.annotation.JsonbProperty;
+
+/**
+ * Must be named `File` for test.
+ **/
+@ApiModel(description = "Must be named `File` for test.")
+@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 7.27.0-SNAPSHOT")
+public class ModelFile implements Serializable {
+ private String sourceURI;
+
+ protected ModelFile(ModelFileBuilder, ?> b) {
+ this.sourceURI = b.sourceURI;
+ }
+
+ public ModelFile() {
+ }
+
+ /**
+ * Test capitalization
+ **/
+ public ModelFile sourceURI(String sourceURI) {
+ this.sourceURI = sourceURI;
+ return this;
+ }
+
+
+ @ApiModelProperty(value = "Test capitalization")
+ @JsonbProperty("sourceURI")
+ public String getSourceURI() {
+ return sourceURI;
+ }
+
+ @JsonbProperty("sourceURI")
+ public void setSourceURI(String sourceURI) {
+ this.sourceURI = sourceURI;
+ }
+
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ ModelFile _file = (ModelFile) o;
+ return Objects.equals(this.sourceURI, _file.sourceURI);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(sourceURI);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class ModelFile {\n");
+
+ sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).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) {
+ return o == null ? "null" : o.toString().replace("\n", "\n ");
+ }
+
+
+ public static ModelFileBuilder, ?> builder() {
+ return new ModelFileBuilderImpl();
+ }
+
+ private static final class ModelFileBuilderImpl extends ModelFileBuilder {
+
+ @Override
+ protected ModelFileBuilderImpl self() {
+ return this;
+ }
+
+ @Override
+ public ModelFile build() {
+ return new ModelFile(this);
+ }
+ }
+
+ public static abstract class ModelFileBuilder> {
+ private String sourceURI;
+ protected abstract B self();
+
+ public abstract C build();
+
+ public B sourceURI(String sourceURI) {
+ this.sourceURI = sourceURI;
+ return self();
+ }
+ }
+}
diff --git a/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/ModelList.java b/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/ModelList.java
new file mode 100644
index 000000000000..f84e169339ea
--- /dev/null
+++ b/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/ModelList.java
@@ -0,0 +1,111 @@
+package org.openapitools.model;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.io.Serializable;
+import jakarta.validation.constraints.*;
+import jakarta.validation.Valid;
+
+import io.swagger.annotations.*;
+import java.util.Objects;
+import jakarta.json.bind.annotation.JsonbCreator;
+import jakarta.json.bind.annotation.JsonbProperty;
+
+
+
+@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 7.27.0-SNAPSHOT")
+public class ModelList implements Serializable {
+ private String _123list;
+
+ protected ModelList(ModelListBuilder, ?> b) {
+ this._123list = b._123list;
+ }
+
+ public ModelList() {
+ }
+
+ /**
+ **/
+ public ModelList _123list(String _123list) {
+ this._123list = _123list;
+ return this;
+ }
+
+
+ @ApiModelProperty(value = "")
+ @JsonbProperty("123-list")
+ public String get123list() {
+ return _123list;
+ }
+
+ @JsonbProperty("123-list")
+ public void set123list(String _123list) {
+ this._123list = _123list;
+ }
+
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ ModelList _list = (ModelList) o;
+ return Objects.equals(this._123list, _list._123list);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(_123list);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class ModelList {\n");
+
+ sb.append(" _123list: ").append(toIndentedString(_123list)).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) {
+ return o == null ? "null" : o.toString().replace("\n", "\n ");
+ }
+
+
+ public static ModelListBuilder, ?> builder() {
+ return new ModelListBuilderImpl();
+ }
+
+ private static final class ModelListBuilderImpl extends ModelListBuilder {
+
+ @Override
+ protected ModelListBuilderImpl self() {
+ return this;
+ }
+
+ @Override
+ public ModelList build() {
+ return new ModelList(this);
+ }
+ }
+
+ public static abstract class ModelListBuilder> {
+ private String _123list;
+ protected abstract B self();
+
+ public abstract C build();
+
+ public B _123list(String _123list) {
+ this._123list = _123list;
+ return self();
+ }
+ }
+}
diff --git a/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/ModelReturn.java
new file mode 100644
index 000000000000..56c13a58b41d
--- /dev/null
+++ b/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/ModelReturn.java
@@ -0,0 +1,113 @@
+package org.openapitools.model;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.io.Serializable;
+import jakarta.validation.constraints.*;
+import jakarta.validation.Valid;
+
+import io.swagger.annotations.*;
+import java.util.Objects;
+import jakarta.json.bind.annotation.JsonbCreator;
+import jakarta.json.bind.annotation.JsonbProperty;
+
+/**
+ * Model for testing reserved words
+ **/
+@ApiModel(description = "Model for testing reserved words")
+@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 7.27.0-SNAPSHOT")
+public class ModelReturn implements Serializable {
+ private Integer _return;
+
+ protected ModelReturn(ModelReturnBuilder, ?> b) {
+ this._return = b._return;
+ }
+
+ public ModelReturn() {
+ }
+
+ /**
+ **/
+ public ModelReturn _return(Integer _return) {
+ this._return = _return;
+ return this;
+ }
+
+
+ @ApiModelProperty(value = "")
+ @JsonbProperty("return")
+ public Integer getReturn() {
+ return _return;
+ }
+
+ @JsonbProperty("return")
+ public void setReturn(Integer _return) {
+ this._return = _return;
+ }
+
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ ModelReturn _return = (ModelReturn) o;
+ return Objects.equals(this._return, _return._return);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(_return);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class ModelReturn {\n");
+
+ sb.append(" _return: ").append(toIndentedString(_return)).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) {
+ return o == null ? "null" : o.toString().replace("\n", "\n ");
+ }
+
+
+ public static ModelReturnBuilder, ?> builder() {
+ return new ModelReturnBuilderImpl();
+ }
+
+ private static final class ModelReturnBuilderImpl extends ModelReturnBuilder {
+
+ @Override
+ protected ModelReturnBuilderImpl self() {
+ return this;
+ }
+
+ @Override
+ public ModelReturn build() {
+ return new ModelReturn(this);
+ }
+ }
+
+ public static abstract class ModelReturnBuilder> {
+ private Integer _return;
+ protected abstract B self();
+
+ public abstract C build();
+
+ public B _return(Integer _return) {
+ this._return = _return;
+ return self();
+ }
+ }
+}
diff --git a/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/Name.java b/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/Name.java
new file mode 100644
index 000000000000..d18e83feb65c
--- /dev/null
+++ b/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/Name.java
@@ -0,0 +1,204 @@
+package org.openapitools.model;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.io.Serializable;
+import jakarta.validation.constraints.*;
+import jakarta.validation.Valid;
+
+import io.swagger.annotations.*;
+import java.util.Objects;
+import jakarta.json.bind.annotation.JsonbCreator;
+import jakarta.json.bind.annotation.JsonbProperty;
+
+/**
+ * Model for testing model name same as property name
+ **/
+@ApiModel(description = "Model for testing model name same as property name")
+@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 7.27.0-SNAPSHOT")
+public class Name implements Serializable {
+ private Integer name;
+ private Integer snakeCase;
+ private String property;
+ private Integer _123number;
+
+ protected Name(NameBuilder, ?> b) {
+ this.name = b.name;
+ this.snakeCase = b.snakeCase;
+ this.property = b.property;
+ this._123number = b._123number;
+ }
+
+ public Name() {
+ }
+
+ @JsonbCreator
+ public Name(
+ @JsonbProperty("name") Integer name
+ ) {
+ this.name = name;
+ }
+
+ /**
+ **/
+ public Name name(Integer name) {
+ this.name = name;
+ return this;
+ }
+
+
+ @ApiModelProperty(required = true, value = "")
+ @JsonbProperty("name")
+ @NotNull public Integer getName() {
+ return name;
+ }
+
+ @JsonbProperty("name")
+ public void setName(Integer name) {
+ this.name = name;
+ }
+
+ /**
+ **/
+ public Name snakeCase(Integer snakeCase) {
+ this.snakeCase = snakeCase;
+ return this;
+ }
+
+
+ @ApiModelProperty(value = "")
+ @JsonbProperty("snake_case")
+ public Integer getSnakeCase() {
+ return snakeCase;
+ }
+
+ @JsonbProperty("snake_case")
+ public void setSnakeCase(Integer snakeCase) {
+ this.snakeCase = snakeCase;
+ }
+
+ /**
+ **/
+ public Name property(String property) {
+ this.property = property;
+ return this;
+ }
+
+
+ @ApiModelProperty(value = "")
+ @JsonbProperty("property")
+ public String getProperty() {
+ return property;
+ }
+
+ @JsonbProperty("property")
+ public void setProperty(String property) {
+ this.property = property;
+ }
+
+ /**
+ **/
+ public Name _123number(Integer _123number) {
+ this._123number = _123number;
+ return this;
+ }
+
+
+ @ApiModelProperty(value = "")
+ @JsonbProperty("123Number")
+ public Integer get123number() {
+ return _123number;
+ }
+
+ @JsonbProperty("123Number")
+ public void set123number(Integer _123number) {
+ this._123number = _123number;
+ }
+
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ Name name = (Name) o;
+ return Objects.equals(this.name, name.name) &&
+ Objects.equals(this.snakeCase, name.snakeCase) &&
+ Objects.equals(this.property, name.property) &&
+ Objects.equals(this._123number, name._123number);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(name, snakeCase, property, _123number);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class Name {\n");
+
+ sb.append(" name: ").append(toIndentedString(name)).append("\n");
+ sb.append(" snakeCase: ").append(toIndentedString(snakeCase)).append("\n");
+ sb.append(" property: ").append(toIndentedString(property)).append("\n");
+ sb.append(" _123number: ").append(toIndentedString(_123number)).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) {
+ return o == null ? "null" : o.toString().replace("\n", "\n ");
+ }
+
+
+ public static NameBuilder, ?> builder() {
+ return new NameBuilderImpl();
+ }
+
+ private static final class NameBuilderImpl extends NameBuilder {
+
+ @Override
+ protected NameBuilderImpl self() {
+ return this;
+ }
+
+ @Override
+ public Name build() {
+ return new Name(this);
+ }
+ }
+
+ public static abstract class NameBuilder> {
+ private Integer name;
+ private Integer snakeCase;
+ private String property;
+ private Integer _123number;
+ protected abstract B self();
+
+ public abstract C build();
+
+ public B name(Integer name) {
+ this.name = name;
+ return self();
+ }
+ public B snakeCase(Integer snakeCase) {
+ this.snakeCase = snakeCase;
+ return self();
+ }
+ public B property(String property) {
+ this.property = property;
+ return self();
+ }
+ public B _123number(Integer _123number) {
+ this._123number = _123number;
+ return self();
+ }
+ }
+}
diff --git a/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/NullableClass.java b/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/NullableClass.java
new file mode 100644
index 000000000000..d4e3709dab7e
--- /dev/null
+++ b/samples/server/petstore/jaxrs-spec-jsonb/src/gen/java/org/openapitools/model/NullableClass.java
@@ -0,0 +1,454 @@
+package org.openapitools.model;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.math.BigDecimal;
+import java.time.LocalDate;
+import java.time.OffsetDateTime;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.io.Serializable;
+import jakarta.validation.constraints.*;
+import jakarta.validation.Valid;
+
+import io.swagger.annotations.*;
+import java.util.Objects;
+import jakarta.json.bind.annotation.JsonbCreator;
+import jakarta.json.bind.annotation.JsonbProperty;
+
+
+
+@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 7.27.0-SNAPSHOT")
+public class NullableClass extends HashMap implements Serializable {
+ private Integer integerProp;
+ private BigDecimal numberProp;
+ private Boolean booleanProp;
+ private String stringProp;
+ private LocalDate dateProp;
+ private OffsetDateTime datetimeProp;
+ private List