Skip to content
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

feature: make @IsEnum() complain about wrong argument type used #2558

Open
scr4bble opened this issue Nov 22, 2024 · 1 comment
Open

feature: make @IsEnum() complain about wrong argument type used #2558

scr4bble opened this issue Nov 22, 2024 · 1 comment
Labels
flag: needs discussion Issues which needs discussion before implementation. type: feature Issues related to new features.

Comments

@scr4bble
Copy link

Description

When @IsEnum() is used in combination with array value passed as an argument the code should generate an error or warning instead of silently letting user to use it incorrectly.
The validator seems to work with array, but the generated message is not correct when array is used:

    "message": "Bad Request: status must be one of the following values: "

Proposed solution

Best would be to somehow force the correct type via typescript definition.

@scr4bble scr4bble added flag: needs discussion Issues which needs discussion before implementation. type: feature Issues related to new features. labels Nov 22, 2024
@scr4bble
Copy link
Author

This issue relates to #2536

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flag: needs discussion Issues which needs discussion before implementation. type: feature Issues related to new features.
Development

No branches or pull requests

1 participant