Skip to content

[jaxrs-spec][quarkus] Add an option to use "org.jboss.resteasy.reactive.RestResponse" #21424

Description

@cmoine-swi

I'm using jaxrs-spec generator with library=quarkus which is the best generator I have found for Quarkus (compared to jaxrs-resteasy and https://github.com/quarkiverse/quarkus-openapi-generator). However, I can't find the proper way to generate Api methods to specify a status code.
When I use the option returnResponse=true, it generates this kind of method signature (the implementation should return code 201 for CREATED:

@POST
@Produces({ "application/json" })
Response create();

Unfortunatly jakarta.ws.rs.core.Response is not generic, and allows returning any type, which prevents an API-first approach.

Without this option, we are not able to specify the CREATED status code.

It would be great to generate the return type org.jboss.resteasy.reactive.RestResponse instead, as documented here, either by modifying the actual behavior, or with a new option useJbossResponse).

This feature is somehow related to #21360, but the approach is more generic.

I can help with a PR ;-)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions