From 58b5665e0f5e3dcd2b962669c983f9105d56ac74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Radek=20Mas=C5=82owski?= Date: Fri, 8 Aug 2025 07:40:22 +0000 Subject: [PATCH] Include in HiveInt validation types inheriting from int eg. Uint16 --- schemas/fields/hive_int.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/schemas/fields/hive_int.py b/schemas/fields/hive_int.py index 29e9624f..addc84bc 100644 --- a/schemas/fields/hive_int.py +++ b/schemas/fields/hive_int.py @@ -26,7 +26,7 @@ class HiveIntFactory(InitValidator[int], int): @classmethod def validate(cls, value: Any) -> int: error_template = msgspec.ValidationError("The value could only be int or string that can be converted to int!") - if not isinstance(value, (HiveIntFactory, str)) and type(value) is not int: + if not isinstance(value, (HiveIntFactory, str)) and (not isinstance(value, int) or isinstance(value, bool)): raise error_template try: return super().validate(int(value)) -- GitLab