Skip to content

Commit

Permalink
make requestBody always lower case
Browse files Browse the repository at this point in the history
  • Loading branch information
prt0117 committed May 15, 2024
1 parent 270dffc commit 2da0e8a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/swagger2jsonschema/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def get_body_file_prefix(path, http_method):
# Paths "/" and "/root" will conflict,
# no idea how to solve this elegantly.
path.lstrip("/").replace("/", "_") or "root",
http_method.upper(),
http_method,
)
return re.sub(
r"\{([^:\}]+)\}",
Expand Down Expand Up @@ -198,7 +198,7 @@ def get_request_parameters_from_paths(paths):
if "$ref" in schema:
tmp = schema["$ref"]
tmp = tmp.replace("#/components/schemas/", "") + ".json"
component["requestBody"] = tmp
component["requestBody"] = tmp.lower()
else:
prefix_fmt = get_body_file_prefix(path, http_method)
prefix = prefix_fmt.format("request")
Expand Down

0 comments on commit 2da0e8a

Please sign in to comment.