js-validator-livr icon indicating copy to clipboard operation
js-validator-livr copied to clipboard

Deep Errors

Open SerikDM opened this issue 9 years ago • 6 comments

for better errors description (i.e. if you want to display min_length number for user)

SerikDM avatar Jul 17 '15 06:07 SerikDM

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.

koorchik avatar Jul 17 '15 06:07 koorchik

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.

SerikDM avatar Jul 17 '15 07:07 SerikDM

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

koorchik avatar Jul 17 '15 14:07 koorchik

:+1: Dig this feature. Any new thoughts regrading this PR vs. spec/core?

SpainTrain avatar Dec 03 '15 23:12 SpainTrain

Is this worth discussing further or closing?

SpainTrain avatar Oct 11 '18 22:10 SpainTrain

I've added link to the pull request to https://github.com/koorchik/LIVR/issues/57. For future versions

koorchik avatar Oct 12 '18 16:10 koorchik