From 70b344d68f103b7ae2577ca7b1e8ba5024678d2a Mon Sep 17 00:00:00 2001 From: Hemanth Thirthahalli Date: Mon, 8 Dec 2025 13:52:55 +0530 Subject: [PATCH] fix: remove deprecated Pydantic v1 JSON schema methods --- fastapi/datastructures.py | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/fastapi/datastructures.py b/fastapi/datastructures.py index 8ad9aa11a..42d462cbe 100644 --- a/fastapi/datastructures.py +++ b/fastapi/datastructures.py @@ -153,17 +153,6 @@ class UploadFile(StarletteUploadFile): raise ValueError(f"Expected UploadFile, received: {type(__input_value)}") return cast(UploadFile, __input_value) - # TODO: remove when deprecating Pydantic v1 - @classmethod - def __modify_schema__(cls, field_schema: Dict[str, Any]) -> None: - field_schema.update({"type": "string", "format": "binary"}) - - @classmethod - def __get_pydantic_json_schema__( - cls, core_schema: CoreSchema, handler: GetJsonSchemaHandler - ) -> JsonSchemaValue: - return {"type": "string", "format": "binary"} - @classmethod def __get_pydantic_core_schema__( cls, source: Type[Any], handler: Callable[[Any], CoreSchema]