Skip to content

feat(pagination): return 404 when page exceeds total pages in strict mode#126

Merged
Erlend Ellefsen (erlendellefsen) merged 1 commit into
mainfrom
feat/strict-pagination
May 6, 2026
Merged

feat(pagination): return 404 when page exceeds total pages in strict mode#126
Erlend Ellefsen (erlendellefsen) merged 1 commit into
mainfrom
feat/strict-pagination

Conversation

@erlendellefsen

Copy link
Copy Markdown
Collaborator
  • Adds runtime enforcement to StrictPagination: when enabled and a request asks for a page beyond the total page count, the controller returns 404 with INVALID_PAGE_NUMBER and meta showing value/totalPages/totalResources.
  • Empty result sets do not 404 (no pages exist to be wrong about).
  • Default behavior (StrictPagination = false) is unchanged — clamping preserved.
  • 4 new integration tests covering 404 boundary, last-page boundary, error body shape, and empty-result edge.

@erlendellefsen Erlend Ellefsen (erlendellefsen) merged commit b639fdd into main May 6, 2026
2 checks passed
@erlendellefsen Erlend Ellefsen (erlendellefsen) deleted the feat/strict-pagination branch May 6, 2026 12:17
Erlend Ellefsen (erlendellefsen) pushed a commit that referenced this pull request May 7, 2026
🤖 I have created a release *beep* *boop*
---


##
[2.1.0](v2.0.1...v2.1.0)
(2026-05-07)


### Features

* **docs:** migrate to mkdocs material with generated API reference
([#129](#129))
([765d46a](765d46a))
* **pagination:** return 404 when page exceeds total pages in strict
mode
([#126](#126))
([b639fdd](b639fdd))


### Bug Fixes

* correct casing for Intility.DotnetApiDocs in dotnet-tools
configuration
([01ed721](01ed721))
* follow dotnet api docs rename
([abe8436](abe8436))


### Code Refactoring

* **controller:** extract EnforceStrictPagination from JsonApiQueryAsync
([#128](#128))
([e501631](e501631))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: intility-release-bot[bot] <175299729+intility-release-bot[bot]@users.noreply.github.com>
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