Add statement about of Pageable to documentation
See original GitHub issueIssue Description
Setup information hikaku version: 2.0.0-SNAPSHOT implementation converter: SpringConverter
Describe the bug Spring data supports the idea of Pageable. A pageable is an object build by request parameter, supporting page, size and sort (parameter names are changeable). These parameters might be part of an api, but are not explizit mapped to query parameter. The documentation says “Query Parameter based on an object” are not supported, but I think a Pageable should be mentioned explizitly.
Expected behavior Add support for Pageable or add a note that Pageable are currently not supported in hikaku.
Code samples: Can you provide specifications or code snippets?
public ResponseEntity<Person> getPersons(
@RequestParam(name = "language", required = false) String language,
@PageableDefault Pageable pageable) {
...
}
Issue Analytics
- State:
- Created 4 years ago
- Comments:5
Top Results From Across the Web
Paging with Spring Boot - Reflectoring
The most common way to create a Pageable instance is to use the PageRequest implementation: Pageable pageable = PageRequest. of(0, 5, Sort.by( ...
Read more >Swagger documentation for Spring Pageable interface
The issue I have is that the pageable parameter is detected with content-type application/json and I don't know how to pass a value...
Read more >Spring Data JPA Tutorial: Pagination - Petri Kainulainen
This blog post describes how you can paginate your query results with Spring Data JPA.
Read more >Pagination and Sorting using Spring Data JPA - Baeldung
Learn how to paginate and sort query results in Spring Data JPA.
Read more >4. Paging and Sorting - Spring
To add paging support to your Repositories, you need to extend the PagingAndSortingRepository<T,ID> interface rather than the basic CrudRepository<T,ID> ...
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 Free
Top 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
Hi @jrehwaldt, thank you for giving feedback on this topic.
First of all, as stated in the list of currently not supported features in the README.md of the spring converter, query parameter based on classes/interfaces are currently not supported in general. So depending on the solution for that, this might solve the cases mentioned above already. It might make sense to implement the general approach before we focus on specific interfaces or classes.
From my perspective the PagaeableDifferenceEvaluator idea wouldn’t work. Hikaku is designed to convert a specification or an implementation to an internal domain model of a REST endpoint. After that the model for the specification is compared to the model of the implementation in the core. At the time of the actual comparison, there is therefore no additional information about the implementation, such as class types and the like. This is intentional.
However I like the idea of creating rules dynamically for the config to ignore specific bits, instead of static rules.
As I see it the proposal from #47 unfortunately doesn’t solve either the general nor the original issue.
Pageable
is an interface, which you excluded from your proposalsort
could be mapped tosortOrder
internally.A truly general solution would be to allow deriving arbitrary parameters from unknown objects declared in endpoint mappings, something like
(Object) -> Set<Parameter>
, withParameter
being any of these.