async-validator icon indicating copy to clipboard operation
async-validator copied to clipboard

Ability To Validate Against Multiple Types

Open rowlowles opened this issue 6 years ago • 2 comments

I am using AntD's forms to validate some user inputs and I am running into a case where I want to validate against multiple types for a single rule, akin to the behaviour described in async-validate.

It would be nice to be able to define rules in a manner akin to:

rules: [
  {
    type: ['integer', 'number']
    message: 'Not a number.'
  },
  {
    type: ['integer']
    message: 'Not an integer.'
  }
]

rowlowles avatar Oct 07 '19 14:10 rowlowles

I'm looking forward to it.

snowwolf007cn avatar Mar 18 '20 22:03 snowwolf007cn

looking forward for this union validation options

rickvian avatar Oct 06 '21 04:10 rickvian