IP Prefix Family returned doesn't match swagger definition #3403

Closed
opened 2025-12-29 18:28:47 +01:00 by adam · 4 comments
Owner

Originally created by @z4ce on GitHub (Feb 25, 2020).

Environment

  • Python version: 3.7.6
  • NetBox version: v2.7.7

Swagger definition for Prefix.Family does not match the swagger definition.

Steps to Reproduce

  1. Get a prefix object wget http://netbox/api/ipam/prefixes/210/
  2. Notice object is like
  "family": {
    "value": 4,
    "label": "IPv4"
  },
  1. Notice definition is
  "family": {
    "label": "string",
    "value": "string"
  },

Expected Behavior

Object returned matches definition. I'm not sure if the definition needs to be fixed or the returned value type needs to be changed.

Observed Behavior

Object doesn't match definition

Originally created by @z4ce on GitHub (Feb 25, 2020). ### Environment * Python version: 3.7.6 * NetBox version: v2.7.7 Swagger definition for Prefix.Family does not match the swagger definition. ### Steps to Reproduce 1. Get a prefix object `wget http://netbox/api/ipam/prefixes/210/` 2. Notice object is like ``` "family": { "value": 4, "label": "IPv4" }, ``` 3. Notice definition is ``` "family": { "label": "string", "value": "string" }, ``` <!-- What did you expect to happen? --> ### Expected Behavior Object returned matches definition. I'm not sure if the definition needs to be fixed or the returned value type needs to be changed. <!-- What happened instead? --> ### Observed Behavior Object doesn't match definition
adam added the status: acceptedtype: documentation labels 2025-12-29 18:28:47 +01:00
adam closed this issue 2025-12-29 18:28:47 +01:00
Author
Owner

@z4ce commented on GitHub (Feb 25, 2020):

cc @wbean1

@z4ce commented on GitHub (Feb 25, 2020): cc @wbean1
Author
Owner

@tyler-8 commented on GitHub (Feb 25, 2020):

What specifically are you calling out here? The ordering of the fields or the data type returned for the value key?

@tyler-8 commented on GitHub (Feb 25, 2020): What specifically are you calling out here? The ordering of the fields or the data type returned for the `value` key?
Author
Owner

@z4ce commented on GitHub (Feb 25, 2020):

value is returned as an integer and not a string as the swagger definition calls out. According the swagger the prefix family should be:

"family": {
    "value": "4",
    "label": "IPv4"
  },

Or if the returned type is correct then the swagger should be:

  "family": {
    "label": "string",
    "value": "integer"
  },
@z4ce commented on GitHub (Feb 25, 2020): `value` is returned as an integer and not a string as the swagger definition calls out. According the swagger the prefix family should be: ``` "family": { "value": "4", "label": "IPv4" }, ``` Or if the returned type is correct then the swagger should be: ``` "family": { "label": "string", "value": "integer" }, ```
Author
Owner

@kobayashi commented on GitHub (Mar 2, 2020):

ChoiceField which contains int values like IPAddressFamilyChoices and RackWidthChoices has the same issue.

@kobayashi commented on GitHub (Mar 2, 2020): ChoiceField which contains `int` values like `IPAddressFamilyChoices` and `RackWidthChoices` has the same issue.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#3403