Skip to content

Commit cb64c13

Browse files
author
Hendrik Eckardt
committed
Fix code generation when body param is of type object (e.g., C# Dictionary)
The param was correctly declared as type Dict[str, Any] in the parameter list, but the logic for the method body did not know what to do with it.
1 parent 5d0dc6d commit cb64c13

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/openapi_python_generator/language_converters/python/service_generator.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ def generate_body_param(operation: Operation) -> Union[str, None]:
5353
schema = media_type.media_type_schema
5454
if schema.type == "array":
5555
return "[i.dict() for i in data]"
56+
elif schema.type == "object":
57+
return "data"
5658
else:
5759
raise Exception(
5860
f"Unsupported schema type for request body: {schema.type}"

0 commit comments

Comments
 (0)