Skip to content

Commit 36208f2

Browse files
committed
request body in openapi no need to append the components
Fixes ##2029 Signed-off-by: frankzye1 <[email protected]>
1 parent a1c53db commit 36208f2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

connexion/operations/openapi.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,8 @@ def consumes(self):
134134
def produces(self):
135135
return self._produces
136136

137-
def with_definitions(self, schema: dict):
138-
if self.components:
137+
def with_definitions(self, schema: dict, append_components=True):
138+
if self.components and append_components:
139139
schema.setdefault("schema", {})
140140
schema["schema"]["components"] = self.components
141141
return schema
@@ -241,5 +241,5 @@ def body_definition(self, content_type: t.Optional[str] = None) -> dict:
241241
)
242242
content_type_dict = MediaTypeDict(self.request_body.get("content", {}))
243243
res = content_type_dict.get(content_type, {})
244-
return self.with_definitions(res)
244+
return self.with_definitions(res, append_components=False)
245245
return {}

0 commit comments

Comments
 (0)