-
Notifications
You must be signed in to change notification settings - Fork 2.7k
DeviceType_Count on Manufacturer #17976
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The 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! |
@ZionDials are you still planning to work on this? |
I've made several efforts to analyze the situation and identify a solution; however, I realize that I don't have the necessary expertise to resolve this issue effectively. |
Updated
might need to add the annotation directly on the prefetch, along the lines of:
|
Hi there! I am not sure if I should be commenting on this thread but I am experiencing a similar issue and thought it better to comment on here rather than opening a new thread. When calling GET /api/virtualization/virtual-machines/{id} the OpenAPI specification and the actual response body does not match. The request returns a 'VirtualMachineWithConfigContext' but is missing the nested properties 'virtualmachine_count' and/or 'device_count' for some of its properties. In the picture below, I have highlighted the affected properties. The objects of the actual response looks like this.
Am I correct in assuming the fix you are working on in #18583 will resolve this as well? I am on version 4.2.2 of Netbox. |
After exploring this issue at #18583, I didn't find a proper solution for this issue, Here are my findings: 1 - There're some models' serializers that doesn't use brief_field in the nested fields, example, and the current implementation always use the brief_fields, code Challenges: When the nested |
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
The text was updated successfully, but these errors were encountered: