Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RestResponse usability #20031

Closed
geoand opened this issue Sep 9, 2021 · 5 comments · Fixed by #21293
Closed

RestResponse usability #20031

geoand opened this issue Sep 9, 2021 · 5 comments · Fixed by #21293
Labels
area/rest kind/enhancement New feature or request
Milestone

Comments

@geoand
Copy link
Contributor

geoand commented Sep 9, 2021

Description

I expected to be able to write something like:

    @Path("{id}")
    @GET
    public RestResponse<String> something(int id) {
        if (id % 2 == 0) {
            return RestResponse.ok("good");
        } else {
            return RestResponse.notFound();
        }
    }

However I can't because notFound() returns RestResponse<Void>.

This really limits the usability of RestResponse

Implementation ideas

No response

@geoand geoand added the kind/enhancement New feature or request label Sep 9, 2021
@geoand
Copy link
Contributor Author

geoand commented Sep 9, 2021

cc @FroMage

@quarkus-bot
Copy link

quarkus-bot bot commented Sep 10, 2021

/cc @FroMage, @stuartwdouglas

@FroMage
Copy link
Member

FroMage commented Nov 3, 2021

Yeah, I noticed this too. I'm not sure how to solve it, but we should.

@geoand
Copy link
Contributor Author

geoand commented Nov 8, 2021

I am not sure either, but this is severely limiting the usability of RestResponse

stuartwdouglas added a commit to stuartwdouglas/quarkus that referenced this issue Nov 8, 2021
@stuartwdouglas
Copy link
Member

I have proposed a solution at #21293

@quarkus-bot quarkus-bot bot added this to the 2.5 - main milestone Nov 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/rest kind/enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants