forked from platypush/platypush
Convert UUID objects to strings when serializing to JSON.
This commit is contained in:
parent
15fadb93bb
commit
7be55e446f
1 changed files with 4 additions and 0 deletions
|
@ -7,6 +7,7 @@ import inspect
|
||||||
import json
|
import json
|
||||||
import time
|
import time
|
||||||
from typing import Union
|
from typing import Union
|
||||||
|
from uuid import UUID
|
||||||
|
|
||||||
logger = logging.getLogger('platypush')
|
logger = logging.getLogger('platypush')
|
||||||
|
|
||||||
|
@ -60,6 +61,9 @@ class Message:
|
||||||
if isinstance(obj, set):
|
if isinstance(obj, set):
|
||||||
return list(obj)
|
return list(obj)
|
||||||
|
|
||||||
|
if isinstance(obj, UUID):
|
||||||
|
return str(obj)
|
||||||
|
|
||||||
value = self.parse_numpy(obj)
|
value = self.parse_numpy(obj)
|
||||||
if value is not None:
|
if value is not None:
|
||||||
return value
|
return value
|
||||||
|
|
Loading…
Reference in a new issue