-
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
Hibernate validator responses with wrong Content-Type header when working in reactive mode #28324
Labels
Milestone
Comments
@geoand looks more like a RESTEasy Reactive issue to me. The OP provided a reproducer above. I think there are two issues here: the content type and the content itself, which should probably be made more readable (not sure how RESTEasy Classic handles text plain validation). |
I'll have a look next week. Thanks for the heads up |
geoand
added a commit
to geoand/quarkus
that referenced
this issue
Oct 3, 2022
…on error report Fixes: quarkusio#28324
#28343 takes care of it |
gsmet
added a commit
that referenced
this issue
Oct 3, 2022
Properly take produced media type into account when building validation error report
gsmet
pushed a commit
to gsmet/quarkus
that referenced
this issue
Oct 3, 2022
…on error report Fixes: quarkusio#28324 (cherry picked from commit 7fa40d0)
igorregis
pushed a commit
to igorregis/quarkus
that referenced
this issue
Oct 16, 2022
…on error report Fixes: quarkusio#28324
igorregis
pushed a commit
to igorregis/quarkus
that referenced
this issue
Oct 16, 2022
…on error report Fixes: quarkusio#28324
igorregis
pushed a commit
to igorregis/quarkus
that referenced
this issue
Oct 16, 2022
…on error report Fixes: quarkusio#28324
igorregis
pushed a commit
to igorregis/quarkus
that referenced
this issue
Oct 17, 2022
…on error report Fixes: quarkusio#28324
tmihalac
pushed a commit
to tmihalac/quarkus
that referenced
this issue
Oct 27, 2022
…on error report Fixes: quarkusio#28324
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Describe the bug
I have two Resteasy Reactive endpoints, both have
@Digits
annotation from Hibernate Validator. One of the endpoint doesn't have any@Produces
annotations, another has@Produces(MediaType.TEXT_PLAIN)
. When querying both with invalid values, both return message with headerContent-Type=application/json
(1) and with body, which is not json(2).When
quarkus-resteasy-reactive
is replaced withquarkus-resteasy
, both headers contain "text/plain".Expected behavior
Validation messages should have "Content-Type" header, which faithfully describes content of body.
If endpoint has
@Produces
annotation, then content and headers of validation messages should conform to it.If endpoint has no
@Produces
annotation, then validation messages should return text, to mirror the behavior of classic implementation.Actual behavior
Both endpoints return responses with header
Content-Type=application/json
and bodies like that:for comparison, proper json endpoints return bodies, like this:
How to Reproduce?
git clone [email protected]:fedinskiy/reproducer.git -b reproducer/validator-json-header
mvn clean verify -Preactive
mvn clean verify -Pclassic
to verify, that classic version works as expectedOutput of
uname -a
orver
2.12.3.Final
Output of
java -version
11.0.16 temurin
GraalVM version (if different from Java)
No response
Quarkus version or git rev
2.12.3.Final
Build tool (ie. output of
mvnw --version
orgradlew --version
)Apache Maven 3.8.6 (84538c9988a25aec085021c365c560670ad80f63)
Additional information
No response
The text was updated successfully, but these errors were encountered: