Skip to content

[BUGFIX] Validate pagination parameters like API Platform - #164

Merged
kszymukowicz merged 1 commit into
release/5.0.0from
pagination-empty-result
Oct 3, 2026
Merged

kszymukowicz merged 1 commit into
release/5.0.0from
pagination-empty-result

Conversation

@kszymukowicz

Copy link
Copy Markdown
Collaborator

Empty collections returned hydra:last pointing to page 0 and
hydra:pages with page 0. Invalid pagination parameters failed with
"The offset must be a positive integer" / "The limit must be an
integer >= 1" (HTTP 500) or, for itemsPerPage=0, returned the whole
collection.

  • empty collection has one page in hydra:view
  • page has to be an integer >= 1, otherwise 400 Bad Request
  • itemsPerPage has to be an integer >= 0, otherwise 400 Bad Request
  • itemsPerPage=0 returns only hydra:totalItems, without members
  • fix OpenAPI description of hydra:last

Empty collections returned hydra:last pointing to page 0 and
hydra:pages with page 0. Invalid pagination parameters failed with
"The offset must be a positive integer" / "The limit must be an
integer >= 1" (HTTP 500) or, for itemsPerPage=0, returned the whole
collection.

- empty collection has one page in hydra:view
- page has to be an integer >= 1, otherwise 400 Bad Request
- itemsPerPage has to be an integer >= 0, otherwise 400 Bad Request
- itemsPerPage=0 returns only hydra:totalItems, without members
- fix OpenAPI description of hydra:last
@kszymukowicz kszymukowicz added the bug Something isn't working label Oct 3, 2026
@kszymukowicz kszymukowicz self-assigned this Oct 3, 2026
@kszymukowicz
kszymukowicz merged commit 50d1b28 into release/5.0.0 Oct 3, 2026
25 checks passed
@kszymukowicz
kszymukowicz deleted the pagination-empty-result branch October 3, 2026 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant