From f4be45eb734a650f4a4402029905c34e68760318 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Fri, 20 Feb 2026 22:43:35 +0100 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20Refactor=20UploadFile=20JS?= =?UTF-8?q?ON=20Schema=20to=20use=20contentMediaType=20(OpenAPI=203.1)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fastapi/datastructures.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fastapi/datastructures.py b/fastapi/datastructures.py index c04b5f0f3..479e1a7c3 100644 --- a/fastapi/datastructures.py +++ b/fastapi/datastructures.py @@ -139,7 +139,7 @@ class UploadFile(StarletteUploadFile): def __get_pydantic_json_schema__( cls, core_schema: Mapping[str, Any], handler: GetJsonSchemaHandler ) -> dict[str, Any]: - return {"type": "string", "format": "binary"} + return {"type": "string", "contentMediaType": "application/octet-stream"} @classmethod def __get_pydantic_core_schema__(