question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Changing content-type for Json serialization not working after upgrade

See original GitHub issue

Describe 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:closed
  • Created a year ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
gsmetcommented, Oct 7, 2022

Please prepare a simple Maven reproducer.

0reactions
geoandcommented, Oct 10, 2022

You need to use quarkus-resteasy-reactive-jackson in your dependencies

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found