-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Closed
Labels
status: 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
Description
NetBox version
v3.0.1
Python version
3.9
Steps to Reproduce
- Set MAX_PAGE_SIZE=0
- ensure you have an object type that has enough entries to reproduce
- make an api call that has the limit=0 flag eg https://netbox/api/dcim/devices/?limit=0
Expected Behavior
The API should return all objects from the query with no next value eg:
GET /api/dcim/devices/?limit=10000
HTTP 200 OK
Allow: GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept
{
"count": 6672,
"next": null,
"previous": null,
"results": [
{
"id": 2902,
....
} ,
...
]
}
Note, the limit above was used to simulate what is expected to respond.
Observed Behavior
The API returns the result with the default pagination (50 for us):
GET /api/dcim/devices/?limit=0
HTTP 200 OK
Allow: GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept
{
"count": 6672,
"next": "https://netbox/api/dcim/devices/?limit=50&offset=50",
"previous": null,
"results": [
{
"id": 2902,
....
} ,
...
]
}
Setting the limit paramater to any other value returns succesfully, eg if we set it to 10,000 it will return all 6672 objects
iantriggs
Metadata
Metadata
Assignees
Labels
status: 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