mirror of
https://github.com/OpenMTC/OpenMTC.git
synced 2025-04-05 10:09:15 +00:00
removes empty arrays from json representation
This commit is contained in:
parent
3564d2043f
commit
278d25b1bb
@ -128,7 +128,10 @@ class OneM2MDictSerializer(OneM2MSerializer):
|
||||
if isinstance(item, OneM2MEntity):
|
||||
return self.encode_resource(item, pretty, path, encoding, fields)
|
||||
return item
|
||||
o[k] = map(encode_list_item, v)
|
||||
if len(v):
|
||||
o[k] = map(encode_list_item, v)
|
||||
else:
|
||||
empty_keys.append(k)
|
||||
else:
|
||||
try:
|
||||
if len(v) == 0:
|
||||
|
Loading…
x
Reference in New Issue
Block a user