Skip to content

hasNextPage() returns true when limit - length > 0 #1200

@fern-support

Description

@fern-support

Looks like hasNewPage has a bug. It has true value when the last page reached.
response: { start: 100, limit: 100, length: 89, users: [Array], total: 189 } - gives true, but start + length < total
Then next request:
response: { start: 200, limit: 100, length: 0, users: [], total: 189 }, - extra request with empty response

Also, impossible to get totals with include_totals: true.

Originally posted by @brightsider in #1193

This is a known issue with offset pagination in our generator, since there is no standardized (read: particular-spec-independent) way to find out how many responses a page ought to have.

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