-
-
Notifications
You must be signed in to change notification settings - Fork 332
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
feat(validation.md): added custom validator documentation #1016
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good overall.
|
||
static func validations(_ validations: inout Validations) { | ||
validations.add( | ||
"nameAndSurname", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great overall.
@0xTim here is a PR I made for the custom validator PR in the core repository. Feel free to merge this once the other one gets merged. Thanks :) |
This PR also fixes this issue: #1015 |
I think this is a small improvement in the documentation. Should we keep it or not? Link: https://docs.vapor.codes/basics/validation/ Before: After: |
Also added sentence below table to view custom validators section.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One change otherwise LGTM! Thanks!
docs/basics/validation.md
Outdated
Validators can also be combined to build complex validations using operators. | ||
More information on `.custom` validator at [[#Custom Validators]]. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets keep the first one as well (so have both sentences)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Let me know if there is anything else.
I created a PR earlier today, adding in a custom validator called
Custom
. This allows users to easily create custom validations, it is simpler to use and shorter in syntax compared to the current Custom Validators.This PR also resolves this issue