From 89ffde57471ea320d183e5f37414dfff7af3be6d Mon Sep 17 00:00:00 2001 From: Christophe Moine Date: Tue, 1 Jul 2025 14:51:25 +0200 Subject: [PATCH 1/9] replace Response by RestResponse --- .../resources/JavaJaxRS/spec/libraries/quarkus/api.mustache | 2 +- .../JavaJaxRS/spec/libraries/quarkus/apiInterface.mustache | 2 +- .../JavaJaxRS/spec/libraries/quarkus/apiMethod.mustache | 2 +- .../spec/libraries/quarkus/returnAsyncTypeInterface.mustache | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/api.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/api.mustache index e82436be12fd..a79246fb64fd 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/api.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/api.mustache @@ -4,7 +4,7 @@ package {{package}}; {{/imports}} import {{javaxPackage}}.ws.rs.*; -import {{javaxPackage}}.ws.rs.core.Response; +import org.jboss.resteasy.reactive.RestResponse; {{#useGzipFeature}} import org.jboss.resteasy.annotations.GZIP; diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/apiInterface.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/apiInterface.mustache index c6318bffe05a..d39f99e93b61 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/apiInterface.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/apiInterface.mustache @@ -41,4 +41,4 @@ {{^vendorExtensions.x-java-is-response-void}}@org.eclipse.microprofile.openapi.annotations.media.Content(schema = @org.eclipse.microprofile.openapi.annotations.media.Schema(implementation = {{{baseType}}}.class{{#vendorExtensions.x-microprofile-open-api-return-schema-container}}, type = {{{.}}} {{/vendorExtensions.x-microprofile-open-api-return-schema-container}}{{#vendorExtensions.x-microprofile-open-api-return-unique-items}}, uniqueItems = true {{/vendorExtensions.x-microprofile-open-api-return-unique-items}})){{/vendorExtensions.x-java-is-response-void}} }){{^-last}},{{/-last}}{{/responses}} }){{/hasProduces}}{{/useMicroProfileOpenAPIAnnotations}} - {{#supportAsync}}{{>returnAsyncTypeInterface}}{{/supportAsync}}{{^supportAsync}}{{#returnResponse}}Response{{/returnResponse}}{{^returnResponse}}{{>returnTypeInterface}}{{/returnResponse}}{{/supportAsync}} {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>cookieParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{^-last}},{{/-last}}{{/allParams}}); \ No newline at end of file + {{#supportAsync}}{{>returnAsyncTypeInterface}}{{/supportAsync}}{{^supportAsync}}{{#returnResponse}}RestResponse<{{{returnType}}}>{{/returnResponse}}{{^returnResponse}}{{>returnTypeInterface}}{{/returnResponse}}{{/supportAsync}} {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>cookieParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{^-last}},{{/-last}}{{/allParams}}); \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/apiMethod.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/apiMethod.mustache index 5bd7a3e4e607..965d4f603975 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/apiMethod.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/apiMethod.mustache @@ -40,6 +40,6 @@ {{^vendorExtensions.x-java-is-response-void}}@org.eclipse.microprofile.openapi.annotations.media.Content(schema = @org.eclipse.microprofile.openapi.annotations.media.Schema(implementation = {{{baseType}}}.class{{#vendorExtensions.x-microprofile-open-api-return-schema-container}}, type = {{{.}}} {{/vendorExtensions.x-microprofile-open-api-return-schema-container}}{{#vendorExtensions.x-microprofile-open-api-return-unique-items}}, uniqueItems = true {{/vendorExtensions.x-microprofile-open-api-return-unique-items}})){{/vendorExtensions.x-java-is-response-void}} }){{^-last}},{{/-last}}{{/responses}} }){{/hasProduces}}{{/useMicroProfileOpenAPIAnnotations}} - public {{#supportAsync}}{{#useMutiny}}Uni{{/useMutiny}}{{^useMutiny}}CompletionStage{{/useMutiny}}<{{/supportAsync}}Response{{#supportAsync}}>{{/supportAsync}} {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>cookieParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{^-last}},{{/-last}}{{/allParams}}) { + public {{#supportAsync}}{{#useMutiny}}Uni{{/useMutiny}}{{^useMutiny}}CompletionStage{{/useMutiny}}<{{/supportAsync}}RestResponse<>{{#supportAsync}}>{{/supportAsync}} {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>cookieParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{^-last}},{{/-last}}{{/allParams}}) { return {{#supportAsync}}{{#useMutiny}}Uni.createFrom().item({{/useMutiny}}{{^useMutiny}}CompletableFuture.supplyAsync(() -> {{/useMutiny}}{{/supportAsync}}Response.ok().entity("magic!").build(){{#supportAsync}}){{/supportAsync}}; } \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/returnAsyncTypeInterface.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/returnAsyncTypeInterface.mustache index 93f1098e48da..7732cd33f7b3 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/returnAsyncTypeInterface.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/returnAsyncTypeInterface.mustache @@ -1 +1 @@ -{{#useMutiny}}Uni{{/useMutiny}}{{^useMutiny}}CompletionStage{{/useMutiny}}<{{#returnResponse}}Response{{/returnResponse}}{{^returnResponse}}{{#returnContainer}}{{#isMap}}Map{{/isMap}}{{#isArray}}{{{returnContainer}}}<{{{returnBaseType}}}>{{/isArray}}{{/returnContainer}}{{^returnContainer}}{{{returnBaseType}}}{{/returnContainer}}{{/returnResponse}}> \ No newline at end of file +{{#useMutiny}}Uni{{/useMutiny}}{{^useMutiny}}CompletionStage{{/useMutiny}}<{{#returnResponse}}RestResponse{{/returnResponse}}{{^returnResponse}}{{#returnContainer}}{{#isMap}}Map{{/isMap}}{{#isArray}}{{{returnContainer}}}<{{{returnBaseType}}}>{{/isArray}}{{/returnContainer}}{{^returnContainer}}{{{returnBaseType}}}{{/returnContainer}}{{/returnResponse}}> \ No newline at end of file From c65f03e18caceec03c8ba35c5fa68e6c7c49325f Mon Sep 17 00:00:00 2001 From: Christophe Moine Date: Thu, 3 Jul 2025 14:22:44 +0200 Subject: [PATCH 2/9] fix rest response for Async --- .../JavaJaxRS/spec/libraries/quarkus/apiMethod.mustache | 2 +- .../spec/libraries/quarkus/returnAsyncTypeInterface.mustache | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/apiMethod.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/apiMethod.mustache index 965d4f603975..de93ae00f326 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/apiMethod.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/apiMethod.mustache @@ -40,6 +40,6 @@ {{^vendorExtensions.x-java-is-response-void}}@org.eclipse.microprofile.openapi.annotations.media.Content(schema = @org.eclipse.microprofile.openapi.annotations.media.Schema(implementation = {{{baseType}}}.class{{#vendorExtensions.x-microprofile-open-api-return-schema-container}}, type = {{{.}}} {{/vendorExtensions.x-microprofile-open-api-return-schema-container}}{{#vendorExtensions.x-microprofile-open-api-return-unique-items}}, uniqueItems = true {{/vendorExtensions.x-microprofile-open-api-return-unique-items}})){{/vendorExtensions.x-java-is-response-void}} }){{^-last}},{{/-last}}{{/responses}} }){{/hasProduces}}{{/useMicroProfileOpenAPIAnnotations}} - public {{#supportAsync}}{{#useMutiny}}Uni{{/useMutiny}}{{^useMutiny}}CompletionStage{{/useMutiny}}<{{/supportAsync}}RestResponse<>{{#supportAsync}}>{{/supportAsync}} {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>cookieParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{^-last}},{{/-last}}{{/allParams}}) { + public {{#supportAsync}}{{#useMutiny}}Uni{{/useMutiny}}{{^useMutiny}}CompletionStage{{/useMutiny}}<{{/supportAsync}}RestResponse<{{{returnType}}}>{{#supportAsync}}>{{/supportAsync}} {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>cookieParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{^-last}},{{/-last}}{{/allParams}}) { return {{#supportAsync}}{{#useMutiny}}Uni.createFrom().item({{/useMutiny}}{{^useMutiny}}CompletableFuture.supplyAsync(() -> {{/useMutiny}}{{/supportAsync}}Response.ok().entity("magic!").build(){{#supportAsync}}){{/supportAsync}}; } \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/returnAsyncTypeInterface.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/returnAsyncTypeInterface.mustache index 7732cd33f7b3..e1d18abc613b 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/returnAsyncTypeInterface.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/returnAsyncTypeInterface.mustache @@ -1 +1 @@ -{{#useMutiny}}Uni{{/useMutiny}}{{^useMutiny}}CompletionStage{{/useMutiny}}<{{#returnResponse}}RestResponse{{/returnResponse}}{{^returnResponse}}{{#returnContainer}}{{#isMap}}Map{{/isMap}}{{#isArray}}{{{returnContainer}}}<{{{returnBaseType}}}>{{/isArray}}{{/returnContainer}}{{^returnContainer}}{{{returnBaseType}}}{{/returnContainer}}{{/returnResponse}}> \ No newline at end of file +{{#useMutiny}}Uni{{/useMutiny}}{{^useMutiny}}CompletionStage{{/useMutiny}}<{{#returnResponse}}RestResponse<{{{returnType}}}>{{/returnResponse}}{{^returnResponse}}{{#returnContainer}}{{#isMap}}Map{{/isMap}}{{#isArray}}{{{returnContainer}}}<{{{returnBaseType}}}>{{/isArray}}{{/returnContainer}}{{^returnContainer}}{{{returnBaseType}}}{{/returnContainer}}{{/returnResponse}}> \ No newline at end of file From 469c9bb3bf2d897bf7ec35b340f333ca07c30c43 Mon Sep 17 00:00:00 2001 From: Christophe Moine Date: Wed, 3 Sep 2025 11:49:27 +0200 Subject: [PATCH 3/9] update documentation --- docs/generators/jaxrs-spec.md | 141 +++++++++++++++++----------------- 1 file changed, 71 insertions(+), 70 deletions(-) diff --git a/docs/generators/jaxrs-spec.md b/docs/generators/jaxrs-spec.md index 3fb5eee1064d..0675e9b05c8f 100644 --- a/docs/generators/jaxrs-spec.md +++ b/docs/generators/jaxrs-spec.md @@ -16,76 +16,77 @@ title: Documentation for the jaxrs-spec Generator ## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. -| Option | Description | Values | Default | -| ------ | ----------- | ------ | ------- | -|additionalEnumTypeAnnotations|Additional annotations for enum type(class level annotations)| |null| -|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations). List separated by semicolon(;) or new line (Linux or Windows)| |null| -|additionalOneOfTypeAnnotations|Additional annotations for oneOf interfaces(class level annotations). List separated by semicolon(;) or new line (Linux or Windows)| |null| -|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| -|apiPackage|package for generated api classes| |org.openapitools.api| -|artifactDescription|artifact description in generated pom.xml| |OpenAPI Java| -|artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |openapi-jaxrs-server| -|artifactUrl|artifact URL in generated pom.xml| |https://github.com/openapitools/openapi-generator| -|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename. If not provided, uses the version from the OpenAPI specification file. If that's also not present, uses the default value of the artifactVersion option.| |1.0.0| -|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false| -|booleanGetterPrefix|Set booleanGetterPrefix| |get| -|camelCaseDollarSign|Fix camelCase when starting with $ sign. when true : $Value when false : $value| |false| -|containerDefaultToNull|Set containers (array, set, map) default to null| |false| -|dateLibrary|Option. Date library to use|
**joda**
Joda (for legacy app only)
**legacy**
Legacy java.util.Date
**java8-localdatetime**
Java 8 using LocalDateTime (for legacy app only)
**java8**
Java 8 native JSR310 (preferred for jdk 1.8+)
|legacy| -|developerEmail|developer email in generated pom.xml| |team@openapitools.org| -|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors| -|developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org| -|developerOrganizationUrl|developer organization URL in generated pom.xml| |http://openapitools.org| -|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false| -|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
**false**
The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
**true**
Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
|true| -|discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| -|enumPropertyNaming|Naming convention for enum properties: 'MACRO_CASE', 'legacy' and 'original'| |MACRO_CASE| -|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 enum's 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| -|generatePom|Whether to generate pom.xml if the file does not already exist.| |true| -|groupId|groupId in generated pom.xml| |org.openapitools| -|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| -|ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false| -|implFolder|folder for generated implementation code| |src/main/java| -|implicitHeaders|Skip header parameters in the generated API methods using @ApiImplicitParams annotation.| |false| -|implicitHeadersRegex|Skip header parameters that matches given regex in the generated API methods using @ApiImplicitParams annotation. Note: this parameter is ignored when implicitHeaders=true| |null| -|interfaceOnly|Whether to generate only API interface stubs without the server files.| |false| -|invokerPackage|root package for generated code| |org.openapitools.api| -|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
|true| -|library|library template (sub-template)|
**<default>**
JAXRS spec only, to be deployed in an app server (TomEE, JBoss, WLS, ...)
**quarkus**
Server using Quarkus
**thorntail**
Server using Thorntail
**openliberty**
Server using Open Liberty
**helidon**
Server using Helidon
**kumuluzee**
Server using KumuluzEE
|<default>| -|licenseName|The name of the license| |Unlicense| -|licenseUrl|The URL of the license| |http://unlicense.org| -|modelPackage|package for generated models| |org.openapitools.model| -|openApiNullable|Enable OpenAPI Jackson Nullable library. Not supported by `microprofile` library.| |true| -|openApiSpecFileLocation|Location where the file containing the spec will be generated in the output folder. No file generated when set to null or empty string.| |null| -|parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| -|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| -|parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| -|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| -|returnResponse|Whether generate API interface should return javax.ws.rs.core.Response instead of a deserialized entity. Only useful if interfaceOnly is true.| |false| -|scmConnection|SCM connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| -|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| -|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| -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|sourceFolder|source folder for generated code| |src/gen/java| -|supportAsync|Wrap responses in CompletionStage type, allowing asynchronous computation (requires JAX-RS 2.1).| |false| -|testOutput|Set output folder for models and APIs tests| |${project.build.directory}/generated-test-sources/openapi| -|title|a title describing the application| |OpenAPI Server| -|useBeanValidation|Use BeanValidation API annotations| |true| -|useJakartaEe|whether to use Jakarta EE namespace instead of javax| |false| -|useMicroProfileOpenAPIAnnotations|Whether to generate Microprofile OpenAPI annotations. Only valid when library is set to quarkus.| |false| -|useMutiny|Whether to use Smallrye Mutiny instead of CompletionStage for asynchronous computation. Only valid when library is set to quarkus.| |false| -|useOneOfInterfaces|whether to use a java interface to describe a set of oneOf options, where each option is a class that implements the interface| |false| -|useSwaggerAnnotations|Whether to generate Swagger annotations.| |true| -|useTags|use tags for creating interface and controller classnames| |false| -|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false| +| Option | Description | Values | Default | +|------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| ------ | ------- | +| additionalEnumTypeAnnotations | Additional annotations for enum type(class level annotations) | |null| +| additionalModelTypeAnnotations | Additional annotations for model type(class level annotations). List separated by semicolon(;) or new line (Linux or Windows) | |null| +| additionalOneOfTypeAnnotations | Additional annotations for oneOf interfaces(class level annotations). List separated by semicolon(;) or new line (Linux or Windows) | |null| +| allowUnicodeIdentifiers | boolean, toggles whether unicode identifiers are allowed in names or not, default is false | |false| +| apiPackage | package for generated api classes | |org.openapitools.api| +| artifactDescription | artifact description in generated pom.xml | |OpenAPI Java| +| artifactId | artifactId in generated pom.xml. This also becomes part of the generated library's filename | |openapi-jaxrs-server| +| artifactUrl | artifact URL in generated pom.xml | |https://github.com/openapitools/openapi-generator| +| artifactVersion | artifact version in generated pom.xml. This also becomes part of the generated library's filename. If not provided, uses the version from the OpenAPI specification file. If that's also not present, uses the default value of the artifactVersion option. | |1.0.0| +| bigDecimalAsString | Treat BigDecimal values as Strings to avoid precision loss. | |false| +| booleanGetterPrefix | Set booleanGetterPrefix | |get| +| camelCaseDollarSign | Fix camelCase when starting with $ sign. when true : $Value when false : $value | |false| +| containerDefaultToNull | Set containers (array, set, map) default to null | |false| +| dateLibrary | Option. Date library to use |
**joda**
Joda (for legacy app only)
**legacy**
Legacy java.util.Date
**java8-localdatetime**
Java 8 using LocalDateTime (for legacy app only)
**java8**
Java 8 native JSR310 (preferred for jdk 1.8+)
|legacy| +| developerEmail | developer email in generated pom.xml | |team@openapitools.org| +| developerName | developer name in generated pom.xml | |OpenAPI-Generator Contributors| +| developerOrganization | developer organization in generated pom.xml | |OpenAPITools.org| +| developerOrganizationUrl | developer organization URL in generated pom.xml | |http://openapitools.org| +| disableHtmlEscaping | Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields) | |false| +| disallowAdditionalPropertiesIfNotPresent | If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default. |
**false**
The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
**true**
Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
|true| +| discriminatorCaseSensitive | Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client | |true| +| ensureUniqueParams | Whether to ensure parameter names are unique in an operation (rename parameters that are not). | |true| +| enumPropertyNaming | Naming convention for enum properties: 'MACRO_CASE', 'legacy' and 'original' | |MACRO_CASE| +| 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 enum's 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| +| generatePom | Whether to generate pom.xml if the file does not already exist. | |true| +| groupId | groupId in generated pom.xml | |org.openapitools| +| hideGenerationTimestamp | Hides the generation timestamp when files are generated. | |false| +| ignoreAnyOfInEnum | Ignore anyOf keyword in enum | |false| +| implFolder | folder for generated implementation code | |src/main/java| +| implicitHeaders | Skip header parameters in the generated API methods using @ApiImplicitParams annotation. | |false| +| implicitHeadersRegex | Skip header parameters that matches given regex in the generated API methods using @ApiImplicitParams annotation. Note: this parameter is ignored when implicitHeaders=true | |null| +| interfaceOnly | Whether to generate only API interface stubs without the server files. | |false| +| invokerPackage | root package for generated code | |org.openapitools.api| +| legacyDiscriminatorBehavior | Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default). |
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
|true| +| library | library template (sub-template) |
**<default>**
JAXRS spec only, to be deployed in an app server (TomEE, JBoss, WLS, ...)
**quarkus**
Server using Quarkus
**thorntail**
Server using Thorntail
**openliberty**
Server using Open Liberty
**helidon**
Server using Helidon
**kumuluzee**
Server using KumuluzEE
|<default>| +| licenseName | The name of the license | |Unlicense| +| licenseUrl | The URL of the license | |http://unlicense.org| +| modelPackage | package for generated models | |org.openapitools.model| +| openApiNullable | Enable OpenAPI Jackson Nullable library. Not supported by `microprofile` library. | |true| +| openApiSpecFileLocation | Location where the file containing the spec will be generated in the output folder. No file generated when set to null or empty string. | |null| +| parentArtifactId | parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect | |null| +| parentGroupId | parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect | |null| +| parentVersion | parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect | |null| +| prependFormOrBodyParameters | Add form or body parameters to the beginning of the parameter list. | |false| +| returnResponse | Whether generate API interface should return `javax.ws.rs.core.Response` instead of a deserialized entity. Only useful if interfaceOnly is true. | |false| +| returnJbossResponse | Whether generate API interface should return `org.jboss.resteasy.reactive.RestResponse` instead of a deserialized entity. Only useful if interfaceOnly is true. This flag has the priority over the `returnResponse` flag | |false| +| scmConnection | SCM connection in generated pom.xml | |scm:git:git@github.com:openapitools/openapi-generator.git| +| 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| +| 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| +| sortParamsByRequiredFlag | Sort method arguments to place required parameters before optional parameters. | |true| +| sourceFolder | source folder for generated code | |src/gen/java| +| supportAsync | Wrap responses in CompletionStage type, allowing asynchronous computation (requires JAX-RS 2.1). | |false| +| testOutput | Set output folder for models and APIs tests | |${project.build.directory}/generated-test-sources/openapi| +| title | a title describing the application | |OpenAPI Server| +| useBeanValidation | Use BeanValidation API annotations | |true| +| useJakartaEe | whether to use Jakarta EE namespace instead of javax | |false| +| useMicroProfileOpenAPIAnnotations | Whether to generate Microprofile OpenAPI annotations. Only valid when library is set to quarkus. | |false| +| useMutiny | Whether to use Smallrye Mutiny instead of CompletionStage for asynchronous computation. Only valid when library is set to quarkus. | |false| +| useOneOfInterfaces | whether to use a java interface to describe a set of oneOf options, where each option is a class that implements the interface | |false| +| useSwaggerAnnotations | Whether to generate Swagger annotations. | |true| +| useTags | use tags for creating interface and controller classnames | |false| +| withXml | whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML) | |false| ## SUPPORTED VENDOR EXTENSIONS From e91aa1bc74abd03f8875c0bf5fefb7329d7b7f3d Mon Sep 17 00:00:00 2001 From: Christophe Moine Date: Wed, 3 Sep 2025 11:51:42 +0200 Subject: [PATCH 4/9] Add option "returnJBossResponse" --- .../codegen/languages/JavaJAXRSSpecServerCodegen.java | 4 ++++ .../resources/JavaJaxRS/spec/libraries/quarkus/api.mustache | 2 +- .../JavaJaxRS/spec/libraries/quarkus/apiInterface.mustache | 2 +- .../JavaJaxRS/spec/libraries/quarkus/apiMethod.mustache | 2 +- .../spec/libraries/quarkus/returnAsyncTypeInterface.mustache | 2 +- 5 files changed, 8 insertions(+), 4 deletions(-) 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 90df4e8463ee..7bdffa616fd5 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 @@ -37,6 +37,7 @@ public class JavaJAXRSSpecServerCodegen extends AbstractJavaJAXRSServerCodegen { public static final String INTERFACE_ONLY = "interfaceOnly"; public static final String RETURN_RESPONSE = "returnResponse"; + public static final String RETURN_JBOSS_RESPONSE = "returnJBossResponse"; public static final String GENERATE_POM = "generatePom"; public static final String USE_SWAGGER_ANNOTATIONS = "useSwaggerAnnotations"; public static final String USE_MICROPROFILE_OPENAPI_ANNOTATIONS = "useMicroProfileOpenAPIAnnotations"; @@ -52,6 +53,7 @@ public class JavaJAXRSSpecServerCodegen extends AbstractJavaJAXRSServerCodegen { private boolean interfaceOnly = false; private boolean returnResponse = false; + private boolean returnJbossResponse = false; private boolean generatePom = true; private boolean useSwaggerAnnotations = true; private boolean useMicroProfileOpenAPIAnnotations = false; @@ -128,6 +130,7 @@ public JavaJAXRSSpecServerCodegen() { cliOptions.add(CliOption.newBoolean(GENERATE_POM, "Whether to generate pom.xml if the file does not already exist.").defaultValue(String.valueOf(generatePom))); cliOptions.add(CliOption.newBoolean(INTERFACE_ONLY, "Whether to generate only API interface stubs without the server files.").defaultValue(String.valueOf(interfaceOnly))); cliOptions.add(CliOption.newBoolean(RETURN_RESPONSE, "Whether generate API interface should return javax.ws.rs.core.Response instead of a deserialized entity. Only useful if interfaceOnly is true.").defaultValue(String.valueOf(returnResponse))); + cliOptions.add(CliOption.newBoolean(RETURN_JBOSS_RESPONSE, "Whether generate API interface should return `org.jboss.resteasy.reactive.RestResponse` instead of a deserialized entity. Only useful if interfaceOnly is true. This flag has the priority over the 'returnResponse' flag.").defaultValue(String.valueOf(returnJbossResponse))); cliOptions.add(CliOption.newBoolean(USE_SWAGGER_ANNOTATIONS, "Whether to generate Swagger annotations.", useSwaggerAnnotations)); cliOptions.add(CliOption.newBoolean(USE_MICROPROFILE_OPENAPI_ANNOTATIONS, "Whether to generate Microprofile OpenAPI annotations. Only valid when library is set to quarkus.", useMicroProfileOpenAPIAnnotations)); cliOptions.add(CliOption.newString(OPEN_API_SPEC_FILE_LOCATION, "Location where the file containing the spec will be generated in the output folder. No file generated when set to null or empty string.")); @@ -142,6 +145,7 @@ public void processOpts() { convertPropertyToBooleanAndWriteBack(INTERFACE_ONLY, value -> interfaceOnly = value); convertPropertyToBooleanAndWriteBack(RETURN_RESPONSE, value -> returnResponse = value); + convertPropertyToBooleanAndWriteBack(RETURN_JBOSS_RESPONSE, value -> returnJbossResponse = value); convertPropertyToBooleanAndWriteBack(SUPPORT_ASYNC, this::setSupportAsync); if (QUARKUS_LIBRARY.equals(library) || THORNTAIL_LIBRARY.equals(library) || HELIDON_LIBRARY.equals(library) || OPEN_LIBERTY_LIBRARY.equals(library) || KUMULUZEE_LIBRARY.equals(library)) { useSwaggerAnnotations = false; diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/api.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/api.mustache index a79246fb64fd..2b738861bffc 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/api.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/api.mustache @@ -4,7 +4,7 @@ package {{package}}; {{/imports}} import {{javaxPackage}}.ws.rs.*; -import org.jboss.resteasy.reactive.RestResponse; +{{#returnJBossResponse}}import org.jboss.resteasy.reactive.RestResponse;{{/returnJBossResponse}}{{^returnJBossResponse}}{{#returnResponse}}import {{javaxPackage}}.ws.rs.core.Response;{{/returnResponse}}{{/returnJBossResponse}} {{#useGzipFeature}} import org.jboss.resteasy.annotations.GZIP; diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/apiInterface.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/apiInterface.mustache index d39f99e93b61..b833d6a4e5fd 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/apiInterface.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/apiInterface.mustache @@ -41,4 +41,4 @@ {{^vendorExtensions.x-java-is-response-void}}@org.eclipse.microprofile.openapi.annotations.media.Content(schema = @org.eclipse.microprofile.openapi.annotations.media.Schema(implementation = {{{baseType}}}.class{{#vendorExtensions.x-microprofile-open-api-return-schema-container}}, type = {{{.}}} {{/vendorExtensions.x-microprofile-open-api-return-schema-container}}{{#vendorExtensions.x-microprofile-open-api-return-unique-items}}, uniqueItems = true {{/vendorExtensions.x-microprofile-open-api-return-unique-items}})){{/vendorExtensions.x-java-is-response-void}} }){{^-last}},{{/-last}}{{/responses}} }){{/hasProduces}}{{/useMicroProfileOpenAPIAnnotations}} - {{#supportAsync}}{{>returnAsyncTypeInterface}}{{/supportAsync}}{{^supportAsync}}{{#returnResponse}}RestResponse<{{{returnType}}}>{{/returnResponse}}{{^returnResponse}}{{>returnTypeInterface}}{{/returnResponse}}{{/supportAsync}} {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>cookieParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{^-last}},{{/-last}}{{/allParams}}); \ No newline at end of file + {{#supportAsync}}{{>returnAsyncTypeInterface}}{{/supportAsync}}{{^supportAsync}}{{#returnJBossResponse}}RestResponse<{{{returnType}}}>{{/returnJBossResponse}}{{^returnJBossResponse}}{{#returnResponse}}Response{{/returnResponse}}{{^returnResponse}}{{>returnTypeInterface}}{{/returnResponse}}{{/returnJBossResponse}}{{/supportAsync}} {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>cookieParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{^-last}},{{/-last}}{{/allParams}}); \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/apiMethod.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/apiMethod.mustache index de93ae00f326..d1c69eaa8834 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/apiMethod.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/apiMethod.mustache @@ -40,6 +40,6 @@ {{^vendorExtensions.x-java-is-response-void}}@org.eclipse.microprofile.openapi.annotations.media.Content(schema = @org.eclipse.microprofile.openapi.annotations.media.Schema(implementation = {{{baseType}}}.class{{#vendorExtensions.x-microprofile-open-api-return-schema-container}}, type = {{{.}}} {{/vendorExtensions.x-microprofile-open-api-return-schema-container}}{{#vendorExtensions.x-microprofile-open-api-return-unique-items}}, uniqueItems = true {{/vendorExtensions.x-microprofile-open-api-return-unique-items}})){{/vendorExtensions.x-java-is-response-void}} }){{^-last}},{{/-last}}{{/responses}} }){{/hasProduces}}{{/useMicroProfileOpenAPIAnnotations}} - public {{#supportAsync}}{{#useMutiny}}Uni{{/useMutiny}}{{^useMutiny}}CompletionStage{{/useMutiny}}<{{/supportAsync}}RestResponse<{{{returnType}}}>{{#supportAsync}}>{{/supportAsync}} {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>cookieParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{^-last}},{{/-last}}{{/allParams}}) { + public {{#supportAsync}}{{#useMutiny}}Uni{{/useMutiny}}{{^useMutiny}}CompletionStage{{/useMutiny}}<{{/supportAsync}}{{#returnJBossResponse}}RestResponse<{{{returnType}}}>{{/returnJBossResponse}}{{^returnJBossResponse}}Response{{/returnJBossResponse}}{{#supportAsync}}>{{/supportAsync}} {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>cookieParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{^-last}},{{/-last}}{{/allParams}}) { return {{#supportAsync}}{{#useMutiny}}Uni.createFrom().item({{/useMutiny}}{{^useMutiny}}CompletableFuture.supplyAsync(() -> {{/useMutiny}}{{/supportAsync}}Response.ok().entity("magic!").build(){{#supportAsync}}){{/supportAsync}}; } \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/returnAsyncTypeInterface.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/returnAsyncTypeInterface.mustache index e1d18abc613b..93f1098e48da 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/returnAsyncTypeInterface.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/returnAsyncTypeInterface.mustache @@ -1 +1 @@ -{{#useMutiny}}Uni{{/useMutiny}}{{^useMutiny}}CompletionStage{{/useMutiny}}<{{#returnResponse}}RestResponse<{{{returnType}}}>{{/returnResponse}}{{^returnResponse}}{{#returnContainer}}{{#isMap}}Map{{/isMap}}{{#isArray}}{{{returnContainer}}}<{{{returnBaseType}}}>{{/isArray}}{{/returnContainer}}{{^returnContainer}}{{{returnBaseType}}}{{/returnContainer}}{{/returnResponse}}> \ No newline at end of file +{{#useMutiny}}Uni{{/useMutiny}}{{^useMutiny}}CompletionStage{{/useMutiny}}<{{#returnResponse}}Response{{/returnResponse}}{{^returnResponse}}{{#returnContainer}}{{#isMap}}Map{{/isMap}}{{#isArray}}{{{returnContainer}}}<{{{returnBaseType}}}>{{/isArray}}{{/returnContainer}}{{^returnContainer}}{{{returnBaseType}}}{{/returnContainer}}{{/returnResponse}}> \ No newline at end of file From 92690ea2fb870e4c546dd5277784ab56972bbfa2 Mon Sep 17 00:00:00 2001 From: Christophe Moine Date: Wed, 3 Sep 2025 16:34:06 +0200 Subject: [PATCH 5/9] Add tests + fixes --- .../libraries/quarkus/apiInterface.mustache | 2 +- .../spec/libraries/quarkus/apiMethod.mustache | 2 +- .../quarkus/returnAsyncTypeInterface.mustache | 2 +- .../returnResponseTypeInterface.mustache | 1 + .../libraries/quarkus/returnType.mustache | 1 + .../jaxrs/JavaJAXRSSpecServerCodegenTest.java | 98 +++++++++++++++++++ 6 files changed, 103 insertions(+), 3 deletions(-) create mode 100644 modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/returnResponseTypeInterface.mustache create mode 100644 modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/returnType.mustache diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/apiInterface.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/apiInterface.mustache index b833d6a4e5fd..1eaefce90796 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/apiInterface.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/apiInterface.mustache @@ -41,4 +41,4 @@ {{^vendorExtensions.x-java-is-response-void}}@org.eclipse.microprofile.openapi.annotations.media.Content(schema = @org.eclipse.microprofile.openapi.annotations.media.Schema(implementation = {{{baseType}}}.class{{#vendorExtensions.x-microprofile-open-api-return-schema-container}}, type = {{{.}}} {{/vendorExtensions.x-microprofile-open-api-return-schema-container}}{{#vendorExtensions.x-microprofile-open-api-return-unique-items}}, uniqueItems = true {{/vendorExtensions.x-microprofile-open-api-return-unique-items}})){{/vendorExtensions.x-java-is-response-void}} }){{^-last}},{{/-last}}{{/responses}} }){{/hasProduces}}{{/useMicroProfileOpenAPIAnnotations}} - {{#supportAsync}}{{>returnAsyncTypeInterface}}{{/supportAsync}}{{^supportAsync}}{{#returnJBossResponse}}RestResponse<{{{returnType}}}>{{/returnJBossResponse}}{{^returnJBossResponse}}{{#returnResponse}}Response{{/returnResponse}}{{^returnResponse}}{{>returnTypeInterface}}{{/returnResponse}}{{/returnJBossResponse}}{{/supportAsync}} {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>cookieParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{^-last}},{{/-last}}{{/allParams}}); \ No newline at end of file + {{#supportAsync}}{{>returnAsyncTypeInterface}}{{/supportAsync}}{{^supportAsync}}{{#returnJBossResponse}}{{>returnResponseTypeInterface}}{{/returnJBossResponse}}{{^returnJBossResponse}}{{#returnResponse}}Response{{/returnResponse}}{{^returnResponse}}{{>returnTypeInterface}}{{/returnResponse}}{{/returnJBossResponse}}{{/supportAsync}} {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>cookieParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{^-last}},{{/-last}}{{/allParams}}); \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/apiMethod.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/apiMethod.mustache index d1c69eaa8834..f129b447fb85 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/apiMethod.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/apiMethod.mustache @@ -40,6 +40,6 @@ {{^vendorExtensions.x-java-is-response-void}}@org.eclipse.microprofile.openapi.annotations.media.Content(schema = @org.eclipse.microprofile.openapi.annotations.media.Schema(implementation = {{{baseType}}}.class{{#vendorExtensions.x-microprofile-open-api-return-schema-container}}, type = {{{.}}} {{/vendorExtensions.x-microprofile-open-api-return-schema-container}}{{#vendorExtensions.x-microprofile-open-api-return-unique-items}}, uniqueItems = true {{/vendorExtensions.x-microprofile-open-api-return-unique-items}})){{/vendorExtensions.x-java-is-response-void}} }){{^-last}},{{/-last}}{{/responses}} }){{/hasProduces}}{{/useMicroProfileOpenAPIAnnotations}} - public {{#supportAsync}}{{#useMutiny}}Uni{{/useMutiny}}{{^useMutiny}}CompletionStage{{/useMutiny}}<{{/supportAsync}}{{#returnJBossResponse}}RestResponse<{{{returnType}}}>{{/returnJBossResponse}}{{^returnJBossResponse}}Response{{/returnJBossResponse}}{{#supportAsync}}>{{/supportAsync}} {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>cookieParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{^-last}},{{/-last}}{{/allParams}}) { + public {{#supportAsync}}{{#useMutiny}}Uni{{/useMutiny}}{{^useMutiny}}CompletionStage{{/useMutiny}}<{{/supportAsync}}{{#returnJBossResponse}}{{{returnType}}}{{/returnJBossResponse}}{{^returnJBossResponse}}Response{{/returnJBossResponse}}{{#supportAsync}}>{{/supportAsync}} {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>cookieParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{^-last}},{{/-last}}{{/allParams}}) { return {{#supportAsync}}{{#useMutiny}}Uni.createFrom().item({{/useMutiny}}{{^useMutiny}}CompletableFuture.supplyAsync(() -> {{/useMutiny}}{{/supportAsync}}Response.ok().entity("magic!").build(){{#supportAsync}}){{/supportAsync}}; } \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/returnAsyncTypeInterface.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/returnAsyncTypeInterface.mustache index 93f1098e48da..477585f9b35f 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/returnAsyncTypeInterface.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/returnAsyncTypeInterface.mustache @@ -1 +1 @@ -{{#useMutiny}}Uni{{/useMutiny}}{{^useMutiny}}CompletionStage{{/useMutiny}}<{{#returnResponse}}Response{{/returnResponse}}{{^returnResponse}}{{#returnContainer}}{{#isMap}}Map{{/isMap}}{{#isArray}}{{{returnContainer}}}<{{{returnBaseType}}}>{{/isArray}}{{/returnContainer}}{{^returnContainer}}{{{returnBaseType}}}{{/returnContainer}}{{/returnResponse}}> \ No newline at end of file +{{#useMutiny}}Uni{{/useMutiny}}{{^useMutiny}}CompletionStage{{/useMutiny}}<{{>returnResponseTypeInterface}}> \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/returnResponseTypeInterface.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/returnResponseTypeInterface.mustache new file mode 100644 index 000000000000..33921cdc1a93 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/returnResponseTypeInterface.mustache @@ -0,0 +1 @@ +{{#returnJBossResponse}}RestResponse<{{>returnType}}>{{/returnJBossResponse}}{{^returnJBossResponse}}{{#returnResponse}}Response{{/returnResponse}}{{^returnResponse}}{{>returnType}}{{/returnResponse}}{{/returnJBossResponse}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/returnType.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/returnType.mustache new file mode 100644 index 000000000000..761440490f6e --- /dev/null +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/returnType.mustache @@ -0,0 +1 @@ +{{#returnContainer}}{{#isMap}}Map{{/isMap}}{{#isArray}}{{{returnContainer}}}<{{{returnBaseType}}}>{{/isArray}}{{/returnContainer}}{{^returnContainer}}{{{returnBaseType}}}{{/returnContainer}} \ No newline at end of file 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 b44e0b2c3198..9d69c6a81cc2 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 @@ -524,6 +524,37 @@ public void generateApiWithAsyncSupportAndInterfaceOnlyAndResponse() throws Exce "\nCompletionStage pingGet();\n"); } + @Test + public void generateApiWithAsyncSupportAndInterfaceOnlyAndJBossResponse() throws Exception { + final File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); + output.deleteOnExit(); + + final OpenAPI openAPI = new OpenAPIParser() + .readLocation("src/test/resources/3_0/petstore.yaml", null, new ParseOptions()).getOpenAPI(); + + codegen.setOutputDir(output.getAbsolutePath()); + codegen.setLibrary(QUARKUS_LIBRARY); + codegen.additionalProperties().put(SUPPORT_ASYNC, true); //Given support async is enabled + codegen.additionalProperties().put(INTERFACE_ONLY, true); //And only interfaces are generated + codegen.additionalProperties().put(RETURN_JBOSS_RESPONSE, true); //And return type is Response + + final ClientOptInput input = new ClientOptInput() + .openAPI(openAPI) + .config(codegen); //Using JavaJAXRSSpecServerCodegen + + final DefaultGenerator generator = new DefaultGenerator(); + final List files = generator.opts(input).generate(); //When generating files + + //Then the java files are compilable + validateJavaSourceFiles(files); + + //And the generated interface contains CompletionStage + TestUtils.ensureContainsFile(files, output, "src/gen/java/org/openapitools/api/PetApi.java"); + assertFileContains(output.toPath().resolve("src/gen/java/org/openapitools/api/PetApi.java"), + "\nimport java.util.concurrent.CompletionStage;\n", + "CompletionStage> addPet", "CompletionStage> deletePet"); + } + @Test public void generatePetstoreAPIWithAsyncSupport() throws Exception { @@ -975,6 +1006,73 @@ public void generateSpecInterfaceWithMicroprofileOpenApiAnnotations() throws Exc " title = \"user\", version=\"1.0.0\", description=\"Operations about user\","); } + @Test + public void generateSpecInterfaceWithJBossResponse() throws Exception { + final File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); + output.deleteOnExit(); + + final OpenAPI openAPI = new OpenAPIParser() + .readLocation("src/test/resources/3_0/petstore.yaml", null, new ParseOptions()).getOpenAPI(); + + codegen.setOutputDir(output.getAbsolutePath()); + codegen.additionalProperties().put(INTERFACE_ONLY, true); //And only interfaces are generated + codegen.additionalProperties().put(USE_TAGS, true); //And use tags to generate everything in several API files + codegen.additionalProperties().put(RETURN_JBOSS_RESPONSE, true); // Use JBoss Response type + codegen.additionalProperties().put(USE_JAKARTA_EE, true); // Use Jakarta + codegen.setLibrary(QUARKUS_LIBRARY); // Set Quarkus + + final ClientOptInput input = new ClientOptInput() + .openAPI(openAPI) + .config(codegen); //using JavaJAXRSSpecServerCodegen + + final DefaultGenerator generator = new DefaultGenerator(); + final List files = generator.opts(input).generate(); //When generating files + + //Then the java files are compilable + validateJavaSourceFiles(files); + + //And the generated interfaces contains RestResponse + TestUtils.ensureContainsFile(files, output, "src/gen/java/org/openapitools/api/PetApi.java"); + assertFileContains(output.toPath().resolve("src/gen/java/org/openapitools/api/PetApi.java"), + "\nimport org.jboss.resteasy.reactive.RestResponse;\n", "RestResponse addPet", + "RestResponse deletePet", "RestResponse> findPetsByStatus", + "RestResponse updatePetWithForm", "RestResponse uploadFile"); + } + + @Test + public void generateSpecInterfaceWithMutinyAndJBossResponse() throws Exception { + final File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); + output.deleteOnExit(); + + final OpenAPI openAPI = new OpenAPIParser() + .readLocation("src/test/resources/3_0/petstore.yaml", null, new ParseOptions()).getOpenAPI(); + + codegen.setOutputDir(output.getAbsolutePath()); + codegen.additionalProperties().put(INTERFACE_ONLY, true); //And only interfaces are generated + codegen.additionalProperties().put(USE_TAGS, true); //And use tags to generate everything in several API files + codegen.additionalProperties().put(RETURN_JBOSS_RESPONSE, true); // Use JBoss Response type + codegen.additionalProperties().put(SUPPORT_ASYNC, true); + codegen.additionalProperties().put(USE_MUTINY, true); // Use Mutiny + codegen.setLibrary(QUARKUS_LIBRARY); // Set Quarkus + + final ClientOptInput input = new ClientOptInput() + .openAPI(openAPI) + .config(codegen); //using JavaJAXRSSpecServerCodegen + + final DefaultGenerator generator = new DefaultGenerator(); + final List files = generator.opts(input).generate(); //When generating files + + //Then the java files are compilable + validateJavaSourceFiles(files); + + //And the generated interfaces contains RestResponse + TestUtils.ensureContainsFile(files, output, "src/gen/java/org/openapitools/api/PetApi.java"); + assertFileContains(output.toPath().resolve("src/gen/java/org/openapitools/api/PetApi.java"), + "\nimport org.jboss.resteasy.reactive.RestResponse;\n", "Uni> addPet", + "Uni> deletePet", "Uni>> findPetsByStatus", + "Uni> uploadFile"); + } + @Test public void generateSpecNonInterfaceWithMicroprofileOpenApiAnnotations() throws Exception { final File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); From b7d9bd70eca90893fa04786ab42762d5f8dd7bcb Mon Sep 17 00:00:00 2001 From: Christophe Moine Date: Wed, 3 Sep 2025 21:07:27 +0200 Subject: [PATCH 6/9] Polish --- docs/generators/jaxrs-spec.md | 2 +- .../codegen/languages/JavaJAXRSSpecServerCodegen.java | 2 +- .../spec/libraries/quarkus/apiMethod.mustache | 2 +- .../java/jaxrs/JavaJAXRSSpecServerCodegenTest.java | 11 ++++++----- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/docs/generators/jaxrs-spec.md b/docs/generators/jaxrs-spec.md index 0675e9b05c8f..3b1d3c3b11d9 100644 --- a/docs/generators/jaxrs-spec.md +++ b/docs/generators/jaxrs-spec.md @@ -66,7 +66,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl | parentVersion | parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect | |null| | prependFormOrBodyParameters | Add form or body parameters to the beginning of the parameter list. | |false| | returnResponse | Whether generate API interface should return `javax.ws.rs.core.Response` instead of a deserialized entity. Only useful if interfaceOnly is true. | |false| -| returnJbossResponse | Whether generate API interface should return `org.jboss.resteasy.reactive.RestResponse` instead of a deserialized entity. Only useful if interfaceOnly is true. This flag has the priority over the `returnResponse` flag | |false| +| returnJBossResponse | Whether generate API interface should return `org.jboss.resteasy.reactive.RestResponse` instead of a deserialized entity. Only useful if interfaceOnly is true. This flag has the priority over the `returnResponse` flag | |false| | scmConnection | SCM connection in generated pom.xml | |scm:git:git@github.com:openapitools/openapi-generator.git| | 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| 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 7bdffa616fd5..6c07657be739 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 @@ -130,7 +130,7 @@ public JavaJAXRSSpecServerCodegen() { cliOptions.add(CliOption.newBoolean(GENERATE_POM, "Whether to generate pom.xml if the file does not already exist.").defaultValue(String.valueOf(generatePom))); cliOptions.add(CliOption.newBoolean(INTERFACE_ONLY, "Whether to generate only API interface stubs without the server files.").defaultValue(String.valueOf(interfaceOnly))); cliOptions.add(CliOption.newBoolean(RETURN_RESPONSE, "Whether generate API interface should return javax.ws.rs.core.Response instead of a deserialized entity. Only useful if interfaceOnly is true.").defaultValue(String.valueOf(returnResponse))); - cliOptions.add(CliOption.newBoolean(RETURN_JBOSS_RESPONSE, "Whether generate API interface should return `org.jboss.resteasy.reactive.RestResponse` instead of a deserialized entity. Only useful if interfaceOnly is true. This flag has the priority over the 'returnResponse' flag.").defaultValue(String.valueOf(returnJbossResponse))); + cliOptions.add(CliOption.newBoolean(RETURN_JBOSS_RESPONSE, "Whether generate API interface should return org.jboss.resteasy.reactive.RestResponse instead of a deserialized entity. Only useful if interfaceOnly is true. This flag has the priority over the returnResponse flag.").defaultValue(String.valueOf(returnJbossResponse))); cliOptions.add(CliOption.newBoolean(USE_SWAGGER_ANNOTATIONS, "Whether to generate Swagger annotations.", useSwaggerAnnotations)); cliOptions.add(CliOption.newBoolean(USE_MICROPROFILE_OPENAPI_ANNOTATIONS, "Whether to generate Microprofile OpenAPI annotations. Only valid when library is set to quarkus.", useMicroProfileOpenAPIAnnotations)); cliOptions.add(CliOption.newString(OPEN_API_SPEC_FILE_LOCATION, "Location where the file containing the spec will be generated in the output folder. No file generated when set to null or empty string.")); diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/apiMethod.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/apiMethod.mustache index f129b447fb85..b5e8067ea8b5 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/apiMethod.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/apiMethod.mustache @@ -40,6 +40,6 @@ {{^vendorExtensions.x-java-is-response-void}}@org.eclipse.microprofile.openapi.annotations.media.Content(schema = @org.eclipse.microprofile.openapi.annotations.media.Schema(implementation = {{{baseType}}}.class{{#vendorExtensions.x-microprofile-open-api-return-schema-container}}, type = {{{.}}} {{/vendorExtensions.x-microprofile-open-api-return-schema-container}}{{#vendorExtensions.x-microprofile-open-api-return-unique-items}}, uniqueItems = true {{/vendorExtensions.x-microprofile-open-api-return-unique-items}})){{/vendorExtensions.x-java-is-response-void}} }){{^-last}},{{/-last}}{{/responses}} }){{/hasProduces}}{{/useMicroProfileOpenAPIAnnotations}} - public {{#supportAsync}}{{#useMutiny}}Uni{{/useMutiny}}{{^useMutiny}}CompletionStage{{/useMutiny}}<{{/supportAsync}}{{#returnJBossResponse}}{{{returnType}}}{{/returnJBossResponse}}{{^returnJBossResponse}}Response{{/returnJBossResponse}}{{#supportAsync}}>{{/supportAsync}} {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>cookieParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{^-last}},{{/-last}}{{/allParams}}) { + public {{#supportAsync}}{{#useMutiny}}Uni{{/useMutiny}}{{^useMutiny}}CompletionStage{{/useMutiny}}<{{/supportAsync}}{{#returnJBossResponse}}{{>returnResponseTypeInterface}}{{/returnJBossResponse}}{{^returnJBossResponse}}Response{{/returnJBossResponse}}{{#supportAsync}}>{{/supportAsync}} {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>cookieParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{^-last}},{{/-last}}{{/allParams}}) { return {{#supportAsync}}{{#useMutiny}}Uni.createFrom().item({{/useMutiny}}{{^useMutiny}}CompletableFuture.supplyAsync(() -> {{/useMutiny}}{{/supportAsync}}Response.ok().entity("magic!").build(){{#supportAsync}}){{/supportAsync}}; } \ No newline at end of file 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 9d69c6a81cc2..e72bccababdb 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 @@ -536,7 +536,7 @@ public void generateApiWithAsyncSupportAndInterfaceOnlyAndJBossResponse() throws codegen.setLibrary(QUARKUS_LIBRARY); codegen.additionalProperties().put(SUPPORT_ASYNC, true); //Given support async is enabled codegen.additionalProperties().put(INTERFACE_ONLY, true); //And only interfaces are generated - codegen.additionalProperties().put(RETURN_JBOSS_RESPONSE, true); //And return type is Response + codegen.additionalProperties().put(RETURN_JBOSS_RESPONSE, true); //And return type is RestResponse final ClientOptInput input = new ClientOptInput() .openAPI(openAPI) @@ -548,9 +548,10 @@ public void generateApiWithAsyncSupportAndInterfaceOnlyAndJBossResponse() throws //Then the java files are compilable validateJavaSourceFiles(files); - //And the generated interface contains CompletionStage + //And the generated interface contains CompletionStage> TestUtils.ensureContainsFile(files, output, "src/gen/java/org/openapitools/api/PetApi.java"); assertFileContains(output.toPath().resolve("src/gen/java/org/openapitools/api/PetApi.java"), + "\nimport org.jboss.resteasy.reactive.RestResponse;\n", "\nimport java.util.concurrent.CompletionStage;\n", "CompletionStage> addPet", "CompletionStage> deletePet"); } @@ -1034,9 +1035,9 @@ public void generateSpecInterfaceWithJBossResponse() throws Exception { //And the generated interfaces contains RestResponse TestUtils.ensureContainsFile(files, output, "src/gen/java/org/openapitools/api/PetApi.java"); assertFileContains(output.toPath().resolve("src/gen/java/org/openapitools/api/PetApi.java"), - "\nimport org.jboss.resteasy.reactive.RestResponse;\n", "RestResponse addPet", - "RestResponse deletePet", "RestResponse> findPetsByStatus", - "RestResponse updatePetWithForm", "RestResponse uploadFile"); + "\nimport org.jboss.resteasy.reactive.RestResponse;\n", + "RestResponse addPet", "RestResponse deletePet", "RestResponse> findPetsByStatus", + "RestResponse updatePetWithForm", "RestResponse uploadFile"); } @Test From 546bf17c69160733ca5d2d20fbef0be27569c3ed Mon Sep 17 00:00:00 2001 From: Christophe Moine Date: Thu, 11 Sep 2025 17:10:22 +0200 Subject: [PATCH 7/9] Add dependency "io.quarkus.resteasy.reactive:resteasy-reactive" when returnJBossResponse=true --- docs/generators/jaxrs-spec.md | 140 +++++++++--------- .../languages/JavaJAXRSSpecServerCodegen.java | 15 +- .../spec/libraries/quarkus/pom.mustache | 6 + .../jaxrs/JavaJAXRSSpecServerCodegenTest.java | 3 + 4 files changed, 93 insertions(+), 71 deletions(-) diff --git a/docs/generators/jaxrs-spec.md b/docs/generators/jaxrs-spec.md index 3b1d3c3b11d9..28829059e8de 100644 --- a/docs/generators/jaxrs-spec.md +++ b/docs/generators/jaxrs-spec.md @@ -16,77 +16,77 @@ title: Documentation for the jaxrs-spec Generator ## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. -| Option | Description | Values | Default | -|------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| ------ | ------- | -| additionalEnumTypeAnnotations | Additional annotations for enum type(class level annotations) | |null| -| additionalModelTypeAnnotations | Additional annotations for model type(class level annotations). List separated by semicolon(;) or new line (Linux or Windows) | |null| -| additionalOneOfTypeAnnotations | Additional annotations for oneOf interfaces(class level annotations). List separated by semicolon(;) or new line (Linux or Windows) | |null| -| allowUnicodeIdentifiers | boolean, toggles whether unicode identifiers are allowed in names or not, default is false | |false| -| apiPackage | package for generated api classes | |org.openapitools.api| -| artifactDescription | artifact description in generated pom.xml | |OpenAPI Java| -| artifactId | artifactId in generated pom.xml. This also becomes part of the generated library's filename | |openapi-jaxrs-server| -| artifactUrl | artifact URL in generated pom.xml | |https://github.com/openapitools/openapi-generator| -| artifactVersion | artifact version in generated pom.xml. This also becomes part of the generated library's filename. If not provided, uses the version from the OpenAPI specification file. If that's also not present, uses the default value of the artifactVersion option. | |1.0.0| -| bigDecimalAsString | Treat BigDecimal values as Strings to avoid precision loss. | |false| -| booleanGetterPrefix | Set booleanGetterPrefix | |get| -| camelCaseDollarSign | Fix camelCase when starting with $ sign. when true : $Value when false : $value | |false| -| containerDefaultToNull | Set containers (array, set, map) default to null | |false| -| dateLibrary | Option. Date library to use |
**joda**
Joda (for legacy app only)
**legacy**
Legacy java.util.Date
**java8-localdatetime**
Java 8 using LocalDateTime (for legacy app only)
**java8**
Java 8 native JSR310 (preferred for jdk 1.8+)
|legacy| -| developerEmail | developer email in generated pom.xml | |team@openapitools.org| -| developerName | developer name in generated pom.xml | |OpenAPI-Generator Contributors| -| developerOrganization | developer organization in generated pom.xml | |OpenAPITools.org| -| developerOrganizationUrl | developer organization URL in generated pom.xml | |http://openapitools.org| -| disableHtmlEscaping | Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields) | |false| -| disallowAdditionalPropertiesIfNotPresent | If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default. |
**false**
The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
**true**
Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
|true| -| discriminatorCaseSensitive | Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client | |true| -| ensureUniqueParams | Whether to ensure parameter names are unique in an operation (rename parameters that are not). | |true| -| enumPropertyNaming | Naming convention for enum properties: 'MACRO_CASE', 'legacy' and 'original' | |MACRO_CASE| +| Option | Description | Values | Default | +|------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| ------ | ------- | +| additionalEnumTypeAnnotations | Additional annotations for enum type(class level annotations) | |null| +| additionalModelTypeAnnotations | Additional annotations for model type(class level annotations). List separated by semicolon(;) or new line (Linux or Windows) | |null| +| additionalOneOfTypeAnnotations | Additional annotations for oneOf interfaces(class level annotations). List separated by semicolon(;) or new line (Linux or Windows) | |null| +| allowUnicodeIdentifiers | boolean, toggles whether unicode identifiers are allowed in names or not, default is false | |false| +| apiPackage | package for generated api classes | |org.openapitools.api| +| artifactDescription | artifact description in generated pom.xml | |OpenAPI Java| +| artifactId | artifactId in generated pom.xml. This also becomes part of the generated library's filename | |openapi-jaxrs-server| +| artifactUrl | artifact URL in generated pom.xml | |https://github.com/openapitools/openapi-generator| +| artifactVersion | artifact version in generated pom.xml. This also becomes part of the generated library's filename. If not provided, uses the version from the OpenAPI specification file. If that's also not present, uses the default value of the artifactVersion option. | |1.0.0| +| bigDecimalAsString | Treat BigDecimal values as Strings to avoid precision loss. | |false| +| booleanGetterPrefix | Set booleanGetterPrefix | |get| +| camelCaseDollarSign | Fix camelCase when starting with $ sign. when true : $Value when false : $value | |false| +| containerDefaultToNull | Set containers (array, set, map) default to null | |false| +| dateLibrary | Option. Date library to use |
**joda**
Joda (for legacy app only)
**legacy**
Legacy java.util.Date
**java8-localdatetime**
Java 8 using LocalDateTime (for legacy app only)
**java8**
Java 8 native JSR310 (preferred for jdk 1.8+)
|legacy| +| developerEmail | developer email in generated pom.xml | |team@openapitools.org| +| developerName | developer name in generated pom.xml | |OpenAPI-Generator Contributors| +| developerOrganization | developer organization in generated pom.xml | |OpenAPITools.org| +| developerOrganizationUrl | developer organization URL in generated pom.xml | |http://openapitools.org| +| disableHtmlEscaping | Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields) | |false| +| disallowAdditionalPropertiesIfNotPresent | If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default. |
**false**
The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
**true**
Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
|true| +| discriminatorCaseSensitive | Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client | |true| +| ensureUniqueParams | Whether to ensure parameter names are unique in an operation (rename parameters that are not). | |true| +| enumPropertyNaming | Naming convention for enum properties: 'MACRO_CASE', 'legacy' and 'original' | |MACRO_CASE| | 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 enum's 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| -| generatePom | Whether to generate pom.xml if the file does not already exist. | |true| -| groupId | groupId in generated pom.xml | |org.openapitools| -| hideGenerationTimestamp | Hides the generation timestamp when files are generated. | |false| -| ignoreAnyOfInEnum | Ignore anyOf keyword in enum | |false| -| implFolder | folder for generated implementation code | |src/main/java| -| implicitHeaders | Skip header parameters in the generated API methods using @ApiImplicitParams annotation. | |false| -| implicitHeadersRegex | Skip header parameters that matches given regex in the generated API methods using @ApiImplicitParams annotation. Note: this parameter is ignored when implicitHeaders=true | |null| -| interfaceOnly | Whether to generate only API interface stubs without the server files. | |false| -| invokerPackage | root package for generated code | |org.openapitools.api| -| legacyDiscriminatorBehavior | Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default). |
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
|true| -| library | library template (sub-template) |
**<default>**
JAXRS spec only, to be deployed in an app server (TomEE, JBoss, WLS, ...)
**quarkus**
Server using Quarkus
**thorntail**
Server using Thorntail
**openliberty**
Server using Open Liberty
**helidon**
Server using Helidon
**kumuluzee**
Server using KumuluzEE
|<default>| -| licenseName | The name of the license | |Unlicense| -| licenseUrl | The URL of the license | |http://unlicense.org| -| modelPackage | package for generated models | |org.openapitools.model| -| openApiNullable | Enable OpenAPI Jackson Nullable library. Not supported by `microprofile` library. | |true| -| openApiSpecFileLocation | Location where the file containing the spec will be generated in the output folder. No file generated when set to null or empty string. | |null| -| parentArtifactId | parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect | |null| -| parentGroupId | parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect | |null| -| parentVersion | parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect | |null| -| prependFormOrBodyParameters | Add form or body parameters to the beginning of the parameter list. | |false| -| returnResponse | Whether generate API interface should return `javax.ws.rs.core.Response` instead of a deserialized entity. Only useful if interfaceOnly is true. | |false| -| returnJBossResponse | Whether generate API interface should return `org.jboss.resteasy.reactive.RestResponse` instead of a deserialized entity. Only useful if interfaceOnly is true. This flag has the priority over the `returnResponse` flag | |false| -| scmConnection | SCM connection in generated pom.xml | |scm:git:git@github.com:openapitools/openapi-generator.git| -| 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| -| 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| -| sortParamsByRequiredFlag | Sort method arguments to place required parameters before optional parameters. | |true| -| sourceFolder | source folder for generated code | |src/gen/java| -| supportAsync | Wrap responses in CompletionStage type, allowing asynchronous computation (requires JAX-RS 2.1). | |false| -| testOutput | Set output folder for models and APIs tests | |${project.build.directory}/generated-test-sources/openapi| -| title | a title describing the application | |OpenAPI Server| -| useBeanValidation | Use BeanValidation API annotations | |true| -| useJakartaEe | whether to use Jakarta EE namespace instead of javax | |false| -| useMicroProfileOpenAPIAnnotations | Whether to generate Microprofile OpenAPI annotations. Only valid when library is set to quarkus. | |false| -| useMutiny | Whether to use Smallrye Mutiny instead of CompletionStage for asynchronous computation. Only valid when library is set to quarkus. | |false| -| useOneOfInterfaces | whether to use a java interface to describe a set of oneOf options, where each option is a class that implements the interface | |false| -| useSwaggerAnnotations | Whether to generate Swagger annotations. | |true| -| useTags | use tags for creating interface and controller classnames | |false| -| withXml | whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML) | |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| +| generatePom | Whether to generate pom.xml if the file does not already exist. | |true| +| groupId | groupId in generated pom.xml | |org.openapitools| +| hideGenerationTimestamp | Hides the generation timestamp when files are generated. | |false| +| ignoreAnyOfInEnum | Ignore anyOf keyword in enum | |false| +| implFolder | folder for generated implementation code | |src/main/java| +| implicitHeaders | Skip header parameters in the generated API methods using @ApiImplicitParams annotation. | |false| +| implicitHeadersRegex | Skip header parameters that matches given regex in the generated API methods using @ApiImplicitParams annotation. Note: this parameter is ignored when implicitHeaders=true | |null| +| interfaceOnly | Whether to generate only API interface stubs without the server files. | |false| +| invokerPackage | root package for generated code | |org.openapitools.api| +| legacyDiscriminatorBehavior | Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default). |
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
|true| +| library | library template (sub-template) |
**<default>**
JAXRS spec only, to be deployed in an app server (TomEE, JBoss, WLS, ...)
**quarkus**
Server using Quarkus
**thorntail**
Server using Thorntail
**openliberty**
Server using Open Liberty
**helidon**
Server using Helidon
**kumuluzee**
Server using KumuluzEE
|<default>| +| licenseName | The name of the license | |Unlicense| +| licenseUrl | The URL of the license | |http://unlicense.org| +| modelPackage | package for generated models | |org.openapitools.model| +| openApiNullable | Enable OpenAPI Jackson Nullable library. Not supported by `microprofile` library. | |true| +| openApiSpecFileLocation | Location where the file containing the spec will be generated in the output folder. No file generated when set to null or empty string. | |null| +| parentArtifactId | parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect | |null| +| parentGroupId | parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect | |null| +| parentVersion | parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect | |null| +| prependFormOrBodyParameters | Add form or body parameters to the beginning of the parameter list. | |false| +| returnResponse | Whether generate API interface should return `javax.ws.rs.core.Response` instead of a deserialized entity. Only useful if interfaceOnly is true. | |false| +| returnJBossResponse | Whether generate API interface should return `org.jboss.resteasy.reactive.RestResponse` instead of a deserialized entity. This flag cannot be combined with `returnResponse` flag. It requires the flag `interfaceOnly` and `useJakartaEE` set to true, because `org.jboss.resteasy.reactive.RestResponse` was introduced in Quarkus 2.x | |false| +| scmConnection | SCM connection in generated pom.xml | |scm:git:git@github.com:openapitools/openapi-generator.git| +| 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| +| 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| +| sortParamsByRequiredFlag | Sort method arguments to place required parameters before optional parameters. | |true| +| sourceFolder | source folder for generated code | |src/gen/java| +| supportAsync | Wrap responses in CompletionStage type, allowing asynchronous computation (requires JAX-RS 2.1). | |false| +| testOutput | Set output folder for models and APIs tests | |${project.build.directory}/generated-test-sources/openapi| +| title | a title describing the application | |OpenAPI Server| +| useBeanValidation | Use BeanValidation API annotations | |true| +| useJakartaEe | whether to use Jakarta EE namespace instead of javax | |false| +| useMicroProfileOpenAPIAnnotations | Whether to generate Microprofile OpenAPI annotations. Only valid when library is set to quarkus. | |false| +| useMutiny | Whether to use Smallrye Mutiny instead of CompletionStage for asynchronous computation. Only valid when library is set to quarkus. | |false| +| useOneOfInterfaces | whether to use a java interface to describe a set of oneOf options, where each option is a class that implements the interface | |false| +| useSwaggerAnnotations | Whether to generate Swagger annotations. | |true| +| useTags | use tags for creating interface and controller classnames | |false| +| withXml | whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML) | |false| ## SUPPORTED VENDOR EXTENSIONS 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 6c07657be739..c9ab84e1a0e1 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 @@ -18,6 +18,7 @@ package org.openapitools.codegen.languages; import io.swagger.v3.oas.models.media.Schema; +import java.util.Locale; import lombok.Getter; import lombok.Setter; import org.apache.commons.lang3.StringUtils; @@ -130,7 +131,7 @@ public JavaJAXRSSpecServerCodegen() { cliOptions.add(CliOption.newBoolean(GENERATE_POM, "Whether to generate pom.xml if the file does not already exist.").defaultValue(String.valueOf(generatePom))); cliOptions.add(CliOption.newBoolean(INTERFACE_ONLY, "Whether to generate only API interface stubs without the server files.").defaultValue(String.valueOf(interfaceOnly))); cliOptions.add(CliOption.newBoolean(RETURN_RESPONSE, "Whether generate API interface should return javax.ws.rs.core.Response instead of a deserialized entity. Only useful if interfaceOnly is true.").defaultValue(String.valueOf(returnResponse))); - cliOptions.add(CliOption.newBoolean(RETURN_JBOSS_RESPONSE, "Whether generate API interface should return org.jboss.resteasy.reactive.RestResponse instead of a deserialized entity. Only useful if interfaceOnly is true. This flag has the priority over the returnResponse flag.").defaultValue(String.valueOf(returnJbossResponse))); + cliOptions.add(CliOption.newBoolean(RETURN_JBOSS_RESPONSE, "Whether generate API interface should return `org.jboss.resteasy.reactive.RestResponse` instead of a deserialized entity. This flag cannot be combined with `returnResponse` flag. It requires the flag `interfaceOnly` and `useJakartaEE` set to true, because `org.jboss.resteasy.reactive.RestResponse` was introduced in Quarkus 2.x").defaultValue(String.valueOf(returnJbossResponse))); cliOptions.add(CliOption.newBoolean(USE_SWAGGER_ANNOTATIONS, "Whether to generate Swagger annotations.", useSwaggerAnnotations)); cliOptions.add(CliOption.newBoolean(USE_MICROPROFILE_OPENAPI_ANNOTATIONS, "Whether to generate Microprofile OpenAPI annotations. Only valid when library is set to quarkus.", useMicroProfileOpenAPIAnnotations)); cliOptions.add(CliOption.newString(OPEN_API_SPEC_FILE_LOCATION, "Location where the file containing the spec will be generated in the output folder. No file generated when set to null or empty string.")); @@ -222,6 +223,18 @@ public void processOpts() { .doNotOverwrite()); supportingFiles.add(new SupportingFile("dockerignore.mustache", "", ".dockerignore") .doNotOverwrite()); + if(returnResponse && returnJbossResponse) { + String msg = String.format(Locale.ROOT, + "You cannot combine [%s] and [%s] since they are mutually exclusive", + RETURN_RESPONSE, RETURN_JBOSS_RESPONSE); + throw new IllegalArgumentException(msg); + } + if(returnJbossResponse && !useJakartaEe) { + String msg = String.format(Locale.ROOT, + "The [%s] requires [%s] to be true, because org.jboss.resteasy.reactive.RestResponse was introduced in Quarkus 2.x", + RETURN_JBOSS_RESPONSE, USE_JAKARTA_EE); + throw new IllegalArgumentException(msg); + } } else if (OPEN_LIBERTY_LIBRARY.equals(library)) { supportingFiles.add(new SupportingFile("server.xml.mustache", "src/main/liberty/config", "server.xml") .doNotOverwrite()); diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/pom.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/pom.mustache index ef91cc3dfb27..006ca151cf64 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/pom.mustache @@ -79,6 +79,12 @@ quarkus-smallrye-openapi {{#useJakartaEe}} +{{#returnJBossResponse}} + + io.quarkus.resteasy.reactive + resteasy-reactive + +{{/returnJBossResponse}} jakarta.ws.rs jakarta.ws.rs-api 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 e72bccababdb..b9c6219b92d7 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 @@ -1038,6 +1038,9 @@ public void generateSpecInterfaceWithJBossResponse() throws Exception { "\nimport org.jboss.resteasy.reactive.RestResponse;\n", "RestResponse addPet", "RestResponse deletePet", "RestResponse> findPetsByStatus", "RestResponse updatePetWithForm", "RestResponse uploadFile"); + assertFileContains(output.toPath().resolve("pom.xml"), + "io.quarkus.resteasy.reactive", + "resteasy-reactive"); } @Test From 8a64d0d0133b607305e4af1815b9649582bfe71f Mon Sep 17 00:00:00 2001 From: Christophe Moine Date: Thu, 11 Sep 2025 17:20:52 +0200 Subject: [PATCH 8/9] fix JavaJAXRSSpecServerCodegenTest --- .../codegen/java/jaxrs/JavaJAXRSSpecServerCodegenTest.java | 2 ++ 1 file changed, 2 insertions(+) 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 b9c6219b92d7..52a281b12375 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 @@ -537,6 +537,7 @@ public void generateApiWithAsyncSupportAndInterfaceOnlyAndJBossResponse() throws codegen.additionalProperties().put(SUPPORT_ASYNC, true); //Given support async is enabled codegen.additionalProperties().put(INTERFACE_ONLY, true); //And only interfaces are generated codegen.additionalProperties().put(RETURN_JBOSS_RESPONSE, true); //And return type is RestResponse + codegen.additionalProperties().put(USE_JAKARTA_EE, true); //And return type is RestResponse final ClientOptInput input = new ClientOptInput() .openAPI(openAPI) @@ -1055,6 +1056,7 @@ public void generateSpecInterfaceWithMutinyAndJBossResponse() throws Exception { codegen.additionalProperties().put(INTERFACE_ONLY, true); //And only interfaces are generated codegen.additionalProperties().put(USE_TAGS, true); //And use tags to generate everything in several API files codegen.additionalProperties().put(RETURN_JBOSS_RESPONSE, true); // Use JBoss Response type + codegen.additionalProperties().put(USE_JAKARTA_EE, true); // Use JBoss Response type codegen.additionalProperties().put(SUPPORT_ASYNC, true); codegen.additionalProperties().put(USE_MUTINY, true); // Use Mutiny codegen.setLibrary(QUARKUS_LIBRARY); // Set Quarkus From 88ea698892ac4d2541b88389acdc50ca29f45401 Mon Sep 17 00:00:00 2001 From: Christophe Moine Date: Fri, 12 Sep 2025 10:01:44 +0200 Subject: [PATCH 9/9] generate samples & docs --- docs/generators/jaxrs-cxf-cdi.md | 1 + docs/generators/jaxrs-spec.md | 142 +++++++++--------- .../spec/libraries/quarkus/api.mustache | 3 +- .../org/openapitools/api/AnotherFakeApi.java | 1 + .../java/org/openapitools/api/FakeApi.java | 1 + .../api/FakeClassnameTestApi.java | 1 + .../gen/java/org/openapitools/api/PetApi.java | 1 + .../java/org/openapitools/api/StoreApi.java | 1 + .../java/org/openapitools/api/UserApi.java | 1 + .../org/openapitools/api/AnotherFakeApi.java | 1 + .../java/org/openapitools/api/FakeApi.java | 1 + .../api/FakeClassnameTestApi.java | 1 + .../gen/java/org/openapitools/api/FooApi.java | 1 + .../gen/java/org/openapitools/api/PetApi.java | 1 + .../java/org/openapitools/api/StoreApi.java | 1 + .../java/org/openapitools/api/UserApi.java | 1 + 16 files changed, 87 insertions(+), 72 deletions(-) diff --git a/docs/generators/jaxrs-cxf-cdi.md b/docs/generators/jaxrs-cxf-cdi.md index 48bf8680e429..e630a4f9348c 100644 --- a/docs/generators/jaxrs-cxf-cdi.md +++ b/docs/generators/jaxrs-cxf-cdi.md @@ -64,6 +64,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| |parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| +|returnJBossResponse|Whether generate API interface should return `org.jboss.resteasy.reactive.RestResponse` instead of a deserialized entity. This flag cannot be combined with `returnResponse` flag. It requires the flag `interfaceOnly` and `useJakartaEE` set to true, because `org.jboss.resteasy.reactive.RestResponse` was introduced in Quarkus 2.x| |false| |returnResponse|Whether generate API interface should return javax.ws.rs.core.Response instead of a deserialized entity. Only useful if interfaceOnly is true.| |false| |scmConnection|SCM connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| |scmDeveloperConnection|SCM developer connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| diff --git a/docs/generators/jaxrs-spec.md b/docs/generators/jaxrs-spec.md index 28829059e8de..39cb1f9eb168 100644 --- a/docs/generators/jaxrs-spec.md +++ b/docs/generators/jaxrs-spec.md @@ -16,77 +16,77 @@ title: Documentation for the jaxrs-spec Generator ## CONFIG OPTIONS These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. -| Option | Description | Values | Default | -|------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| ------ | ------- | -| additionalEnumTypeAnnotations | Additional annotations for enum type(class level annotations) | |null| -| additionalModelTypeAnnotations | Additional annotations for model type(class level annotations). List separated by semicolon(;) or new line (Linux or Windows) | |null| -| additionalOneOfTypeAnnotations | Additional annotations for oneOf interfaces(class level annotations). List separated by semicolon(;) or new line (Linux or Windows) | |null| -| allowUnicodeIdentifiers | boolean, toggles whether unicode identifiers are allowed in names or not, default is false | |false| -| apiPackage | package for generated api classes | |org.openapitools.api| -| artifactDescription | artifact description in generated pom.xml | |OpenAPI Java| -| artifactId | artifactId in generated pom.xml. This also becomes part of the generated library's filename | |openapi-jaxrs-server| -| artifactUrl | artifact URL in generated pom.xml | |https://github.com/openapitools/openapi-generator| -| artifactVersion | artifact version in generated pom.xml. This also becomes part of the generated library's filename. If not provided, uses the version from the OpenAPI specification file. If that's also not present, uses the default value of the artifactVersion option. | |1.0.0| -| bigDecimalAsString | Treat BigDecimal values as Strings to avoid precision loss. | |false| -| booleanGetterPrefix | Set booleanGetterPrefix | |get| -| camelCaseDollarSign | Fix camelCase when starting with $ sign. when true : $Value when false : $value | |false| -| containerDefaultToNull | Set containers (array, set, map) default to null | |false| -| dateLibrary | Option. Date library to use |
**joda**
Joda (for legacy app only)
**legacy**
Legacy java.util.Date
**java8-localdatetime**
Java 8 using LocalDateTime (for legacy app only)
**java8**
Java 8 native JSR310 (preferred for jdk 1.8+)
|legacy| -| developerEmail | developer email in generated pom.xml | |team@openapitools.org| -| developerName | developer name in generated pom.xml | |OpenAPI-Generator Contributors| -| developerOrganization | developer organization in generated pom.xml | |OpenAPITools.org| -| developerOrganizationUrl | developer organization URL in generated pom.xml | |http://openapitools.org| -| disableHtmlEscaping | Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields) | |false| -| disallowAdditionalPropertiesIfNotPresent | If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default. |
**false**
The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
**true**
Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
|true| -| discriminatorCaseSensitive | Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client | |true| -| ensureUniqueParams | Whether to ensure parameter names are unique in an operation (rename parameters that are not). | |true| -| enumPropertyNaming | Naming convention for enum properties: 'MACRO_CASE', 'legacy' and 'original' | |MACRO_CASE| -| 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 enum's 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| -| generatePom | Whether to generate pom.xml if the file does not already exist. | |true| -| groupId | groupId in generated pom.xml | |org.openapitools| -| hideGenerationTimestamp | Hides the generation timestamp when files are generated. | |false| -| ignoreAnyOfInEnum | Ignore anyOf keyword in enum | |false| -| implFolder | folder for generated implementation code | |src/main/java| -| implicitHeaders | Skip header parameters in the generated API methods using @ApiImplicitParams annotation. | |false| -| implicitHeadersRegex | Skip header parameters that matches given regex in the generated API methods using @ApiImplicitParams annotation. Note: this parameter is ignored when implicitHeaders=true | |null| -| interfaceOnly | Whether to generate only API interface stubs without the server files. | |false| -| invokerPackage | root package for generated code | |org.openapitools.api| -| legacyDiscriminatorBehavior | Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default). |
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
|true| -| library | library template (sub-template) |
**<default>**
JAXRS spec only, to be deployed in an app server (TomEE, JBoss, WLS, ...)
**quarkus**
Server using Quarkus
**thorntail**
Server using Thorntail
**openliberty**
Server using Open Liberty
**helidon**
Server using Helidon
**kumuluzee**
Server using KumuluzEE
|<default>| -| licenseName | The name of the license | |Unlicense| -| licenseUrl | The URL of the license | |http://unlicense.org| -| modelPackage | package for generated models | |org.openapitools.model| -| openApiNullable | Enable OpenAPI Jackson Nullable library. Not supported by `microprofile` library. | |true| -| openApiSpecFileLocation | Location where the file containing the spec will be generated in the output folder. No file generated when set to null or empty string. | |null| -| parentArtifactId | parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect | |null| -| parentGroupId | parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect | |null| -| parentVersion | parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect | |null| -| prependFormOrBodyParameters | Add form or body parameters to the beginning of the parameter list. | |false| -| returnResponse | Whether generate API interface should return `javax.ws.rs.core.Response` instead of a deserialized entity. Only useful if interfaceOnly is true. | |false| -| returnJBossResponse | Whether generate API interface should return `org.jboss.resteasy.reactive.RestResponse` instead of a deserialized entity. This flag cannot be combined with `returnResponse` flag. It requires the flag `interfaceOnly` and `useJakartaEE` set to true, because `org.jboss.resteasy.reactive.RestResponse` was introduced in Quarkus 2.x | |false| -| scmConnection | SCM connection in generated pom.xml | |scm:git:git@github.com:openapitools/openapi-generator.git| -| 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| -| 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| -| sortParamsByRequiredFlag | Sort method arguments to place required parameters before optional parameters. | |true| -| sourceFolder | source folder for generated code | |src/gen/java| -| supportAsync | Wrap responses in CompletionStage type, allowing asynchronous computation (requires JAX-RS 2.1). | |false| -| testOutput | Set output folder for models and APIs tests | |${project.build.directory}/generated-test-sources/openapi| -| title | a title describing the application | |OpenAPI Server| -| useBeanValidation | Use BeanValidation API annotations | |true| -| useJakartaEe | whether to use Jakarta EE namespace instead of javax | |false| -| useMicroProfileOpenAPIAnnotations | Whether to generate Microprofile OpenAPI annotations. Only valid when library is set to quarkus. | |false| -| useMutiny | Whether to use Smallrye Mutiny instead of CompletionStage for asynchronous computation. Only valid when library is set to quarkus. | |false| -| useOneOfInterfaces | whether to use a java interface to describe a set of oneOf options, where each option is a class that implements the interface | |false| -| useSwaggerAnnotations | Whether to generate Swagger annotations. | |true| -| useTags | use tags for creating interface and controller classnames | |false| -| withXml | whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML) | |false| +| Option | Description | Values | Default | +| ------ | ----------- | ------ | ------- | +|additionalEnumTypeAnnotations|Additional annotations for enum type(class level annotations)| |null| +|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations). List separated by semicolon(;) or new line (Linux or Windows)| |null| +|additionalOneOfTypeAnnotations|Additional annotations for oneOf interfaces(class level annotations). List separated by semicolon(;) or new line (Linux or Windows)| |null| +|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| +|apiPackage|package for generated api classes| |org.openapitools.api| +|artifactDescription|artifact description in generated pom.xml| |OpenAPI Java| +|artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |openapi-jaxrs-server| +|artifactUrl|artifact URL in generated pom.xml| |https://github.com/openapitools/openapi-generator| +|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename. If not provided, uses the version from the OpenAPI specification file. If that's also not present, uses the default value of the artifactVersion option.| |1.0.0| +|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false| +|booleanGetterPrefix|Set booleanGetterPrefix| |get| +|camelCaseDollarSign|Fix camelCase when starting with $ sign. when true : $Value when false : $value| |false| +|containerDefaultToNull|Set containers (array, set, map) default to null| |false| +|dateLibrary|Option. Date library to use|
**joda**
Joda (for legacy app only)
**legacy**
Legacy java.util.Date
**java8-localdatetime**
Java 8 using LocalDateTime (for legacy app only)
**java8**
Java 8 native JSR310 (preferred for jdk 1.8+)
|legacy| +|developerEmail|developer email in generated pom.xml| |team@openapitools.org| +|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors| +|developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org| +|developerOrganizationUrl|developer organization URL in generated pom.xml| |http://openapitools.org| +|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false| +|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
**false**
The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
**true**
Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
|true| +|discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumPropertyNaming|Naming convention for enum properties: 'MACRO_CASE', 'legacy' and 'original'| |MACRO_CASE| +|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 enum's 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| +|generatePom|Whether to generate pom.xml if the file does not already exist.| |true| +|groupId|groupId in generated pom.xml| |org.openapitools| +|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| +|ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false| +|implFolder|folder for generated implementation code| |src/main/java| +|implicitHeaders|Skip header parameters in the generated API methods using @ApiImplicitParams annotation.| |false| +|implicitHeadersRegex|Skip header parameters that matches given regex in the generated API methods using @ApiImplicitParams annotation. Note: this parameter is ignored when implicitHeaders=true| |null| +|interfaceOnly|Whether to generate only API interface stubs without the server files.| |false| +|invokerPackage|root package for generated code| |org.openapitools.api| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
|true| +|library|library template (sub-template)|
**<default>**
JAXRS spec only, to be deployed in an app server (TomEE, JBoss, WLS, ...)
**quarkus**
Server using Quarkus
**thorntail**
Server using Thorntail
**openliberty**
Server using Open Liberty
**helidon**
Server using Helidon
**kumuluzee**
Server using KumuluzEE
|<default>| +|licenseName|The name of the license| |Unlicense| +|licenseUrl|The URL of the license| |http://unlicense.org| +|modelPackage|package for generated models| |org.openapitools.model| +|openApiNullable|Enable OpenAPI Jackson Nullable library. Not supported by `microprofile` library.| |true| +|openApiSpecFileLocation|Location where the file containing the spec will be generated in the output folder. No file generated when set to null or empty string.| |null| +|parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| +|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| +|parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| +|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| +|returnJBossResponse|Whether generate API interface should return `org.jboss.resteasy.reactive.RestResponse` instead of a deserialized entity. This flag cannot be combined with `returnResponse` flag. It requires the flag `interfaceOnly` and `useJakartaEE` set to true, because `org.jboss.resteasy.reactive.RestResponse` was introduced in Quarkus 2.x| |false| +|returnResponse|Whether generate API interface should return javax.ws.rs.core.Response instead of a deserialized entity. Only useful if interfaceOnly is true.| |false| +|scmConnection|SCM connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| +|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| +|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| +|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| +|sourceFolder|source folder for generated code| |src/gen/java| +|supportAsync|Wrap responses in CompletionStage type, allowing asynchronous computation (requires JAX-RS 2.1).| |false| +|testOutput|Set output folder for models and APIs tests| |${project.build.directory}/generated-test-sources/openapi| +|title|a title describing the application| |OpenAPI Server| +|useBeanValidation|Use BeanValidation API annotations| |true| +|useJakartaEe|whether to use Jakarta EE namespace instead of javax| |false| +|useMicroProfileOpenAPIAnnotations|Whether to generate Microprofile OpenAPI annotations. Only valid when library is set to quarkus.| |false| +|useMutiny|Whether to use Smallrye Mutiny instead of CompletionStage for asynchronous computation. Only valid when library is set to quarkus.| |false| +|useOneOfInterfaces|whether to use a java interface to describe a set of oneOf options, where each option is a class that implements the interface| |false| +|useSwaggerAnnotations|Whether to generate Swagger annotations.| |true| +|useTags|use tags for creating interface and controller classnames| |false| +|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false| ## SUPPORTED VENDOR EXTENSIONS diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/api.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/api.mustache index 2b738861bffc..4827abaf35b0 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/api.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/api.mustache @@ -4,7 +4,8 @@ package {{package}}; {{/imports}} import {{javaxPackage}}.ws.rs.*; -{{#returnJBossResponse}}import org.jboss.resteasy.reactive.RestResponse;{{/returnJBossResponse}}{{^returnJBossResponse}}{{#returnResponse}}import {{javaxPackage}}.ws.rs.core.Response;{{/returnResponse}}{{/returnJBossResponse}} +import {{javaxPackage}}.ws.rs.core.Response; +{{#returnJBossResponse}}import org.jboss.resteasy.reactive.RestResponse;{{/returnJBossResponse}} {{#useGzipFeature}} import org.jboss.resteasy.annotations.GZIP; diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/api/AnotherFakeApi.java index 91fe5a2db370..97e64f08063e 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/api/AnotherFakeApi.java @@ -9,6 +9,7 @@ + import java.io.InputStream; import java.util.Map; import java.util.List; diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/api/FakeApi.java index 7f441ec467d5..6a16ff036ba3 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/api/FakeApi.java @@ -18,6 +18,7 @@ + import java.io.InputStream; import java.util.Map; import java.util.List; diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/api/FakeClassnameTestApi.java index 65c6df9374da..909818bf4430 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/api/FakeClassnameTestApi.java @@ -8,6 +8,7 @@ + import java.io.InputStream; import java.util.Map; import java.util.List; diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/api/PetApi.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/api/PetApi.java index 7b4b4dbd647b..042036a1bde5 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/api/PetApi.java @@ -11,6 +11,7 @@ + import java.io.InputStream; import java.util.Map; import java.util.List; diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/api/StoreApi.java index b247855fdb2b..be5d4b9e8f3f 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/api/StoreApi.java @@ -9,6 +9,7 @@ + import java.io.InputStream; import java.util.Map; import java.util.List; diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/api/UserApi.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/api/UserApi.java index 8b986774d0b6..1e7dc6ad9e56 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/api/UserApi.java @@ -9,6 +9,7 @@ + import java.io.InputStream; import java.util.Map; import java.util.List; diff --git a/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/api/AnotherFakeApi.java index 6107a5af168f..c95412723598 100644 --- a/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/api/AnotherFakeApi.java @@ -8,6 +8,7 @@ + import java.io.InputStream; import java.util.Map; import java.util.List; diff --git a/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/api/FakeApi.java index e60820ee5f9e..e8f14516dfaf 100644 --- a/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/api/FakeApi.java @@ -24,6 +24,7 @@ + import java.io.InputStream; import java.util.Map; import java.util.List; diff --git a/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/api/FakeClassnameTestApi.java index 3b4316c13a79..a603de1cb85d 100644 --- a/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/api/FakeClassnameTestApi.java @@ -8,6 +8,7 @@ + import java.io.InputStream; import java.util.Map; import java.util.List; diff --git a/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/api/FooApi.java b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/api/FooApi.java index fd490ff566d2..be43dc198056 100644 --- a/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/api/FooApi.java +++ b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/api/FooApi.java @@ -8,6 +8,7 @@ + import java.io.InputStream; import java.util.Map; import java.util.List; diff --git a/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/api/PetApi.java b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/api/PetApi.java index 5fb0c3306cb5..7db07aabca56 100644 --- a/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/api/PetApi.java @@ -11,6 +11,7 @@ + import java.io.InputStream; import java.util.Map; import java.util.List; diff --git a/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/api/StoreApi.java index 6f1caf4f5bae..63ae1eb6eaa7 100644 --- a/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/api/StoreApi.java @@ -9,6 +9,7 @@ + import java.io.InputStream; import java.util.Map; import java.util.List; diff --git a/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/api/UserApi.java b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/api/UserApi.java index b14f26abb7c8..06e7892070b3 100644 --- a/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/jaxrs-spec-quarkus-mutiny/src/gen/java/org/openapitools/api/UserApi.java @@ -9,6 +9,7 @@ + import java.io.InputStream; import java.util.Map; import java.util.List;