Skip to content

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

Open
@scr4bble

Description

@scr4bble

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    flag: needs discussionIssues which needs discussion before implementation.type: featureIssues related to new features.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions