Improve documentation for API filtering #2489

Closed
opened 2025-12-29 18:19:18 +01:00 by adam · 3 comments
Owner

Originally created by @ajknv on GitHub (Apr 3, 2019).

Environment

  • Python version: 3.6.8
  • NetBox version: 2.5.7

Steps to Reproduce

  1. Try to query interfaces using multiple filter values for "mac_address", or "device_id".

Expected Behavior

The API should return all of the records matching any of the filter values as documented.

Observed Behavior

Only results matching the final filter value are returned, contrary to the documentation indicating that a logical OR should have been performed.

The patch applied for https://github.com/digitalocean/netbox/issues/2577 still results in quite deficient documentation. "Certain filters can be included multiple times" -- how can we know or determine which ones? Any why only those ones? At the very least if the filter cannot be properly honored with multiple values the API should respond with an error, so consumers of the API aren't potentially just chugging along with missing data that was silently dropped.

Originally created by @ajknv on GitHub (Apr 3, 2019). ### Environment * Python version: 3.6.8 * NetBox version: 2.5.7 ### Steps to Reproduce 1. Try to query interfaces using multiple filter values for "mac_address", or "device_id". <!-- What did you expect to happen? --> ### Expected Behavior The API should return all of the records matching any of the filter values as documented. <!-- What happened instead? --> ### Observed Behavior Only results matching the final filter value are returned, contrary to the documentation indicating that a logical OR should have been performed. The patch applied for https://github.com/digitalocean/netbox/issues/2577 still results in quite deficient documentation. "Certain filters can be included multiple times" -- how can we know or determine *which* ones? Any why only those ones? At the very least if the filter cannot be properly honored with multiple values the API should respond with an error, so consumers of the API aren't potentially just chugging along with missing data that was silently dropped.
adam added the type: bugstatus: accepted labels 2025-12-29 18:19:18 +01:00
adam closed this issue 2025-12-29 18:19:18 +01:00
Author
Owner

@jeremystretch commented on GitHub (Dec 13, 2019):

IMO this is not a documentation problem, but a bug with the filters.

@jeremystretch commented on GitHub (Dec 13, 2019): IMO this is not a documentation problem, but a bug with the filters.
Author
Owner

@hSaria commented on GitHub (Jan 15, 2020):

Referring to the bug, this is fixed in v2.6.12 (possibly earlier, but didn't check); you can specify multiple values and they'll be OR-ed.

@hSaria commented on GitHub (Jan 15, 2020): Referring to the bug, this is fixed in v2.6.12 (possibly earlier, but didn't check); you can specify multiple values and they'll be OR-ed.
Author
Owner

@jeremystretch commented on GitHub (Jan 15, 2020):

Agreed. Going to consider this resolved.

@jeremystretch commented on GitHub (Jan 15, 2020): Agreed. Going to consider this resolved.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#2489