Skip to content

IsIn validation is not allowed for numbers #866

Closed
@npdev453

Description

@npdev453

Versions

  • sequelize: ^5.22.3
  • sequelize-typescript: ^1.1.0
  • typescript: ^4.0.2

I'm submitting a ...
[x] bug report
[ ] feature request

Actual behavior:
@isin validation type described like it allowed only for string[][] type

Expected behavior:
But should allow for numbers also too. It was fixed in validator that sequelize use:
validatorjs/validator.js#185
validatorjs/validator.js@5c4cbf7

Do not to see any reasons to limitation here.

Related code:

    @IsIn([1, 10, 100])
    @Column({
        type: DataTypes.SMALLINT,
        allowNull: false,
    })
    type: number

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions