We are using Spring Data reactive and when we call findAll we are receiving a Flux<T> and we want to expose this response in the API, but our API structure is
{
"status": 200,
"items": [ ... ]
}
So, we want to expose this as Mono<<Response<T>>
public class Response<T> {
private int status;
private List<T> items;
// ...
}
How to convert Flux<T> in Mono<Response<T>> in Spring Webflux?