diff --git a/fastapi/_compat.py b/fastapi/_compat.py index df7541316..a2eeee91a 100644 --- a/fastapi/_compat.py +++ b/fastapi/_compat.py @@ -624,7 +624,11 @@ def is_uploadfile_sequence_annotation(annotation: Any) -> bool: continue return at_least_one args = get_args(annotation) - return field_annotation_is_sequence(annotation) and args and all( - is_uploadfile_or_nonable_uploadfile_annotation(sub_annotation) - for sub_annotation in args + return ( + field_annotation_is_sequence(annotation) + and args + and all( + is_uploadfile_or_nonable_uploadfile_annotation(sub_annotation) + for sub_annotation in args + ) )