Skip to content
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

Ref and Alternatives.when don't handle empty string keys #343

Closed
jaswilli opened this issue May 22, 2014 · 0 comments
Closed

Ref and Alternatives.when don't handle empty string keys #343

jaswilli opened this issue May 22, 2014 · 0 comments
Assignees
Labels
bug Bug or defect
Milestone

Comments

@jaswilli
Copy link
Contributor

Both of these schemas will throw assertion errors because ref is falsy:

Joi.object({
    a: Joi.alternatives().when('', { is: 5, then: Joi.valid('y') }),
    '': Joi.any()
});

and

Joi.object({
    a: Joi.ref(''),
    '': Joi.any()
});
@hueniverse hueniverse added the bug label May 22, 2014
@hueniverse hueniverse added this to the 3.4.1 milestone May 22, 2014
@hueniverse hueniverse self-assigned this May 22, 2014
@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