(self, obj)
| 1645 | |
| 1646 | class EnumEncoder(json.JSONEncoder): |
| 1647 | def default(self, obj): |
| 1648 | if isinstance(obj, Enum): |
| 1649 | return obj.value |
| 1650 | if isinstance(obj, bytes): |
| 1651 | return base64.b64encode(obj).decode('utf-8') |
| 1652 | return super().default(obj) |
| 1653 | |
| 1654 | |
| 1655 | def serialize( |