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

Vert.x Routes Not Working when using Void methods #15470

Closed
Sgitario opened this issue Mar 4, 2021 · 1 comment · Fixed by #15572
Closed

Vert.x Routes Not Working when using Void methods #15470

Sgitario opened this issue Mar 4, 2021 · 1 comment · Fixed by #15572
Assignees
Labels
kind/bug Something isn't working
Milestone

Comments

@Sgitario
Copy link
Contributor

Sgitario commented Mar 4, 2021

Describe the bug
Having the next route:

@Route(methods = HttpMethod.GET, path = "/method-return-empty/:first_param")
    void validateMethodWithEmptyResponse(@Param("first_param") String param) {
        // do nothing
    }

When we call this route via CURL, it fails with Read timed out.

Expected behavior
The service should return 204 No Content.

Actual behavior
The servide hangs to return anything.

Environment (please complete the following information):

  • Quarkus version or git rev: 999-SNAPSHOT
@Sgitario Sgitario added the kind/bug Something isn't working label Mar 4, 2021
@mkouba
Copy link
Contributor

mkouba commented Mar 9, 2021

Hi @Sgitario, this behavior is expected. In fact, the build should fail if a similar @Route method is found. We should improve the validation logic - currently, it only fails if a method that return void does not declare any parameters. This logic is not valid since quarkus 1.7 where @Param, @Body and others non-RoutingContext params were added.

For the record - a @Route method must either (a) return non-void result or (b) end the response via one of the HttpServerResponse.end() methods.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants