Skip to content

Commit 42ed0b1

Browse files
chore(internal): fix list file params
1 parent f6afe91 commit 42ed0b1

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/finch/_utils/_utils.py

+9-1
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,16 @@ def _extract_items(
7272
from .._files import assert_is_file_content
7373

7474
# We have exhausted the path, return the entry we found.
75-
assert_is_file_content(obj, key=flattened_key)
7675
assert flattened_key is not None
76+
77+
if is_list(obj):
78+
files: list[tuple[str, FileTypes]] = []
79+
for entry in obj:
80+
assert_is_file_content(entry, key=flattened_key + "[]" if flattened_key else "")
81+
files.append((flattened_key + "[]", cast(FileTypes, entry)))
82+
return files
83+
84+
assert_is_file_content(obj, key=flattened_key)
7785
return [(flattened_key, cast(FileTypes, obj))]
7886

7987
index += 1

0 commit comments

Comments
 (0)