Skip to content

Broken pagination function of Stash provider #166

@Porsh33

Description

@Porsh33

func encodeListOptions(opts scm.ListOptions) string {
params := url.Values{}
if opts.Page > 1 {
params.Set("start", strconv.Itoa(
(opts.Page-1)*opts.Size),
)
}
if opts.Size != 0 {
params.Set("limit", strconv.Itoa(opts.Size))
}
return params.Encode()
}

Reference to docs https://docs.atlassian.com/bitbucket-server/rest/5.16.0/bitbucket-rest.html

Important: If more than one page exists (i.e. the response contains "isLastPage": false), the response object will also contain a nextPageStart attribute which must be used by the client as the start parameter on the next request. Identifiers of adjacent objects in a page may not be contiguous, so the start of the next page is not necessarily the start of the last page plus the last page's size. A client should always use nextPageStart to avoid unexpected results from a paged API.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions