-
-
Notifications
You must be signed in to change notification settings - Fork 528
Pageable required #561
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi @kfirfer, Yes, the Pageable attributes are required. |
the sort is also required and quite annoying to set it with empty value in order to fire a request , also if I override the default values in spring application.yaml it is not reflected in the defaults of Pageable |
I dont think the attributes should be required , since spring make the defaults by its own |
I think the best solution is to give the user to decide the parameters in the object |
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. |
Hello
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
The text was updated successfully, but these errors were encountered: