Changing content-type for Json serialization not working after upgrade
See original GitHub issueDescribe the bug
I have a REST end-point (POST) which accepts a Json body (JsonObject from vertx-core)
@POST
public Uni<Response> postOperations(final JsonObject body) {
I’m using Json-API and thus want to accept a custom header which is done by using the @Consumes
header on my class:
@Consumes("application/vnd.api+json")
public class OperationResource {
This worked fine until migrating from Quarkus 2.8.0.Final
to 2.12.3.Final
and I guess can be caused by moving to RestEasy Reactive.
Now if I send a request with Content-Type: application/vnd.api+json
it throws a NotSupportedException
and won’t hit my end-point at all.
The only way I can make it work is by changing the method to accept String instead of JsonObject:
@POST
public Uni<Response> postOperations(final String body) {
But then I have to parse the Json manually myself and handle errors.
Issue Analytics
- State:
- Created a year ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
JSON serialization/deserialization not working when migrating ...
Try adding the FromBodyAttribute to your parameter: [HttpPost] public async Task<JsonResult> foo([FromBody] FooRequest request) { //request.
Read more >How to change the Content Type to Json??? - MSDN - Microsoft
It is converting it to JSON using the class i built but my problem is the content type that gets returned from the...
Read more >Response content type in custom exception middleware ...
The problem is I need a return response in proper format - not only JSON. It is possible to get for formatters from...
Read more >Content negotiation and serialization | Ktor
Serializing /deserializing the content in a specific format when sending requests and receiving responses. Ktor supports the following formats ...
Read more >Rendering Output - R Plumber
This creates ambiguity when serializing an R object to JSON since it is ... does no serialization of the response but specifies the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Please prepare a simple Maven reproducer.
You need to use
quarkus-resteasy-reactive-jackson
in your dependencies