-
Notifications
You must be signed in to change notification settings - Fork 10
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
Add dropdowns to sandbox UI in place of text boxes when choices are constrained. #291
Comments
Here are the relevant bits of the OpenAPI spec for the API shown above where the enum is defined and used:
and
|
@mosch @AdrianMachado |
So this is work in progress? If so, that's awesome. Any ETA? |
I just started with this one.. it might take some time.. |
Thank you. |
Heyy, just wanted to update as I said before! I shall be able to add a PR for this within next 2 days! |
Excellent! |
added the PR #306 |
Many APIs have args that are in some sense strings but what they actually accept is essetially an enumerated type with only a fixed set of accepted values. In some cases they might accept a list of these items. In the sandbox, these appear as text fields. It would be more convenient for users, especially those trying out an API in the sandbox for the first time, if these were drop downs or multi-selects populated with the allowed values.
For reference, the sandbox-like feature that FastAPI generates in their docs pages does this. Examples look like the following:
In contrast, the zudoku sandbox for the same API that is shown in the first image above produces this:
A drop down instead of a text box here would be great.
The code that generates the text input can be found at https://github.com/zuplo/zudoku/blob/main/packages/zudoku/src/lib/plugins/openapi/playground/QueryParams.tsx#L83. It would be great if this could be extended to use metadata from the OpenAPI spec to populate drop downs or multi-selects as appropriate.
The text was updated successfully, but these errors were encountered: