Skip to content
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

Splitting required into notBlank and notNull #10

Closed
masseelch opened this issue Aug 25, 2020 · 1 comment
Closed

Splitting required into notBlank and notNull #10

masseelch opened this issue Aug 25, 2020 · 1 comment

Comments

@masseelch
Copy link
Contributor

masseelch commented Aug 25, 2020

Is your feature request related to a problem? Please describe.
When using the required validator on a FormField, that can have non String-type values, like many custom FormFields do (like a DatePicker), the current required validator throws an exception, since it tests on value.length > 0. Some FormFields may even return null.

One can imagine FormFields that allow an empty array as valid value, but not null. In this case the current required validator will not work as expected.

Describe the solution you'd like
Replacing required validator with adding notNull and notBlank. Or keeping required but stating it does only work on type String.

Describe alternatives you've considered
none

Additional context
See my pull request

@masseelch
Copy link
Contributor Author

I am happy to contribute with a pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants