Skip to content
This repository was archived by the owner on Jul 24, 2025. It is now read-only.

Commit 72d89f1

Browse files
zeusttuadamkitain
andauthored
Make "content" key in body definition optional
This was committed as a GitHub review suggestion. Commit message suggested by Github: Update openapi2jsonschema/util.py Co-authored-by: Adam Kitain <[email protected]>
1 parent 483eda6 commit 72d89f1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

openapi2jsonschema/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def get_components_from_body_definition(body_definition, prefix=""):
121121
"application/vnd.api+json": "jsonapi",
122122
}
123123
result = {}
124-
for mimetype, definition in body_definition["content"].items():
124+
for mimetype, definition in body_definition.get("content", {}).items():
125125
type_name = MIMETYPE_TO_TYPENAME_MAP.get(
126126
mimetype,
127127
mimetype.replace("/", "_"),

0 commit comments

Comments
 (0)