I am trying to learn using ReactiveMongoClient on a Quarkus framework.
I am partly successful with sending a response as Uni>
@GET
@Path("/unpaginated")
public Uni<List<Staff>> unpaginatedStaffList() {
return staffService.getStaffResponse();
}
But when I try to get an object of some other class (StaffResponse) to include a Link object for pagination, I am not getting any Staff record. (For now I have hardcoded Link for pagination )
@GET
@Path("/paginated")
public StaffResponse paginatedStaffList() {
List<Link> links = LinkService.getLinks("/staff?page=2&limit=20", "next");
Uni<List<Staff>> staff = (Uni<List<Staff>>) staffService.getStaffResponse();
return new StaffResponse(links, staff);
}
"staff" is empty in the response.
MongoClient is returning list of Staff ok, looks like the Response object is not getting the list. Tried reading SmallRye Mutiny documentations - could not work out.
Please help.
I have committed the code at: https://github.com/doepradhan/staffApi and a sample json data file (https://github.com/doepradhan/staffApi/blob/master/sample-staff-data.json)
Thank you heaps for you kind help.