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

Object with 'or', keys contains an array with a 'null' element #567

Closed
gagle opened this issue Feb 26, 2015 · 1 comment
Closed

Object with 'or', keys contains an array with a 'null' element #567

gagle opened this issue Feb 26, 2015 · 1 comment
Assignees
Labels
bug Bug or defect
Milestone

Comments

@gagle
Copy link

gagle commented Feb 26, 2015

joi.object().keys({
  a: joi.string(),
  b: joi.string()
}).or('a', 'b')

This is what I get if 'a' and 'b' doen't exist:

"validation": {
  "source":"payload",
  "keys": ["null"]
}

Should keys be an empty array? I'm using the master branch.

@Marsup Marsup closed this as completed in 625b490 Feb 26, 2015
@Marsup Marsup added the bug Bug or defect label Feb 26, 2015
@Marsup Marsup self-assigned this Feb 26, 2015
@Marsup Marsup added this to the 6.0.0 milestone Feb 26, 2015
@Marsup
Copy link
Collaborator

Marsup commented Feb 26, 2015

Thanks for the report, now it's more aligned with other validations.

@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