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

MessageBodyWriter is not used with null Accept header with quarkus-resteasy #42854

Open
jcarranzan opened this issue Aug 29, 2024 · 2 comments
Open
Labels
area/resteasy-classic kind/bug Something isn't working

Comments

@jcarranzan
Copy link
Contributor

Describe the bug

Verifying backport for 3.8.6 #41411 Ensure that MessageBodyWriter is passed the proper media type and doing a small test coverage in our quarkus test suite, I've noticed that it's not working with quarkus-resteasy, not sure if it's the behavior expected.

Expected behavior

It works same as with quarkus-rest dependency

Actual behavior

MessageBodyWriter<String> is ignored and then the response is not expected.

How to Reproduce?

  1. Clone my reproducer:
    git clone -b accept-no-header https://github.com/jcarranzan/quarkus-reproducer.git
  2. Execute mvn clean verify
  3. Output:
Response body doesn't match expectation.
Expected: is "Headers response: Hello RESTEasy"
  Actual: Hello RESTEasy

Output of uname -a or ver

No response

Output of java -version

No response

Quarkus version or git rev

No response

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

No response

@geoand
Copy link
Contributor

geoand commented Aug 29, 2024

cc @jamezp

@jedla97
Copy link
Contributor

jedla97 commented Sep 2, 2024

Note: I was working where @jcarranzan left and this bug seems really strange. I update his reproducer to resource class looking like this:

@Path("/hello")
public class GreetingResource {
    @GET
    @Path("/any")
    public String headers() {
        return "ok";
    }
    @GET
    @Path("/hello")
    @Produces(MediaType.TEXT_PLAIN)
    public String hello() {
        return "Hello RESTEasy";
    }
}

and in attached test only path from /hello to /hello/hello was changed

So to fix his reproducer is enough to add one endpoint.

Additional findings:
In addition when both of these endpoints are anotated with @Produces(MediaType.TEXT_PLAIN) it start failing again.

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

No branches or pull requests

4 participants