Replies: 1 comment
-
I found the solution. I needed to create @Provider MessageBodyWriter for each entity. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
We have an @interceptor class and the @AroundInvoke method that validates POST & PUT for Jakarta validation errors and then it throws the following code:
TestResponse entity = new TestResponse("error", "violation"); throw new BadRequestException(Response.status(Response.Status.BAD_REQUEST) .entity(entity) .build());
However the response returned to the caller is an empty json object, e.g. {}. The Quarkus code can't serialized any custom Pojos set as the entity above. It will work for simple JDK types only, e.g. Maps works.
So what is catching this exception and serializing the entity?
We do have @Provider classes that implement ExceptionMapper but those are not catching the above exception.
It seems that @interceptor classes don't use @Provider ExceptionMapper classes? What is catching the exception and what serializer is it using?
Beta Was this translation helpful? Give feedback.
All reactions