Skip to content

Commit ecce16a

Browse files
PierrickBrunpgjones
authored andcommitted
Fix form multiselect request validation
1 parent c26bde0 commit ecce16a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/quart_schema/validation.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,10 @@ async def wrapper(*args: Any, **kwargs: Any) -> Any:
145145
if source == DataSource.JSON:
146146
data = await request.get_json()
147147
else:
148-
data = (await request.form).to_dict()
148+
data = (await request.form).to_dict(flat=False)
149+
for key, value in data.items():
150+
if len(value) == 1:
151+
data[key] = value[0]
149152
if source == DataSource.FORM_MULTIPART:
150153
files = await request.files
151154
for key in files:

0 commit comments

Comments
 (0)