Skip to content

Pagination object is not clear when using continuationToken #2

@sneko

Description

@sneko

Hi, let's say I make a list request (with no continuation token) returning:

    "pagination": {
        "pageSize": 100,
        "totalCount": 84,
        "pageIndex": 1,
        "totalPages": 1,
        "continuationToken": "xxx_yyy"
    }

If I set now xxx_yyy as query parameter continuationToken, I will get the following:

    "pagination": {
        "pageSize": 100,
        "totalCount": 4,
        "pageIndex": 1,
        "totalPages": 1,
        "continuationToken": "xxx_yyy"
    }

I'm expecting a marker to say the pagination has ended. Either by having continuationToken: null or a boolean hasNextPage: false. Because in the above responses I cannot assume I reached the last page.

I could for sure say "if I get 2 times the same continuation tokens, it means it's the end"... but it means I have to do N+1 requests all the time.

Or maybe you assume developers need to rely on the condition totalPages === 1 but not that obvious. (Indeed if using pageSize: 20 I will see the totalPages being from 5 to 1 when the last page appears).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions