-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Mediatype defaults to the first listed mediatype in MessageBodyWriter (resteasy-reactive) #22119
Comments
/cc @FroMage, @geoand, @stuartwdouglas |
Problem reproduced with several Quarkus versions, latest version 2.5.0.Final |
What HTTP request are you sending to the endpoint? |
Closing as we did not get feedback. |
Heres a sample project showing the problem https://github.com/carlevert/resteasy-reactive-mediatype-bug. |
geoand
removed
the
triage/out-of-date
This issue/PR is no longer valid or relevant
label
Mar 31, 2022
geoand
added a commit
to geoand/quarkus
that referenced
this issue
Apr 1, 2022
#24687 fixes the problem |
geoand
added a commit
to geoand/quarkus
that referenced
this issue
Apr 1, 2022
geoand
added a commit
that referenced
this issue
Apr 1, 2022
Improve dynamic resolution of MessageBodyWriter providers
gsmet
pushed a commit
to gsmet/quarkus
that referenced
this issue
Apr 11, 2022
Fixes: quarkusio#22119 (cherry picked from commit 89cc5ac)
gsmet
pushed a commit
to gsmet/quarkus
that referenced
this issue
May 12, 2022
Fixes: quarkusio#22119 (cherry picked from commit 89cc5ac)
michalvavrik
added a commit
to michalvavrik/quarkus-test-suite
that referenced
this issue
Jun 2, 2022
Verifies [Quarkus Issue 22119](quarkusio/quarkus#22119). According to JAX-RS standard, if request specifies accepted Media type, the type should be passed to `javax.ws.rs.ext.MessageBodyWriter`, however for use case when `javax.ws.rs.core.Response` is returned, that was only fixed in Quarkus 2.8.1 and backported to 2.7.6. Previously, if multiple media types were defined in `@Produces`, the first one was taken. This test verifies that a value of `Accept` HTTP header is same as the media type passed to `MessageBodyWriter` when endpoint response type is `Response`.
7 tasks
michalvavrik
added a commit
to michalvavrik/quarkus-test-suite
that referenced
this issue
Jun 2, 2022
Verifies [Quarkus Issue 22119](quarkusio/quarkus#22119). According to JAX-RS standard, if request specifies accepted Media type, the type should be passed to `javax.ws.rs.ext.MessageBodyWriter`, however for use case when `javax.ws.rs.core.Response` is returned, that was only fixed in Quarkus 2.8.1 and backported to 2.7.6. Previously, if multiple media types were defined in `@Produces`, the first one was taken. This test verifies that a value of `Accept` HTTP header is same as the media type passed to `MessageBodyWriter` when endpoint response type is `Response`.
michalvavrik
added a commit
to michalvavrik/quarkus-test-suite
that referenced
this issue
Jun 3, 2022
Verifies [Quarkus Issue 22119](quarkusio/quarkus#22119). According to JAX-RS standard, if request specifies accepted Media type, the type should be passed to `javax.ws.rs.ext.MessageBodyWriter`, however for use case when `javax.ws.rs.core.Response` is returned, that was only fixed in Quarkus 2.8.1 and backported to 2.7.6. Previously, if multiple media types were defined in `@Produces`, the first one was taken. This test verifies that a value of `Accept` HTTP header is same as the media type passed to `MessageBodyWriter` when endpoint response type is `Response`.
pjgg
pushed a commit
to pjgg/quarkus-test-suite
that referenced
this issue
Jun 6, 2022
Verifies [Quarkus Issue 22119](quarkusio/quarkus#22119). According to JAX-RS standard, if request specifies accepted Media type, the type should be passed to `javax.ws.rs.ext.MessageBodyWriter`, however for use case when `javax.ws.rs.core.Response` is returned, that was only fixed in Quarkus 2.8.1 and backported to 2.7.6. Previously, if multiple media types were defined in `@Produces`, the first one was taken. This test verifies that a value of `Accept` HTTP header is same as the media type passed to `MessageBodyWriter` when endpoint response type is `Response`. (cherry picked from commit 7f245d1)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
The MediaType argument in a MessageBodyWriter<> defaults to the first listed mediatype in the resource.
Expected behavior
Expecting behaviour according to JAX-RS standard.
In the example above, the MediaType argument is always application/json in the MessageBodyWriter.
In the resource method the acceptable media types is handled correctly.
Actual behavior
The media type in the MessageBodyWriter<> is always the first listed media type from the resources methods @provides list of media types.
How to Reproduce?
No response
Output of
uname -a
orver
No response
Output of
java -version
No response
GraalVM version (if different from Java)
No response
Quarkus version or git rev
No response
Build tool (ie. output of
mvnw --version
orgradlew --version
)No response
Additional information
Sorry for the bad formatting of the code.
https://stackoverflow.com/questions/69844238/mediatype-is-always-application-json-in-messagebodywriter-in-quarkus-with-quarku
The text was updated successfully, but these errors were encountered: