Skip to content

Required assert should only check if value is defined  #29

@fixe

Description

@fixe

I think that the assert is doing more than it should. This shouldn't be invalid:

validator.validate({
  foobar: [],
  foobiz: ''
}, {
  foobar: [
    new Assert().Required(),
    new Assert().InstanceOf(Array)
  ],
  foobiz: [
    new Assert().Required()
  ]
});

@guillaumepotier WDYT? Currently I'm overriding the assert but if you agree I can create a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions