API endpoint : custom-fields with multiple filters bug #5515

Closed
opened 2025-12-29 19:28:54 +01:00 by adam · 2 comments
Owner

Originally created by @Flocon29 on GitHub (Oct 14, 2021).

Originally assigned to: @jeremystretch on GitHub.

NetBox version

v3.0.7

Python version

3.8

Steps to Reproduce

  1. Create 2 custom-fields (foo & bar)
  2. Execute HTTP request to API endpoint :
http://netbox_instance:8080/api/extras/custom-fields/?name=foo&name=bar

Expected Behavior

The expected result is the list of all the custom-fields matching with the filters.
Here foo & bar

Observed Behavior

We receive only the last element bar and not both.

Originally created by @Flocon29 on GitHub (Oct 14, 2021). Originally assigned to: @jeremystretch on GitHub. ### NetBox version v3.0.7 ### Python version 3.8 ### Steps to Reproduce 1. Create 2 custom-fields (foo & bar) 2. Execute HTTP request to API endpoint : ```bash http://netbox_instance:8080/api/extras/custom-fields/?name=foo&name=bar ``` ### Expected Behavior The expected result is the list of all the custom-fields matching with the filters. Here `foo` & `bar` ### Observed Behavior We receive only the last element `bar` and not both.
adam added the type: bugstatus: accepted labels 2025-12-29 19:28:54 +01:00
adam closed this issue 2025-12-29 19:28:54 +01:00
Author
Owner

@Flocon29 commented on GitHub (Oct 14, 2021):

A discussion has been opened on this subject : https://github.com/netbox-community/netbox/discussions/7543

The behavior for requesting config-contexts is correct :

http://netbox_instance:8080//api/extras/config-contexts/?name=foo&name=bar

But the behavior is not that expected for custom-fields

@Flocon29 commented on GitHub (Oct 14, 2021): A discussion has been opened on this subject : https://github.com/netbox-community/netbox/discussions/7543 The behavior for requesting `config-contexts` is correct : ```bash http://netbox_instance:8080//api/extras/config-contexts/?name=foo&name=bar ``` But the behavior is not that expected for `custom-fields`
Author
Owner

@jeremystretch commented on GitHub (Oct 14, 2021):

Looks like CustomFieldFilterSet doesn't inherit from BaseFilterSet, which is what provides support for multi-value matches as above.

@jeremystretch commented on GitHub (Oct 14, 2021): Looks like CustomFieldFilterSet doesn't inherit from BaseFilterSet, which is what provides support for multi-value matches as above.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#5515