-
Notifications
You must be signed in to change notification settings - Fork 116
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
An explanation of how required
works.
#203
Comments
If not So without specifying |
Alright, but now I'm seeing that when I remove required from a string field, my custom filter and validator function does not get called and I'm ending up passing invalid data which gets accepted, which should not happen 😔 |
System (please complete the following information):
linux
1.20
1.4.6
Describe the bug
Not necessarily a bug.
How exactly does
required
work?Suppose we have the following case
I'm getting a validation error name is required to not be empty as if I did not specify the the field
Name
. If I leave out therequired
validator it works.So the question is, when exactly to we need to use the required validator?
Because if I don't specify required are we saying that the field is optional? Or does required only work with pointer types?
Can you please explain the use cases and effects of this. I have just discovered that my validation rules were not running before because I made this PR #202 and that is why I'm confused now.
To Reproduce
Expected behavior
I expect validation to pass when
required
is specified and when a field has a valid value.Screenshots
n/a
Additional context
n/a
The text was updated successfully, but these errors were encountered: