Skip to content

Label in object.and() #844

New issue

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

Closed
jorge-pascual opened this issue Mar 11, 2016 · 0 comments
Closed

Label in object.and() #844

jorge-pascual opened this issue Mar 11, 2016 · 0 comments
Labels
bug Bug or defect
Milestone

Comments

@jorge-pascual
Copy link

When the engine generates an error because a object.and() fails, the label for keys isn't showed. For example:

schema = Joi.object().keys({
  CustomerName: Joi.string().min(1).required(),
  CustomerUniqueDebitMandateReference: Joi.string().label('Label1'),
  CustomerMandateSignatureDate: Joi.date().format('DD/MM/YYYY').label('Label2'),
}).and('CustomerUniqueDebitMandateReference', 'CustomerMandateSignatureDate');

Joi.validate({
  CustomerName: 'name',
  CustomerMandateSignatureDate: '12/02/2016',
}, schema, log);

Generates

value contains CustomerMandateSignatureDate without its required peers CustomerUniqueDebitMandateReference

instead of

value contains Label2 without its required peers Label1

Is that correct?

@Marsup Marsup added the bug Bug or defect label Apr 9, 2016
@Marsup Marsup self-assigned this Apr 9, 2016
@Marsup Marsup added this to the 10.4.1 milestone Apr 2, 2017
@Marsup Marsup closed this as completed in 221fba5 Apr 2, 2017
@lock lock bot locked as resolved and limited conversation to collaborators Jan 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Bug or defect
Projects
None yet
Development

No branches or pull requests

2 participants