API calls not respecting limit parameter #9234

Closed
opened 2025-12-29 20:47:19 +01:00 by adam · 1 comment
Owner

Originally created by @nelis249 on GitHub (Feb 12, 2024).

Deployment Type

Self-hosted

NetBox Version

v3.7.2

Python Version

3.11

Steps to Reproduce

  1. Create 200 devices (probably works on other objects).
  2. Set the Maximum page size to 50 in the config page.
  3. Make an api call that has the limit=0 flag (or anything over 50) eg https://netbox/api/dcim/devices/?limit=0
  4. Results returned are 50.

Expected Behavior

Expected behavior is that the limit=0 (or any number) should override the max page size and return the limit specified.

Observed Behavior

Only 50 results returned which is not the specified limit size.

Note: this seems like this is similar to this issue: https://github.com/netbox-community/netbox/issues/7209

Originally created by @nelis249 on GitHub (Feb 12, 2024). ### Deployment Type Self-hosted ### NetBox Version v3.7.2 ### Python Version 3.11 ### Steps to Reproduce 1. Create 200 devices (probably works on other objects). 2. Set the Maximum page size to 50 in the config page. 3. Make an api call that has the limit=0 flag (or anything over 50) eg https://netbox/api/dcim/devices/?limit=0 4. Results returned are 50. ### Expected Behavior Expected behavior is that the limit=0 (or any number) should override the max page size and return the limit specified. ### Observed Behavior Only 50 results returned which is not the specified limit size. Note: this seems like this is similar to this issue: https://github.com/netbox-community/netbox/issues/7209
adam closed this issue 2025-12-29 20:47:19 +01:00
Author
Owner

@jeremystretch commented on GitHub (Feb 12, 2024):

This is working as intended. The MAX_PAGE_SIZE parameter is exactly that: The maximum permissible page size. It exists to enforce a maximum value for the limit query parameter.

@jeremystretch commented on GitHub (Feb 12, 2024): This is working as intended. The [`MAX_PAGE_SIZE`](https://docs.netbox.dev/en/stable/configuration/miscellaneous/#max_page_size) parameter is exactly that: The maximum permissible page size. It exists to enforce a maximum value for the `limit` query parameter.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#9234