feat: add pagination metadata to API responses (#630)#705
Open
heisdinesh wants to merge 2 commits intoaiondemand:developfrom
Open
feat: add pagination metadata to API responses (#630)#705heisdinesh wants to merge 2 commits intoaiondemand:developfrom
heisdinesh wants to merge 2 commits intoaiondemand:developfrom
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change(s)
Change Type: Added / Changed
Change Category: Interface
Changelog Entry: Added pagination metadata to API responses (#630)
Introduced a
PaginatedResponsemodel that wraps paginated array results. Endpoints serving paginated data (such as resource lists, platforms, and bookmarks) now return a JSON object containingoffset,limit,total_count, and the actual array of results in adatafield. This allows clients to understand the total number of items available for pagination.How to Test
Perform a
GETrequest on any paginated endpoint, for example/platformsor/datasets/v1with alimitandoffset.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
Related Issues
Closes #630