From 11b4558b75363f6c9e5e37e63f0e301400dd359f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Fri, 10 Oct 2025 16:36:06 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A5=20Remove=20unreachable=20code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fastapi/_compat/v2.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/fastapi/_compat/v2.py b/fastapi/_compat/v2.py index 85800d18f..29606b9f3 100644 --- a/fastapi/_compat/v2.py +++ b/fastapi/_compat/v2.py @@ -423,8 +423,6 @@ def get_flat_models_from_annotation( if origin is not None: for arg in get_args(annotation): if lenient_issubclass(arg, (BaseModel, Enum)) and arg not in known_models: - if arg in known_models: - continue known_models.add(arg) if lenient_issubclass(arg, BaseModel): get_flat_models_from_model(arg, known_models=known_models)