Validate that a value is one of the allowed enum values.
The value to validate
Dot-notation path for error messages
Array of allowed values
if the value is not in the allowed list
Validate that a value is one of the allowed enum values.