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

Describe with a "0" argument #454

Closed
remyhny opened this issue Oct 15, 2014 · 0 comments
Closed

Describe with a "0" argument #454

remyhny opened this issue Oct 15, 2014 · 0 comments
Labels
bug Bug or defect
Milestone

Comments

@remyhny
Copy link

remyhny commented Oct 15, 2014

hi,
When using min(0), the describe method returns no argument for the rule.

{
  "rules": [ {
    "name": "min"
  }]
}

when i should have this

{
  "rules": [{
    "name": "min",
    "arg": 0
  }]
}

After investigating, I think that's because the condition should be false only for an undefined argument.

joi/lib/any.js

Line 499 in 2340d14

if (validator.arg) {

@remyhny remyhny changed the title Describe with value 0 Describe with a "0" argument Oct 15, 2014
remyhny pushed a commit to remyhny/joi that referenced this issue Oct 16, 2014
@hueniverse hueniverse added the bug Bug or defect label Nov 3, 2014
@Marsup Marsup closed this as completed in d50a75c Nov 5, 2014
@Marsup Marsup self-assigned this Nov 5, 2014
@Marsup Marsup added this to the 4.8.0 milestone Nov 5, 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

3 participants