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
List ChoiceField choices in Swagger as enum #4062
Comments
Fixes netbox-community#4062 Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
This issue has been closed as it does not conform to one of the provided templates as required by the contributing guide. If you'd like to request that your issue be re-opened, please first update the content so that it matches the appropriate template (this may require rewriting your issue entirely). |
@jeremystretch Updated, can you reopen? |
I would Approve this as Enhancement |
I don't have any objection to this, but do we have a good understanding of what might break by making the change? Thinking about pynetbox specifically, and similar API clients. (I'm not really sure if this constitutes an API change, but I've tagged it as such just to be safe.) |
It is just extra |
Yes, this should not affect to pynetbox. While playing with pynetbox, this change seems to not affect to the client. For go-netbox, I can make some fix for this. |
Fixes netbox-community#4062 Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
Fixes netbox-community#4062 Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
Fixes netbox-community#4062 Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
Fixes netbox-community#4062 Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
Environment
Proposed Functionality
Based on this specification https://swagger.io/docs/specification/data-models/enums/ the ChoiceField choices for label and value can (and should) be listed as enums.
Use Case
Proper generation of API model from openapi specification for 3rd party projects without requirement to query OPTIONS for each endpoint to receive extra data from django. For example we are generating Java API for Netbox based on openapi spec from Netbox. Also having the choices listed on api/docs Swagger UI is very helpful when browsing through the API docs.
Database Changes
None
External Dependencies
None
The text was updated successfully, but these errors were encountered: