Skip to content

Commit 45e7a30

Browse files
Merge pull request #7 from ulasozguler/master
Fix - propagate `casing` param of `to_dict` function recursively
2 parents feea790 + f9c351a commit 45e7a30

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

betterproto/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -723,14 +723,14 @@ def to_dict(self, casing: Casing = Casing.CAMEL) -> dict:
723723
output[cased_name] = v
724724
elif isinstance(v, list):
725725
# Convert each item.
726-
v = [i.to_dict() for i in v]
726+
v = [i.to_dict(casing) for i in v]
727727
output[cased_name] = v
728728
elif v._serialized_on_wire:
729-
output[cased_name] = v.to_dict()
729+
output[cased_name] = v.to_dict(casing)
730730
elif meta.proto_type == "map":
731731
for k in v:
732732
if hasattr(v[k], "to_dict"):
733-
v[k] = v[k].to_dict()
733+
v[k] = v[k].to_dict(casing)
734734

735735
if v:
736736
output[cased_name] = v

0 commit comments

Comments
 (0)