REST API devices filter by serial number does not follow the convention for multiple values of the same parameter to resolve by logical 'or' condition #5748

Closed
opened 2025-12-29 19:32:09 +01:00 by adam · 0 comments
Owner

Originally created by @irozkov on GitHub (Dec 8, 2021).

Originally assigned to: @jeremystretch on GitHub.

NetBox version

v2.11.12

Python version

3.7

Steps to Reproduce

Issue REST API request to get devices list by two serials (both devices with these serials should exist):
GET api/dcim/devices/?serial=1111&serial=222&brief=1

Expected Behavior

API returns info for two devices, provided we have no duplicate devices with these serial numbers:
{
"count": 2,
"next": null,
"previous": null,
"results": [
{ .... },
{ .... }
]
}

Observed Behavior

API returns info for the device which serial is set as last parameter in GET query
{
"count": 1,
...
}
This is also true for v3.0.11 and v3.1.0

Originally created by @irozkov on GitHub (Dec 8, 2021). Originally assigned to: @jeremystretch on GitHub. ### NetBox version v2.11.12 ### Python version 3.7 ### Steps to Reproduce Issue REST API request to get devices list by two serials (both devices with these serials should exist): GET api/dcim/devices/?serial=1111&serial=222&brief=1 ### Expected Behavior API returns info for two devices, provided we have no duplicate devices with these serial numbers: { "count": 2, "next": null, "previous": null, "results": [ { .... }, { .... } ] } ### Observed Behavior API returns info for the device which serial is set as last parameter in GET query { "count": 1, ... } This is also true for v3.0.11 and v3.1.0
adam added the type: bugstatus: accepted labels 2025-12-29 19:32:09 +01:00
adam closed this issue 2025-12-29 19:32:09 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#5748