Skip to content

Commit 28b1c1f

Browse files
committed
Add array support for reqparser
Add missing items for type array.
1 parent b38a7d9 commit 28b1c1f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

flask_restx/swagger.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,11 @@ def build_request_body_parameters_schema(body_params):
214214

215215
properties = {}
216216
for param in body_params:
217-
properties[param["name"]] = {"type": param.get("type", "string")}
217+
ptype = param.get("type", "string")
218+
if ptype == "array":
219+
properties[param["name"]] = {"type": "array", "items": param.get("type", "string")}
220+
else:
221+
properties[param["name"]] = {"type": param.get("type", "string")}
218222

219223
return {
220224
"name": "payload",

0 commit comments

Comments
 (0)