netbox-community / netbox

The premier source of truth powering network automation. Open source under Apache 2. Try NetBox Cloud free: https://netboxlabs.com/free-netbox-cloud/
http://netboxlabs.com/oss/netbox/
Apache License 2.0
15.98k stars 2.56k forks source link

Terminations listed for a cable in the REST API should include their numeric IDs #14606

Open jeremystretch opened 9 months ago

jeremystretch commented 9 months ago

Deployment Type

Self-hosted

NetBox Version

v3.6.7

Python Version

3.10

Steps to Reproduce

  1. Create a cable with one or more terminations on its A and B sides.
  2. View the cable's representation in the REST API (e.g. /api/dcim/cables/123/).

Expected Behavior

Each termination object represented under the cable's a_terminations and b_terminations attributes should include its own numeric primary key (ID).

Observed Behavior

This attribute is missing from the terminations. This is because the id field is not included on GenericObjectSerializer.

jeremystretch commented 1 month ago

Reclassifying this as a feature request, as the end result will simply be an intentional change to the way in which we present the serialized data.

jeremystretch commented 1 month ago

This is going to be more involved than originally anticipated because each cable instance is pre-populated with its a_terminations and b_terminations attributes representing the terminating objects, rather than the CableTermination bindings.