Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix total_count #489

Open
csillag opened this issue Jul 15, 2023 · 0 comments
Open

fix total_count #489

csillag opened this issue Jul 15, 2023 · 0 comments

Comments

@csillag
Copy link
Contributor

csillag commented Jul 15, 2023

SUMMARY

When returning pagination results, one of the data fields is total_count. It's not behaving as it should.

It's defined here:

    total_count:
      type: integer
      format: uint64
      description: |
        The total number of records that match the query, i.e. the number of records
        the query would return with limit=infinity.

However, the returned value changes based on the offset we pass to the quest.

ISSUE TYPE
  • Bug Report
STEPS TO REPRODUCE

Compare this nd this.

ACTUAL RESULTS

In the first case, the offset we pass is 0, and the returned total_count is 53.
In the second case, offset is 30, and the returned total_count is 23.

EXPECTED RESULTS

On a higher level, the returned total_count should be (as the name suggests) total, so it shouldn't depend on the offset we are asking.

In practice, total_count should be increased by the value of the passed offset.

Alternatively, let's rename total_count field to remaining_results, and update the documentation accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant