I am developing api with web flux.
@GetMapping(value = "/shipments/containernumbers")
@Operation(summary = "Returns a list of related container numbers", description = "Return related container numbers based on input")
public Flux<ContainerNumber> containerNumbers(final String searchTerm, final Pageable pageable) {
return shipmentService.containerNumbers(searchTerm, pageable)
.switchIfEmpty(Mono.error(new ResponseStatusException(HttpStatus.NOT_FOUND, "these is not container number with your input ")));
}
This will return list of objects with paging. But this will not tell front end how many object it has. The front end need know the total number of object to prepare pages.I checked some samples but did not find right way to do it. What it the best way to realize this requirement means return list of object with paging function as well as total number of object with webflux?
thanks in advance.