0

I am trying to use Amadeus SDK with quarkus. I have run the SDK with Spring Boot and the API works fine. The requirement for the Amadeus SDK is to use GSON as the JSON mapping library. So below configuration was necessary in Spring Boot.

spring.mvc.converters.preferred-json-mapper=gson

But I couldn't find how to use GSON with quarkus. There is no resteasy-client-gson extension available for quarkus due to which I am getting below exception when using the Amadeus Java SDK.

Could not write JSON: JsonObject; nested exception is com.fasterxml.jackson.databind.JsonMappingException: JsonObject (through reference chain: com.amadeus.resources.FlightOfferSearch[0]->com.amadeus.resources.FlightOfferSearch["response"]->com.amadeus.Response["result"]->com.google.gson.JsonObject["asBoolean"]

Is there any way to resolve this and and configure GSON as Json mapping library for Amadeus SDK with quarkus?

Harry Coder
  • 2,429
  • 2
  • 28
  • 32
Raghav
  • 552
  • 1
  • 9
  • 34

1 Answers1

1

There is no built-in GSON extension in Quarkus, but you can make Quarkus use GSON for the REST API layer by implementating a GSON based MessageBodyReader and MessageBodyWriter.

You can see this answer for more details

geoand
  • 60,071
  • 24
  • 172
  • 190