-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Object count fields are documented in Swagger for REST API GET requests but not included in the response #16085
Comments
Related object counts are intended to be included only for the root object: The data is not available on the underlying queryset when nesting. Opening this for anyone who would like to correct the OpenAPI schema to reflect this. |
As laid out in #16418, this kind of discrepancy can wreak havoc with strongly-typed client generator frameworks. Bumping severity to medium. |
@jeffgdotorg any issues with the OpenAPI schema should be classified as low severity as they do not impact the operation of NetBox itself. |
@janhlavin in #16418 (dupe of this issue) you mentioned that dropping |
@atownson same goes for you – PRs are welcome. Just let us know if you'd like to work it through, so we can assign the issue to you. |
Also encountered this issue, but in broader sense, the |
I think this is related to #16670 |
closing as dupe of #16670 |
The issue still exists with version 4.1.1, screenshots are from demo Netbox which has the same version i'm start to use. @arthanson can you reopen the issue? ![]() ![]() ![]() |
Deployment Type
Self-hosted
NetBox Version
v4.0.1
Python Version
3.11
Steps to Reproduce
The
RelatedObjectCountField
REST API serializer fields are being documented in the REST API Swagger for GET requests but not actually returned in the response.The behavior seems consistent wherever
RelatedObjectCountField
is used.Expected Behavior
Based on the serializer classes, I assume the intention is to include these count fields since they're included in the brief fields. Either way, the Swagger scheme documentation should match the response content.
Observed Behavior
The Swagger documented schemes differ from the response content.
The text was updated successfully, but these errors were encountered: