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

Add multiple validators to a schema type #721

Closed
wants to merge 2 commits into from

Conversation

Projects
None yet
3 participants
@diogogmt
Copy link
Contributor

diogogmt commented Feb 8, 2012

The ticket for this pull request is the following: #718

Now multiple validators can be added to a schema type in the declaration stage.
I changed the key names of the validator object to 'validator' instead of 'func' and 'msg' instead of 'error'

All the previous tests are passing and I added a new to test to check adding multiple validators.

@aheckmann

This comment has been minimized.

Copy link
Collaborator

aheckmann commented Feb 9, 2012

merged. thanks!

@aheckmann aheckmann closed this Feb 9, 2012

@bmcmahen

This comment has been minimized.

Copy link

bmcmahen commented Jul 3, 2012

If multiple validators fail, does this create an array of error messages? Or does it merely overwrite the error message with the last validation that fails? For me, it always seems to do the later... For example, if it's both isRequired and isEmail and the field is left blank, only the isEmail error message will be returned. It would be nice to get access to the messages of all of the validations that failed on a particular field.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.