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.

ObjectMapperCustomizer not working with JAX-RS client

See original GitHub issue

Describe the bug When using the JAX-RS client obtained through JAX-RS’ ClientBuilder (e.g. ClientBuilder.newClient()) any custom ObjectMapperCustomizers are not respected as they are with the MicroProfile REST client.

Expected behavior The ObjectMapper used by a JAX-RS client constructed using ClientBuilder.newClient() should also have been customized by any registered ObjectMapperCustomizers.

Actual behavior For a reproducible example see https://github.com/knutwannheden/quarkus-bug-jaxrs-object-mapper, where the ObjectMapper is customized by calling objectMapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES). The repo contains a test case demonstrating that this works as expected for MicroProfile REST client but fails with the JAX-RS client.

To Reproduce Steps to reproduce the behavior:

  1. git clone https://github.com/knutwannheden/quarkus-bug-jaxrs-object-mapper
  2. cd quarkus-bug-jaxrs-object-mapper/
  3. mvn clean verify

Environment (please complete the following information):

  • Output of uname -a or ver: MSYS_NT-10.0-19042 DESKTOP-HR8N4ES 3.1.4-340.x86_64 2020-05-19 12:55 UTC x86_64 Msys
  • Output of java -version: openjdk version “11.0.7” 2020-04-14 LTS
  • GraalVM version (if different from Java):
  • Quarkus version or git rev: 1.8.0.CR1
  • Build tool (ie. output of mvnw --version or gradlew --version): Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:14 (14 by maintainers)

github_iconTop GitHub Comments

1reaction
gsmetcommented, Sep 15, 2020

I will have a look tomorrow. It bugs me.

0reactions
geoandcommented, Jul 27, 2021

I am going to close this as this should work properly with managed quarkus-jaxrs-client-reactive

Read more comments on GitHub >

github_iconTop Results From Across the Web

RESTEasy Classic - Quarkus
This guide is about RESTEasy Classic which used to be the default JAX-RS ... there is another guide if you need a REST...
Read more >
How to configure ObjectMapper for Quarkus REST Client
I ran into the same issue. Through a lot of trial and error I found the following works: First, define a class that...
Read more >
Home of Quarkus Cheat-Sheet - GitHub Pages
run method called when Quarkus starts, and stops when it finishes. As Java main : ... You can still use the JAX-RS client...
Read more >
Customizing ObjectMapper in a JAX-RS application
I am a software engineer living and working in Ireland. And this is my not-so-frequently-updated coding blog.
Read more >
Release Notes for Red Hat build of Quarkus 2.2
Quarkus is designed to work with popular Java standards, frameworks, ... in Quarkus REST CLient and Quarkus RESTEasy JAX-RS Client.
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