question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Pageable required

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
bnasslahsencommented, Apr 13, 2020

@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.

0reactions
kfirfercommented, Apr 13, 2020

I think the best solution is to give the user to decide the parameters in the object

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found