My spring boot applications controller contains a method as below with optional Pageable parameter.
@RequestMapping(method = RequestMethod.GET)
@Override
public Page<MarkupView> getAllMarkup(Pageable pageable) {
System.out.println("Page size" + pageable.getPageSize() ) // prints 20
return markupService.getAllMarkups(pageable);
}
My problem is when I pass query parameters with swagger-ui those values does not bind to the pageable object. Why I said that is it prints pageSize as 20 whether I pass value 5 as query parameter.
request URL : http://localhost:8080/api/markups?offset=2&pageNumber=1&pageSize=5
above Get request returns me Page object which contains all MarkupView records.
pageandsizeinstead. See docs.spring.io/spring-data/jpa/docs/current/reference/html/… - M. Deinum