Swagger vs REST API: Interface.wireless_lans array #9173

Closed
opened 2025-12-29 20:46:32 +01:00 by adam · 4 comments
Owner

Originally created by @janhlavin on GitHub (Jan 30, 2024).

Originally assigned to: @Smixi on GitHub.

Deployment Type

Self-hosted

NetBox Version

v3.7.1

Python Version

3.11

Steps to Reproduce

  1. create wireless lan
  2. create device with interface
  3. associate wireless lan to interface

Expected Behavior

items in Interface.wireless_lans collection of WirelessLAN object in Swagger schema

Observed Behavior

items in Interface.wireless_lans collection of number in Swagger schema, but REST API return WirelessLAN objects

Originally created by @janhlavin on GitHub (Jan 30, 2024). Originally assigned to: @Smixi on GitHub. ### Deployment Type Self-hosted ### NetBox Version v3.7.1 ### Python Version 3.11 ### Steps to Reproduce 1. create wireless lan 2. create device with interface 3. associate wireless lan to interface ### Expected Behavior items in `Interface.wireless_lans` collection of **WirelessLAN** object in Swagger schema ### Observed Behavior items in `Interface.wireless_lans` collection of _number_ in Swagger schema, but REST API return **WirelessLAN** objects
adam added the type: bugstatus: acceptedseverity: low labels 2025-12-29 20:46:32 +01:00
adam closed this issue 2025-12-29 20:46:32 +01:00
Author
Owner

@Smixi commented on GitHub (Feb 4, 2024):

Hi, I made some investigation. All fields using SerializedPKRelatedField are correctly represented for the request, but doesn't use the serializer for response, this is because they are represented by drf-spectacular with the PrimaryKeyRelatedField. I can make a PR so it uses the same method described here : https://github.com/tfranzel/drf-spectacular/issues/778

@Smixi commented on GitHub (Feb 4, 2024): Hi, I made some investigation. All fields using `SerializedPKRelatedField` are correctly represented for the request, but doesn't use the serializer for response, this is because they are represented by drf-spectacular with the PrimaryKeyRelatedField. I can make a PR so it uses the same method described here : https://github.com/tfranzel/drf-spectacular/issues/778
Author
Owner

@Smixi commented on GitHub (Mar 24, 2024):

Hi @abhi1693, do you have news ? I think the PR is ready if its ok for you

@Smixi commented on GitHub (Mar 24, 2024): Hi @abhi1693, do you have news ? I think the PR is ready if its ok for you
Author
Owner

@abhi1693 commented on GitHub (Mar 25, 2024):

Looks like there is another PR #15449 that solves a similar issue.

@abhi1693 commented on GitHub (Mar 25, 2024): Looks like there is another PR #15449 that solves a similar issue.
Author
Owner

@Smixi commented on GitHub (Mar 26, 2024):

Arf, it got duplicated. Did the other PR works ? I checked but it seems it doesn't looks for the direction value to use int for request.

@Smixi commented on GitHub (Mar 26, 2024): Arf, it got duplicated. Did the other PR works ? I checked but it seems it doesn't looks for the direction value to use int for request.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#9173