-
Notifications
You must be signed in to change notification settings - Fork 827
Closed
Labels
status: done/releasedIssue has been completed, no further action is needed.Issue has been completed, no further action is needed.type: featureIssues related to new features.Issues related to new features.
Description
Description
IsEnum(obj)
will produce the same error message, regardless of the expected enum values, which is useless for any practical user-facing application. Returning the message "{obj} must be a valid enum value" does not say anything about the expected input and is not actionable (unless there are some supporting docs somewhere else).
Proposed solution
It should behave like IsIn(Object.values(obj))
, which returns the message "{obj} must be one of the following values: cupcakes,lollipops,candies,whatever". This is much nicer and actionable. The end-user cares about the expected values only, not about how they are represented internally.
Metadata
Metadata
Assignees
Labels
status: done/releasedIssue has been completed, no further action is needed.Issue has been completed, no further action is needed.type: featureIssues related to new features.Issues related to new features.