LIVR
LIVR copied to clipboard
Include error-specific details to the validation errors
Use case:
value: [{min_length: 10}]
When this validation fails it just returns 'TOO_LONG'
error code. However, quite often we need to show the user how many characters are actually expected.
Can you think of a good way to include this data (actual length limit in that case) into the error output?
Not a part of spec, but currently it can be implemented in the following way https://github.com/koorchik/js-validator-livr/pull/7#issuecomment-122299180