May need to be a separate issue, but `| None` also removes the `Upload File` button in OpenAPI schema docs :(
from litestar import Controller, Litestar, post
from litestar.datastructures import UploadFile
from litestar.enums import RequestEncodingType
from litestar.params import Body
class Files(Controller):
@post(path="/files/upload")
async def upload_files(
self,
data: UploadFile | None = Body(media_type=RequestEncodingType.MULTI_PART),
) -> str:
return data
app = Litestar(route_handlers=[Files])
With | None
Originally posted by @JacobCoffee in #3407 (comment)
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too