-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Labels
severity: lowDoes not significantly disrupt application functionality, or a workaround is availableDoes not significantly disrupt application functionality, or a workaround is availablestatus: acceptedThis issue has been accepted for implementationThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the applicationA confirmed report of unexpected behavior in the application
Milestone
Description
NetBox Edition
NetBox Community
NetBox Version
4.4.2
Python Version
3.10
Steps to Reproduce
- Make sure you have about 10 sites or more added into the system.
- set the following either in configuration.py or adding a Configuration (admin - system - Configuration History)
MAX_PAGE_SIZE = 5
PAGINATE_COUNT = 3 - Go to the REST browser for sites
api/dcim/sites/
also with limitapi/dcim/sites/?limit=30
Expected Behavior
MAX_PAGE_SIZE should be upper limit for number of results returned, so only 5 sites should be returned.
The rules should be:
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
Observed Behavior
MAX_PAGE_SIZE is ignored, it is only applied if you send ?limit=0
Metadata
Metadata
Assignees
Labels
severity: lowDoes not significantly disrupt application functionality, or a workaround is availableDoes not significantly disrupt application functionality, or a workaround is availablestatus: acceptedThis issue has been accepted for implementationThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the applicationA confirmed report of unexpected behavior in the application