Skip to content

Commit

Permalink
Add array support for reqparser
Browse files Browse the repository at this point in the history
Add missing items for type array.
  • Loading branch information
splasky committed Jul 8, 2024
1 parent b38a7d9 commit 28b1c1f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion flask_restx/swagger.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,11 @@ def build_request_body_parameters_schema(body_params):

properties = {}
for param in body_params:
properties[param["name"]] = {"type": param.get("type", "string")}
ptype = param.get("type", "string")
if ptype == "array":
properties[param["name"]] = {"type": "array", "items": param.get("type", "string")}
else:
properties[param["name"]] = {"type": param.get("type", "string")}

return {
"name": "payload",
Expand Down

0 comments on commit 28b1c1f

Please sign in to comment.