0

Cannot configure fasterxml jackson objectmapper to ignore unknown properties with Microprofile rest client proxy

I have started looking into microprofile rest client proxies as we often need REST clients to work with external API's. I have managed to generate and configure client proxies for our services without much problems and the use of these is very nice and clean. However I had trouble with a single interface where the openapi spec had not been updated when a new field was added in the API object. This resulted in a objectmapper exception when deserializing.

I have had no luck configuring the jackson objectmapper to ignore unknown fields as we would like our application to be resilient to added fields and don't often get notified when the API is about to or have changed... Furthermore no openapi endpoint is available for this specific endpoint, so we are required to contact the API supplier when an updated spec is needed.

I have tried adding an ObjectMapperProvider, ObjectMapperContextResolver without much luck. The objectmapper provider is not used by the rest proxy it seems. And I am getting an internal error with "array index out of bounds" for the context resolver. We are working on an older JBoss platform so the quarkus specific option "quarkus.jackson.fail-on-unknown-properties=false" is not available.

0 Answers0