Skip to content
Snippets Groups Projects

fixed an error in the pagination doc of the api

Closed username-removed-25949 requested to merge fix_api_pagination_doc into master

another small fix for you @axil ;)

closes #759 (closed)

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Is this a documentation problem or should it rather be fixed in the API? Pages should not be zero based I believe.

  • It would be nice to document somewhere that 0 and 1 return the same page though.

  • Pages should not be zero based I believe.

    I agree, I don't think a page 0 makes sense. When you pass page=0, it only ends up with a offset(0) in the page method. If you look at the implementation, passing page(0) or page(1) will both end up with offset(0) (because the method has to handle edge-cases) but I think documenting that the default page is 1 makes more sense here (like in a real book pagination). Plus, imagine you have an algorithm that loop over API pages by starting with page=0 and incrementing it, you'll have duplicate results since page 0 and 1 returns the same! ;)

    Thanks anyway @haynes, I will close this one since I'm trying to triage the currently opened MRs. Feel free to re-open/discuss this decision of course! :)

  • username-removed-128633 Status changed to closed

    Status changed to closed

Please register or sign in to reply
Loading