From 513e943f969f028e1dfe4edfcf7fd7fb5206b1c3 Mon Sep 17 00:00:00 2001 From: Jan Vollmer Date: Sun, 15 Feb 2026 12:30:58 +0100 Subject: [PATCH] fix optional return type Signed-off-by: Jan Vollmer --- fastapi/routing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fastapi/routing.py b/fastapi/routing.py index 98a95145c..7c5d552b8 100644 --- a/fastapi/routing.py +++ b/fastapi/routing.py @@ -694,7 +694,7 @@ class APIRoute(routing.Route): return _should_embed_body_fields(self._flat_dependant.body_params) @cached_property - def body_field(self) -> Optional[ModelField]: + def body_field(self) -> ModelField | None: return get_body_field( flat_dependant=self._flat_dependant, name=self.unique_id,