Skip to content

feat: preserve query string in pagination links (opt-in) - #200

Merged
Erlend Ellefsen (erlendellefsen) merged 1 commit into
mainfrom
feat/pagination-links
Aug 21, 2026
Merged

feat: preserve query string in pagination links (opt-in)#200
Erlend Ellefsen (erlendellefsen) merged 1 commit into
mainfrom
feat/pagination-links

Conversation

@erlendellefsen

Copy link
Copy Markdown
Collaborator

Workstream B2 of the v1 redesign: JsonApiOptions.PreserveQueryInPaginationLinks (default off, non-breaking).

When enabled, first/last/prev/next pagination links keep the request's full query string (filter, sort, include, fields) and replace only the page parameters, instead of being rebuilt from the bare path. Following next now stays on the filtered, sorted result set. Link keys come back percent-encoded (page%5Bnumber%5D=2).

Default behavior is unchanged; the broken-links wart stays pinned by the contract suite for the default instance.

Also: the strict ContractApi instance (JSONAPI_STRICT=true) now enables this flag alongside the other opt-ins, with a contract test that asserts the exact preserved link and follows it; docs note added to querying.md.

@erlendellefsen
Erlend Ellefsen (erlendellefsen) merged commit f2ebc68 into main Aug 21, 2026
14 checks passed
@erlendellefsen
Erlend Ellefsen (erlendellefsen) deleted the feat/pagination-links branch August 21, 2026 12:45
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.

1 participant