-
Notifications
You must be signed in to change notification settings - Fork 40.6k
Represent API "enums" in swagger #24562
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
Would be great if we can figure out a way to represent valid values and use that in swagger schema validation. |
http://stackoverflow.com/a/27606822 explains how we can represent enums in 2.0 swagger spec. |
1.2 spec supports representing enums as well: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/1.2.md#433-data-type-fields |
See also #2971 |
Do we just need to add more struct tags? |
Just a note that exposing this information in the schema rather than the comment would be most useful for tools consuming that schema. For instance see this issue against kubeval instrumenta/kubeval#18 which would be fixed with the addition of enums. |
Issues go stale after 90d of inactivity. Prevent issues from auto-closing with an If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or |
/remove-lifecycle stale |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
/remove-lifecycle stale |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Rotten issues close after 30d of inactivity. Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
@fejta-bot: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Currently they are just strings.
Example: pod restart policy.
The text was updated successfully, but these errors were encountered: