-
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
The sandbox form could do more client side validations #993
Comments
This is related to #808 - that issue talks about the display of the validation attributes but we extended the discussion to the validation as well (which should probably be toggled). @bshamblen has done amazing work in promoting the display, and I hope he'll have time to help with the validation as well. Of course, we'd appreciate PRs for this from anyone as well :) |
@webron I would like to help with this issue... |
Maybe - @shockey or @owenconti would be able to say ;) Thanks for your contributions, @heldersepu - you're really helping the project. |
@heldersepu, that's the place! Feel free to rearrange things if you think it's best. Feel free to reach out to me over email (in profile) if you need any pointers 😄 |
This issue can be closed... |
🎉 Closing! |
For instance, consider this simple
swagger.yaml
:When loaded in swagger-ui, the "Try it out!" button (which submits the so-called "sandbox form") comes with some slick client-side validation: I try to click the submit button without filling in the
age
, the text box shakes at me and gets a red border. When I plug in anything else for theage
-12
,30
,asdf
- the form submission works just fine. This in spite of the JSON Schema validations declared in the API.I went digging and found out that required fields are the only ones that get validated by this Javascript. It seems to me like there could (should?) be way more client side validations that give similar signals to the user.
I realize this is kind of a big task: determining the correct UI for each sort of field (e.g., enums already get dropdown lists, but date formats don't get a fancy datepicker), adding the JS to perform the validation, the fact that there are quite a few different kinds of validations, interactions between different validations & types, etc. But I think there's plenty of room for enhancement.
I have a hard time telling if this is a duplicate of any of the issues brought up on the list already, so just let me know if I should watch some other ticket. Thanks!
The text was updated successfully, but these errors were encountered: