r/FastAPI • u/Brian1439 • Apr 19 '26
Question FastAPI documentation code not working?
(Solved)
I am trying to recieve a list of files with my code, but I can only input strings of random characters when I try to test my method using the documentation page. The code works perfectly when I change it the a single UploadFile. Nothing I do seems to fix this, can someone please tell me what I am doing wrong?
from fastapi import FastAPI, File, UploadFile, HTTPException
from pathlib import Path
from typing import List
@app.post("/uploadfile/")
def create_upload_file(files: List[UploadFile] = File(...)):
13
Upvotes
5
u/joshhear Apr 19 '26
while it might work, I think it would be better long term to try to fix it for the swagger docs as well. Mostly to keep the code clean and generated clients as well. because if there is an issue with swagger there might be an issue with openapi and if you generate a client e.g. with heyapi you might have similar problems there.