Skip to content

Describe with a "0" argument  #454

@remyhny

Description

@remyhny

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) {

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugBug or defect

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions