API next json key loops on itself with MAX_PAGE_SIZE=0 and limit=0 #2012

Closed
opened 2025-12-29 17:21:29 +01:00 by adam · 1 comment
Owner

Originally created by @aruhier on GitHub (Sep 18, 2018).

Environment

  • Python version: 3.7
  • NetBox version: 2.4.4

Steps to Reproduce

Set MAX_PAGE_SIZE=0 to disable the pagination, and do a GET on a list of items (/api/dcim/devices/ for example) with the GET parameter limit=0.

Expected Behavior

The next value in the response should be null, as the pagination is disabled.

Observed Behavior

The next is looping on the same GET query, with limit=0&offset=0 (/api/dcim/devices/?limit=0&offset=0 for example). It is an issue for some API clients that just loop over the next key until it is null.

Originally created by @aruhier on GitHub (Sep 18, 2018). ### Environment * Python version: 3.7 * NetBox version: 2.4.4 ### Steps to Reproduce Set `MAX_PAGE_SIZE=0` to disable the pagination, and do a GET on a list of items (`/api/dcim/devices/` for example) with the GET parameter `limit=0`. <!-- What did you expect to happen? --> ### Expected Behavior The `next` value in the response should be `null`, as the pagination is disabled. <!-- What happened instead? --> ### Observed Behavior The `next` is looping on the same GET query, with `limit=0&offset=0` (`/api/dcim/devices/?limit=0&offset=0` for example). It is an issue for some API clients that just loop over the `next` key until it is null.
adam added the type: bugstatus: accepted labels 2025-12-29 17:21:29 +01:00
adam closed this issue 2025-12-29 17:21:29 +01:00
Author
Owner

@aruhier commented on GitHub (Sep 18, 2018):

Thanks a lot!

@aruhier commented on GitHub (Sep 18, 2018): Thanks a lot!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#2012