Keyset Pagination not working with sort: 'dec', API seems to expect 'desc' instead
Closed this issue · 2 comments
Description
- Node.js version: 21.6
- Gitbeaker version: 40.0.2
- Gitbeaker release (cli, rest, core, requester-utils): rest
- OS & version: Windows 11
I tried to fetch Project Jobs using the keyset pagination but kept getting 405s. To verify, I replayed the request manually using ThunderClient and got the same response but the additional info "Keyset pagination is not yet available for this type of request". The GitLab API Documentation says that sort should be "asc" or "desc", not "dec" like it's used in the types of gitbeaker. After changing the value of sort, the request worked fine. Also reproduced with Pipelines Endpoint, however the pipelines endpoint throws a 400 error with "sort does not have a valid value" instead, as its keysets requests are less restricted. Maybe it would be good if the "error" property would be exposed to the caller in general.
Steps to reproduce
Perform any request with keyset pagination and sort "dec", try again with "desc". Note that this is currently the only keyset request configuration Gitlab supports. Sample request:
const jobs = await gitlab.Jobs.all(123456, {
pagination: "keyset",
sort: "dec",
orderBy: "id"
});
Expected behaviour
Request should be fine.
Actual behaviour
Request throws 405 Method not allowed.
Possible fixes
Replace "dec" with "desc".
Checklist
- I have checked that this is not a duplicate issue.
- I have read the documentation.
Overlooked typo! Good catch
🚀 Issue was released in 40.0.3
🚀