From b5032f39a0c49b9811ed0906360cfc947340ab27 Mon Sep 17 00:00:00 2001 From: Maxim Claeys Date: Mon, 21 Oct 2024 12:30:34 +0200 Subject: [PATCH] Fix support for pydantic v1 --- fastapi/dependencies/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fastapi/dependencies/utils.py b/fastapi/dependencies/utils.py index 018f3ded8..c5105efad 100644 --- a/fastapi/dependencies/utils.py +++ b/fastapi/dependencies/utils.py @@ -722,7 +722,7 @@ def _get_multidict_value( and value == "" ): # Empty strings in a form can be a representation of None values - _, error = field.validate(value=None) + _, error = field.validate(None, {}, loc=()) # If None is an accepted value for this field, use that if error is None: value = None