Converting a class with java.lang.Object into Uni Mutiny returns null in API

578 Views Asked by At

I have a quarkus app that has a POST api returning a Uni . The structure of Test class

class Test {
  String name;
  Object data;
}

I am passing the below as data from backend as response

{
    "data": {
        "value1": [
            {
              "type" : "String",
              "name" : "firstName"
            }
        ]
    },
    "name": "SUCCESS"
}

But what i get as response in the postman is ,

{
    "data": {
        "value1": [
            {}
        ]
    },
    "name": "SUCCESS"
}

Any idea why this happening. I am deploying the quarkus app in my local docker after taking a native build. Using java 17 in the native package command

EDIT: The api created is as follows

@Path("/getData")
@POST 
@Produces(MediaType.APPLICATION_JSON) 
public Uni<Test> getDataValue() { 
  Test newTest = new Test(); //populate test values return 
  return Uni.createFrom().item(() -> newTest) 
}

As mentioned by @Clement in the comments, it appears only in case of Native docker build. Works fine in case of JVM build

0

There are 0 best solutions below