Skip to content

feat: add pagination metadata to API responses (#630)#705

Open
heisdinesh wants to merge 2 commits intoaiondemand:developfrom
heisdinesh:feature/issue-630-pagination-metadata
Open

feat: add pagination metadata to API responses (#630)#705
heisdinesh wants to merge 2 commits intoaiondemand:developfrom
heisdinesh:feature/issue-630-pagination-metadata

Conversation

@heisdinesh
Copy link

@heisdinesh heisdinesh commented Feb 25, 2026

Change(s)

Change Type: Added / Changed

Change Category: Interface

Changelog Entry: Added pagination metadata to API responses (#630)

Introduced a PaginatedResponse model that wraps paginated array results. Endpoints serving paginated data (such as resource lists, platforms, and bookmarks) now return a JSON object containing offset, limit, total_count, and the actual array of results in a data field. This allows clients to understand the total number of items available for pagination.

How to Test

Perform a GET request on any paginated endpoint, for example /platforms or /datasets/v1 with a limit and offset.
Verify that the response is no longer a top-level list, but a JSON dictionary matching this structure:

{
  "offset": 0,
  "limit": 10,
  "total_count": 42,
  "data": [
    ...
  ]
}

Checklist

  • Tests have been added or updated to reflect the changes, or their absence is explicitly explained.
  • Documentation has been added or updated to reflect the changes, or their absence is explicitly explained.
  • A self-review has been conducted checking:
    • No unintended changes have been committed.
    • The changes in isolation seem reasonable.
    • Anything that may be odd or unintuitive is provided with a GitHub comment explaining it (but consider if this should not be a code comment or in the documentation instead).
  • All CI checks pass before pinging a reviewer, or provide an explanation if they do not.
  • The PR title matches the changelog entry's one-line description.

Related Issues

Closes #630

@heisdinesh
Copy link
Author

Hey @PGijsbers could you review this PR.

- Fix NameError in bookmark_router.py by injecting missing session dependency.
- Update resource, scheme, and relation tests to correctly handle PaginatedResponse format.
- Ensure all tests pass with the new pagination metadata structure.
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

Successfully merging this pull request may close these issues.

Add pagination metadata in response

1 participant