js-validator-livr
js-validator-livr copied to clipboard
Deep Errors
for better errors description (i.e. if you want to display min_length number for user)
Could you describe real use case for this? Error format is described in http://livr-spec.org. If it is reasonable we can extend error format in LIVR 0.5 and update all the implementation (PHP, Perl, Python, JS). Besides, unit tests should be updated.
I was making registration form with min_length=N for password, if there is an error I'm not able to show message like "Min length for password is N chars", only "Password is too short" is possible. So how user can get known how many chars to input.
Sounds reasonable. "detailed errors" sounds better than "deep errors". validator.getDetailedErrors(). But the questions is if this functionality should be in Spec and in core. Currently it is easy to redefine standard rules to get proposed behavior. Here is the example - https://github.com/koorchik/js-validator-livr/blob/master/t/05-rules_replacement.js
:+1: Dig this feature. Any new thoughts regrading this PR vs. spec/core?
Is this worth discussing further or closing?
I've added link to the pull request to https://github.com/koorchik/LIVR/issues/57. For future versions