Skip to content
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

"page" REST API parameter is confusing #2039

Closed
4 of 6 tasks
mitar opened this issue Dec 7, 2021 · 3 comments · Fixed by #2143
Closed
4 of 6 tasks

"page" REST API parameter is confusing #2039

mitar opened this issue Dec 7, 2021 · 3 comments · Fixed by #2143

Comments

@mitar
Copy link
Contributor

mitar commented Dec 7, 2021

Preflight checklist

Describe the bug

Reading here it says:

Pages are created based on the values of per_page and page provided in the querystring, where per_page is the page size, and page is the current page.
In most scenarios, the per_page should be a multiple of the page.

And example has the current page at 10, page size at 5, and then the next page is 15. This looks to me like page should be named offset. page is generally used when you compute offset by doing page * per_page. How it is used in Kratos it should be named offset.

Reproducing the bug

See description above.

Relevant log output

No response

Relevant configuration

No response

Version

v0.8.0-alpha.3

On which operating system are you observing this issue?

Linux

In which environment are you deploying?

Docker Compose

Additional Context

No response

@mitar mitar added the bug Something is not working. label Dec 7, 2021
@aeneasr
Copy link
Member

aeneasr commented Dec 8, 2021

In Kratos page is a page and not an offset and you don't need to compute the page, it's always sequential (1,2,3,4,5). Could you update the docs with a wording that makes that easier to understand for you?

@aeneasr aeneasr added docs and removed bug Something is not working. labels Dec 8, 2021
@mitar
Copy link
Contributor Author

mitar commented Dec 8, 2021

I mean, the example is then wrong. The example has previous/next links and they increase in the per_page amount. I can make a PR.

@github-actions github-actions bot removed the docs label Jan 6, 2022
mitar added a commit to mitar/kratos that referenced this issue Jan 14, 2022
@mitar mitar mentioned this issue Jan 14, 2022
7 tasks
@mitar
Copy link
Contributor Author

mitar commented Jan 14, 2022

PR: #2143

aeneasr pushed a commit that referenced this issue Jan 14, 2022
peturgeorgievv pushed a commit to senteca/kratos-fork that referenced this issue Jun 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants