mirror of
https://github.com/fastapi/fastapi.git
synced 2026-10-23 18:29:30 -04:00
✨ Add support for forbidding extra form fields with Pydantic models (#12134)
Co-authored-by: Sofie Van Landeghem <svlandeg@users.noreply.github.com>
This commit is contained in:
1 parent
1b06b53267
commit
4633b1bca9
14 files changed
+1360
-3
No files matched your search
@@ -789,6 +789,9 @@ async def _extract_form_body(
|
||||
value = serialize_sequence_value(field=field, value=results)
|
||||
if value is not None:
|
||||
values[field.name] = value
|
||||
for key, value in received_body.items():
|
||||
if key not in values:
|
||||
values[key] = value
|
||||
return values
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user