Skip to content

Conversation

@cmoine-swi
Copy link
Contributor

@cmoine-swi cmoine-swi commented Sep 3, 2025

PR for #21424

  • Add generator option useJBossResponse to use typed org.jboss.resteasy.reactive.RestResponse instead of javax.ws.rs.core.Response (see here)
  • Add tests
  • Update documentation

@cmoine-swi cmoine-swi marked this pull request as draft September 3, 2025 09:32
@wing328
Copy link
Member

wing328 commented Sep 4, 2025

thanks for the PR

cc @bbdouglas (2017/07) @sreeshas (2017/08) @jfiala (2017/08) @lukoyanov (2017/09) @cbornet (2017/09) @jeff9finger (2018/01) @karismann (2019/03) @Zomzog (2019/04) @lwlee2608 (2019/10) @martin-mfg (2023/08)

@wing328
Copy link
Member

wing328 commented Sep 4, 2025

did you test this PR locally to confirm it works for your use cases?

@cmoine-swi
Copy link
Contributor Author

Hi @wing328, I just tested, and I confirm that version "7.16.0-SNAPSHOT" works on my project 👍

@wing328
Copy link
Member

wing328 commented Sep 6, 2025

i tested with

java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -g jaxrs-spec --library quarkus -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -o /tmp/jaxrs2/ --additional-properties returnJBossResponse=true,interfaceOnly=true

but the output won't compile

does it work for you locally in your machine?

@wing328
Copy link
Member

wing328 commented Sep 6, 2025

please also follow step 3 in the PR checklist to update samples and doc

@wing328
Copy link
Member

wing328 commented Sep 6, 2025

instead of adding a new option, what about updating the existing one returnResponse to have one additional option to support your use cases?

@petretiandrea
Copy link

+1

@cmoine-swi
Copy link
Contributor Author

cmoine-swi commented Sep 11, 2025

instead of adding a new option, what about updating the existing one returnResponse to have one additional option to support your use cases?

That was tempting @wing328 , but I was concerned about the migration for existing users. The type would change.
It sounds like a three-state boolean. I thought it would be a bit strange. What do you suggest as values? true/false/jboss?

i tested with

java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -g jaxrs-spec --library quarkus -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -o /tmp/jaxrs2/ --additional-properties returnJBossResponse=true,interfaceOnly=true

but the output won't compile

does it work for you locally in your machine?

Good catch! An issue with the pom.xml. I had an existing pom.xml which is why it worked on my side. I will fix it.

@cmoine-swi
Copy link
Contributor Author

pom.xml generation was fixed @wing328, however, I had to change rules a bit: RestResponseis only available from Quarkus 2.x, so it needs the useJakartaEe to be enabled. I updated the document accordingly (and samples 🙏). I also raise an exception when the conditions are not met.

@wing328
Copy link
Member

wing328 commented Sep 14, 2025

tested again and the output compiles without issues

Downloading from central: https://repo.maven.apache.org/maven2/io/quarkus/quarkus-smallrye-openapi-deployment/3.0.1.Final/quarkus-smallrye-openapi-deployment-3.0.1.Final.jar
Downloaded from central: https://repo.maven.apache.org/maven2/io/quarkus/quarkus-smallrye-openapi-deployment/3.0.1.Final/quarkus-smallrye-openapi-deployment-3.0.1.Final.jar (47 kB at 208 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/io/quarkus/quarkus-universe-bom-quarkus-platform-properties/3.0.1.Final/quarkus-universe-bom-quarkus-platform-properties-3.0.1.Final.properties
Downloaded from central: https://repo.maven.apache.org/maven2/io/quarkus/quarkus-universe-bom-quarkus-platform-properties/3.0.1.Final/quarkus-universe-bom-quarkus-platform-properties-3.0.1.Final.properties (113 B at 356 B/s)
[INFO] [io.quarkus.deployment.QuarkusAugmentor] Quarkus augmentation completed in 3657ms
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  01:21 min
[INFO] Finished at: 2025-09-14T17:09:55+08:00
[INFO] ------------------------------------------------------------------------

@wing328 wing328 merged commit ee4cb9a into OpenAPITools:master Sep 14, 2025
36 checks passed
Goopher pushed a commit to Goopher/openapi-generator that referenced this pull request Sep 16, 2025
…reactive.RestResponse" (OpenAPITools#21877)

* replace Response by RestResponse

* fix rest response for Async

* update documentation

* Add option "returnJBossResponse"

* Add tests + fixes

* Polish

* Add dependency "io.quarkus.resteasy.reactive:resteasy-reactive" when returnJBossResponse=true

* fix JavaJAXRSSpecServerCodegenTest

* generate samples & docs
@wing328 wing328 added this to the 7.16.0 milestone Sep 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants