Skip to content

IsIn validation is not allowed for numbers #866

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

Closed
npdev453 opened this issue Dec 9, 2020 · 0 comments · Fixed by #1124
Closed

IsIn validation is not allowed for numbers #866

npdev453 opened this issue Dec 9, 2020 · 0 comments · Fixed by #1124

Comments

@npdev453
Copy link

npdev453 commented Dec 9, 2020

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant