Customize Quarkus content negotiation #44370
-
Hi, I'm trying to implement rfc9457 style error handling for a service, basically returning error response bodies in json format using the content type "application/problem+json". This should be controlled via the Accept header, i.e. if the client accepts "application/problem+json" I return the error json and a plain text error otherwise (this is also important for backwards compatibility), which I implemented in an |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I'm not sure I fully understand your problem because I would expect your clients to say that they support both With this in mind, I wouldn't expect any issue when negotiating the content type? Or does Quarkus checks the If what I'm saying doesn't make any sense, maybe a small reproducer could help so that we could have a look at what's going on? |
Beta Was this translation helpful? Give feedback.
I'm not sure I fully understand your problem because I would expect your clients to say that they support both
application/json
andapplication/problem+json
with the latter having a lower priority.With this in mind, I wouldn't expect any issue when negotiating the content type? Or does Quarkus checks the
Content-Type
also when pushing the Response? I would have expected that you could do whatever you want in the response.If what I'm saying doesn't make any sense, maybe a small reproducer could help so that we could have a look at what's going on?