Skip to content

Improve pagination support and client param documentation #311

@kuzminT

Description

@kuzminT

Hi!
While working with the Repositories API, I discovered that auto-pagination is already implemented under the hood. However, at first, I attempted to implement it manually because there is no documentation or example code indicating that it's alredy supported.

Additionally, the pagelen parameter is used for pagination in the Bitbucket API, but it's not obvious that users can set it directly via the Client struct (see here). Right now, only a few fields in the Client struct have descriptions, and I believe it would be helpful to:

  1. Add documentation/comments for the pagination-related parameters.
  2. Provide setter methods like SetPagelen() and SetLimitPages() for improved clarity and usability.
  3. Include an example in the README for performing paginated requests (with and without auto-pagination).

Moreover, although we have the DisableAutoPaging flag, it doesn't fully support custom pagination scenarios because some useful fields like next, previous, and size are not exposed in the response struct. For instance, I needed them while working with the ListForAccount method, but the Bitbucket API provides these fields in its response (example here). These are critical for manual pagination control.

I’d be glad to contribute by adding these missing fields, improving the parameter documentation, and possibly adding setters and examples - if you agree that this would be helpful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions