From 6aa2f985045e107d5f369a1c9dbbecda112866f4 Mon Sep 17 00:00:00 2001 From: Yurii Motov Date: Fri, 6 Mar 2026 18:54:37 +0100 Subject: [PATCH] Fix typing issue --- fastapi/params.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fastapi/params.py b/fastapi/params.py index df0dfb1094..b7c9058c66 100644 --- a/fastapi/params.py +++ b/fastapi/params.py @@ -2,7 +2,7 @@ import warnings from collections.abc import Callable, Sequence from dataclasses import dataclass from enum import Enum -from typing import Annotated, Any, Literal +from typing import Annotated, Any, Literal, cast from fastapi.exceptions import FastAPIDeprecationWarning from fastapi.openapi.models import Example @@ -668,7 +668,7 @@ class _FileUploadMarker: def __get_pydantic_core_schema__( cls, source: type[Any], handler: Any ) -> dict[str, Any]: - schema = handler(source) + schema = cast(dict[str, Any], handler(source)) # Find the inner type schema (if nullable or list) inner_type_schema = schema