We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
hi @hagopj13, first of all, thank you for this boilerplate, it's very useful for my learning path.
I think I found an unintended contradictive statement
Joi compiled schema without abortEarly option set to false at validate.js#L11 :
abortEarly
false
const { value, error } = Joi.compile(validSchema) .prefs({ errors: { label: 'key' } }) .validate(object);
therefore Joi will not return all errors it finds, only the first one.
but, on next line #14, errorMessage assigned from merged error.details which is always only one:
errorMessage
error.details
const errorMessage = error.details.map((details) => details.message).join(', ');
is it supposed to be?
I'll gladly make a PR about this. thank you. 😄
The text was updated successfully, but these errors were encountered:
by default abortEarly is true so its stops validation on first value in order to validate all you need to enable or set abortEarly : false
const { value, error } = Joi.compile(validSchema) .prefs({ errors: { label: 'key' } }) .validate(object, { abortEarly: false, });
Sorry, something went wrong.
5466a6d
@bwyx thanks for the tip!
@vishnubhadoriya that's my point
No branches or pull requests
hi @hagopj13, first of all, thank you for this boilerplate, it's very useful for my learning path.
I think I found an unintended contradictive statement
Joi compiled schema without
abortEarly
option set tofalse
at validate.js#L11 :therefore Joi will not return all errors it finds, only the first one.
but, on next line #14,
errorMessage
assigned from mergederror.details
which is always only one:is it supposed to be?
I'll gladly make a PR about this.
thank you. 😄
The text was updated successfully, but these errors were encountered: