Skip to content

Include total count in response #8

@johnnymetz

Description

@johnnymetz

Background

The Link HTTP header only includes links to different pages. It would be great to also include the total count somewhere in the response.

Potential Solution

This SO answer suggests including an X-Total-Count header in the response.

I'm happy to work on this if you don't have time to do it.

Workaround

I understand I can calculate this using the following steps but it includes an extra API call:

  • Hit the last url
  • Calculate the number of items in the last response
  • Perform the simple calculation: PAGE_SIZE * (LAST_PAGE_INDEX - 1) + NUM_ITEMS_ON_LAST_PAGE

For example: If I have 25 items with a page size of 10, the calculation would be:

10 * (3 - 1) + 5 = 25

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