-
Notifications
You must be signed in to change notification settings - Fork 9k
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
Display enums in parameter info #3873
Comments
I'm interested to take up this issue. |
@feenr This one is a bit trickier. The issue itself is broader and the solution should be different than what's suggested in the main ticket. If you're willing to explore it, I'll be happy to dive into details. |
I'm still interested. This is a feature I wanted in my own use. Please share any details about the expected behavior. |
Yeah, and that's one of the reasons it's not the best approach. The proper approach would be to display the fields as they would be when the try it out is enabled, only show them in a disabled form. So you can still see the value, but not execute anything. Only when the try it out is enabled, the fields would become enabled as well. |
Why does a drop down work only for user input? If a user can click it and see the available values, it's the same information. |
When I said a dropdown won't work, I meant that usually dropdowns are used when a user is making a selection to perform an action. I can't think of anywhere which a drop down is used just to present a list of values. If I were to come to this form and make a selection from the enum dropdown I'd expect some sort of interaction, like the the responses to update to reflect my selection. When "take action" is enabled a drop down makes sense because the user's selection is used when they press "execute" All this being said, it shouldn't be much effort to add the drop down, and I can do that if it's the desired experience. |
I agree with @feenr that dropdown is bot the beat to display value. @feenr, please consider two more things:
|
"bot the beat" came from mine's phone's dictionary. Sorry. I meant "not the best" |
Did not know about the description for enum values. Thanks for sharing. |
@alebar do you mean schema-level components:
schemas:
Color:
type: string
description: >
The color values are:
* `r` = red, #ff0000
* `g` = green, #00ff00
* `b` = blue, #0000ff
enum:
- r
- g
- b Parameters and schemas have |
@hkosova yes, that's what I mean. I saw it here: https://swagger.io/docs/specification/data-models/enums but I admit that I didn't read it carefully. You're right that this is not a separate So I guess there are two ways of treating this: IMHO it seems that b) is not an option. I think it's better to wait for the mentioned feature request and then do it properly. Till that time we would only have a problem when someone will follow the suggestion and add the values into Thanks @hkosova for pointing that out. |
@hkosova looks like it! Closing. |
Fixed by #4191 😄 |
Locking due to inactivity. This is done to avoid resurrecting old issues and bumping long threads with new, possibly unrelated content. If you think you're experiencing something similar to what you've found here: please open a new issue, follow the template, and reference this issue in your report. Thanks! |
Demonstration API definition
2.0:
3.0:
Expected Behavior
The parameter info in the UI displays the enum values.
Current Behavior
The enum values are only displayed when we do "try it out" and are not displayed normally.
Context
Related to #3518.
The text was updated successfully, but these errors were encountered: