Open ZionDials opened 3 days ago
The devicetype_count
field is being omitted from the nested representation of manufacturers because the dynamic annotation logic does not recurse for nested serializers. (The field is populated as expected when querying the manufacturers endpoint with ?brief=True
.)
While it's feasible to fix this by explicitly attaching the annotation to DeviceTypeViewSet, we should instead extend the dynamic logic to account for nested fields, as it's very likely there are similar instances in other nested serializers that also need to be addressed.
@ZionDials just realized that you volunteered for this. Assigning to you, thanks!
Deployment Type
Self-hosted
Triage priority
I volunteer to perform this work (if approved)
NetBox Version
v4.1.6
Python Version
3.10
Steps to Reproduce
GET /api/dcim/device-types/
Note
"devicetype_count"
is missing.Expected Behavior
The expected response, according to the OpenAPI specification for Netbox:
GET /api/dcim/device-types/
Observed Behavior
According to the OpenAPI specification BriefManufacturer has a required field of
"devicetype_count"
. However, when querying DeviceTypes and ModuleTypes, the field is not populated and causes SDKs using the OpenAPI generator, to fail.Go-Netbox Creating Manufacture errors out because of missing required property devicetype_count #165