Adds snake_caseing to complex values inside lists
The default decorator doesn't support converting values found inside lists to snake case. This leads to some weird inconsistencies when dealing with lists of custom object types. This change ensures that the snake-casing is applied to all levels of the object tree.
@@ -33,6 +33,8 @@ def convert_kwargs_to_snake_case(func: Callable) -> Callable:
for k, v in d.items():
if isinstance(v, dict):
v = convert_to_snake_case(v)
+ if isinstance(v, list):
+ v = [convert_to_snake_case(i) for i in v]
converted[convert_camel_case_to_snake(k)] = v
return converted
