This breaks APIs that hard require enums whose values can be 0, e.g.
todo.sr.ht's TicketResolution.
---
srht/validation.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/srht/validation.py b/srht/validation.py
index 36e5ba3..0feecd5 100644
--- a/srht/validation.py+++ b/srht/validation.py
@@ -132,7 +132,7 @@ class Validation:
value = self.optional(name, None, cls)
if not friendly_name:
friendly_name = name
- if not isinstance(value, bool) and not value:+ if not isinstance(value, (bool, Enum)) and not value: self.error('{} is required'.format(friendly_name), field=name)
return value
--
2.32.0