Island: Check for a set representation and return a list
This commit is contained in:
parent
a1896de9c8
commit
bb3bf5ebd4
|
@ -22,6 +22,8 @@ class APIEncoder(JSONEncoder):
|
||||||
return value.name
|
return value.name
|
||||||
if issubclass(type(value), IJSONSerializable):
|
if issubclass(type(value), IJSONSerializable):
|
||||||
return loads(value.__class__.to_json(value))
|
return loads(value.__class__.to_json(value))
|
||||||
|
if issubclass(type(value), set):
|
||||||
|
return list(value)
|
||||||
try:
|
try:
|
||||||
return JSONEncoder.default(self, value)
|
return JSONEncoder.default(self, value)
|
||||||
except TypeError:
|
except TypeError:
|
||||||
|
|
Loading…
Reference in New Issue