diff --git a/src/marshmallow/fields.py b/src/marshmallow/fields.py index 4458fab1a..a5e2396c9 100644 --- a/src/marshmallow/fields.py +++ b/src/marshmallow/fields.py @@ -943,6 +943,10 @@ def _validated(self, value): ): return super()._validated(value) raise self.make_error("invalid", input=value) + + if value is True or value is False: + value = self._format_num(value) + return super()._validated(value)