-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
member_count in nested virtual chassis should be removed from example model in REST API documentation. #9592
Comments
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Do not attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our contributing guide. |
member_count needs to be removed from NestedVirtualChassisSerializer and the corresponding test. Happy to provide a PR. |
@amhn I have assigned this to you. |
This is not quite correct. The However, we can work around this by instead caching the count of members on each VirtualChassis instance per #10197. As this approach avoids any potentially disruptive changes to the REST API while also resolving the root issue, I'm going to close this issue in favor of the caching approach. |
@jeremystretch Providing the the member_count is surely the better solution and should be favored. But as far as I understood what you describe is exactly what I implemented. The Endpoints in /api/dcim/virtual_chassis still provide member_count and it is only removed from the ones under /api/dcim/devices. Those are as far as I can see the only ones using NestedVirtualChassisSerializer. I don't want to argue with you. Your solution of caching the member_count is surely the better solution for users of the API. Just want to learn what I misunderstood. |
As with all objects, the nested serializer is also used when using "brief" mode for the model endpoint (i.e. |
Thank you for the clarification. That is what I suspected, but could not verify. Turns out I was using the wrong netbox instance. |
Change Type
Correction
Area
REST API
Proposed Changes
As explained in this issue (#9329), the nested virtual chassis from the /dcim/devices/ endpoint does not return a member_count. However, the swagger-ui documentation clearly shows an example model WITH this field.
Jeremy argued that this field should not exist, so it should be removed from the example model as well.
The text was updated successfully, but these errors were encountered: