Skip to content

Commit 07c5294

Browse files
Merge pull request #4 from GDATAAdvancedAnalytics/fix-object-body-param
Fix code generation when body param is of type object
2 parents 5d0dc6d + cb64c13 commit 07c5294

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)