Validate an optional enum value.
The value to validate
Dot-notation path for error messages
Array of allowed values
The value or null
Validate an optional enum value.