Pageable required
See original GitHub issueHello
I’m using springdoc-openapi-ui version 1.3.2 & springdoc-openapi-data-rest 1.3.2
And I encountered that “Pageable” parameters size, page and sort are required I can see it here: https://github.com/springdoc/springdoc-openapi/blob/master/springdoc-openapi-data-rest/src/main/java/org/springdoc/data/rest/converters/Pageable.java
Does it should be required?
If I don’t pass them , spring inject its defaults values and can be overriden from äpplication.yaml:
spring: data: rest: default-page-size: 20 max-page-size: 1000
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Paging with Spring Boot - Reflectoring
Pageable instead of Spring's Pageable class. Since we most probably don't need any classes from the java.awt package, we can tell our IDE...
Read more >Paging query needs to have a pageable parameter [Spring Boot]
My situation here is that I want to GET the data from my database on the browser. There are many data, and I...
Read more >Pagination and Sorting using Spring Data JPA - Baeldung
We can create a PageRequest object by passing in the requested page number and the page size. Here the page count starts at...
Read more >PageRequest (Spring Data Core 3.0.0 API)
Basic Java Bean implementation of Pageable . Author: Oliver Gierke, Thomas Darimont, Anastasiia Smirnova, Mark Paluch; See Also:.
Read more >Spring Boot Pagination and Sorting Example - HowToDoInJava
We can add more methods that accept Pageable and Sort as parameters for any custom requirements. List<EmployeeEntity> ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@kfirfer,
You can use @PageableAsQueryParam annotation, in conjunction with @Parameter(hidden = true). This can help you achieve what you want.
If you can see this request, it explains why we have these constaints.
Even all these attributes (page, sort, size) must not be null, spring-data manages to fill them with default values if absent.
You are right, that it makes more sense to give flexibility to the user to decide. The change, will be available for the next release: v1.3.3.
I think the best solution is to give the user to decide the parameters in the object