From b38f7acb93cdb08c0e5548eef465ed06631074ab Mon Sep 17 00:00:00 2001 From: Sergio LIVI Date: Thu, 12 Feb 2026 10:45:57 +0100 Subject: [PATCH] [FIX] add datetime.time to JSONEncoder --- base_rest/http.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/base_rest/http.py b/base_rest/http.py index af68c0540..48d3ac363 100644 --- a/base_rest/http.py +++ b/base_rest/http.py @@ -53,6 +53,8 @@ def default(self, obj): # pylint: disable=E0202,arguments-differ return obj.isoformat() elif isinstance(obj, datetime.date): return obj.isoformat() + elif isinstance(obj, datetime.time): + return obj.isoformat() elif isinstance(obj, decimal.Decimal): return float(obj) return super(JSONEncoder, self).default(obj)