20496 make max_page_size upper bound #1106

Closed
opened 2026-04-05 20:41:49 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @arthanson on 10/7/2025

Fixes: #20496

Refactors and fixes REST paginator checking for MAX_PAGE_SIZE, making it the upper bound.

if MAX_PAGE_SIZE is set:

  • if no limit is set return min(MAX_PAGE_SIZE, PAGINATE_COUNT)
  • if limit set return min(limit, MAX_PAGE_SIZE)
  • if limit = 0 or None return MAX_PAGE_SIZE

if MAX_PAGE_SIZE is not set:

  • if no limit is set return PAGINATE_COUNT
  • if limit is set return limit
  • if limit = 0 return all data

Note: The UI view overrides this if you set the pagination limit dropdown - i.e. if you select in the UI 1000 items and MAX_PAGE_SIZE=100, then 1000 items will still be returned in the view, which I think is correct.

*Originally created by @arthanson on 10/7/2025* ### Fixes: #20496 Refactors and fixes REST paginator checking for MAX_PAGE_SIZE, making it the upper bound. if MAX_PAGE_SIZE is set: * if no limit is set return min(MAX_PAGE_SIZE, PAGINATE_COUNT) * if limit set return min(limit, MAX_PAGE_SIZE) * if limit = 0 or None return MAX_PAGE_SIZE if MAX_PAGE_SIZE is not set: * if no limit is set return PAGINATE_COUNT * if limit is set return limit * if limit = 0 return all data Note: The UI view overrides this if you set the pagination limit dropdown - i.e. if you select in the UI 1000 items and MAX_PAGE_SIZE=100, then 1000 items will still be returned in the view, which I think is correct.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/netbox#1106