joi-errors-for-forms icon indicating copy to clipboard operation
joi-errors-for-forms copied to clipboard

periods replace with commas in input names/ids

Open charleskoehl opened this issue 8 years ago • 1 comments

For example, if a text input has the name 'address.city', and it has an error, the error object returned by require('joi-errors-for-forms').form is {address,city: "required"} instead of {address.city: "required"}

charleskoehl avatar Mar 05 '18 01:03 charleskoehl

it appears to start occurring since [email protected] and is related to how path is constructed (https://github.com/hapijs/joi/issues/1302). Changing from:

var path = detail.path;

to:

var path = detail.path.join('.');

fixes the problem.

lukaszczerpak avatar May 28 '18 21:05 lukaszczerpak