Bad swagger documentation using Nested Serializers #3782

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

Originally created by @Dimaqa on GitHub (Jun 15, 2020).

Environment

Python version: 3.6.9
NetBox version: 2.8.5

Bad swagger documentation for Nested Serializers with many=True parameter

Steps to Reproduce

With introductions of plugins we can now create our own models with netbox serializers.
So if you have field like
ips_list = NestedIPAddressSerializer(required=False, many=True)
Swagger post documentation would be wrong
And it includes every nested serializer.

Expected Behavior

 "ips_list": [ 0
  ],

Observed Behavior

 "ips_list": [
    {
      "address": "string"
    }
  ],

But post request himself works as expected with "ips_list": [ 1 ], it's just swagger issue

Originally created by @Dimaqa on GitHub (Jun 15, 2020). ### Environment Python version: 3.6.9 NetBox version: 2.8.5 Bad swagger documentation for Nested Serializers with many=True parameter ### Steps to Reproduce With introductions of plugins we can now create our own models with netbox serializers. So if you have field like `ips_list = NestedIPAddressSerializer(required=False, many=True)` Swagger post documentation would be wrong And it includes every nested serializer. ### Expected Behavior ``` "ips_list": [ 0 ], ``` ### Observed Behavior ``` "ips_list": [ { "address": "string" } ], ``` But post request himself works as expected with "ips_list": [ 1 ], it's just swagger issue
adam closed this issue 2025-12-29 18:31:12 +01:00
Author
Owner

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

Core serializers are not intended to be used by plugins. Plugin authors are responsible for their own endpoints and the documentation thereof.

@jeremystretch commented on GitHub (Jun 15, 2020): Core serializers are not intended to be used by plugins. Plugin authors are responsible for their own endpoints and the documentation thereof.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#3782