Merge pull request #7 from ulasozguler/master
Fix - propagate `casing` param of `to_dict` function recursively
This commit is contained in:
commit
45e7a30300
@ -723,14 +723,14 @@ class Message(ABC):
|
|||||||
output[cased_name] = v
|
output[cased_name] = v
|
||||||
elif isinstance(v, list):
|
elif isinstance(v, list):
|
||||||
# Convert each item.
|
# Convert each item.
|
||||||
v = [i.to_dict() for i in v]
|
v = [i.to_dict(casing) for i in v]
|
||||||
output[cased_name] = v
|
output[cased_name] = v
|
||||||
elif v._serialized_on_wire:
|
elif v._serialized_on_wire:
|
||||||
output[cased_name] = v.to_dict()
|
output[cased_name] = v.to_dict(casing)
|
||||||
elif meta.proto_type == "map":
|
elif meta.proto_type == "map":
|
||||||
for k in v:
|
for k in v:
|
||||||
if hasattr(v[k], "to_dict"):
|
if hasattr(v[k], "to_dict"):
|
||||||
v[k] = v[k].to_dict()
|
v[k] = v[k].to_dict(casing)
|
||||||
|
|
||||||
if v:
|
if v:
|
||||||
output[cased_name] = v
|
output[cased_name] = v
|
||||||
|
Loading…
x
Reference in New Issue
Block a user