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

using required() on an optional field does nothing #29

Open
Fasuh opened this issue Sep 24, 2021 · 0 comments
Open

using required() on an optional field does nothing #29

Fasuh opened this issue Sep 24, 2021 · 0 comments

Comments

@Fasuh
Copy link
Contributor

Fasuh commented Sep 24, 2021

Describe the bug
I am using global validator builder, because i want to have the same locale everywhere. bue i have noticed that whenever i am using the optional: true parameter, it overrides future required() method. i feel like it should not be an intended behaviour since the constructor of ValidationBuilder is using required()

    if (!optional) required(requiredMessage);

it should base only on that or change flag optional when we are using required()

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

1 participant