Deserialisation using Qurkus.io and rest-client-reactive-json not working

45 views Asked by At

I am using documentation given here to connect with another service. So far the connection to another service works fine. When I get the response as a string it also works fine.

But it fails to deserialize when I try to deserialize as an object.

My pom looks like this.



  <dependency>
      <groupId>io.quarkus</groupId>
      <artifactId>quarkus-jdbc-postgresql</artifactId>
    </dependency>
    <dependency>
      <groupId>io.quarkus</groupId>
      <artifactId>quarkus-resteasy-reactive-jackson</artifactId>
    </dependency>
    <dependency>
      <groupId>io.quarkus</groupId>
      <artifactId>quarkus-rest-client-reactive-jackson</artifactId>
    </dependency>

I am using the sample Class provided in the demo

public class Extension {

    public String id;
    public List<String> keywords;

}

//expected return type 
public class ExtentsionWrapper{
     
    List<Extention> extentions;

}


1

There are 1 answers

0
Abdullah Al Noman On BEST ANSWER

I have manged to make it work .

public class Extension {

    @JsonProperty("id")
    public String id;
    @JsonProperty("keywords")
    public List<String> keywords;

}

//expected return type 
public class ExtentsionWrapper{
    @JsonProperty("extentions")
    List<Extention> extentions;

}

adding @JsonProperty fixed my serialization issue