From 8cdaf5271f55a27e28716bafe9dd81f060772c17 Mon Sep 17 00:00:00 2001 From: kim Date: Tue, 8 Jul 2025 14:43:17 +0900 Subject: [PATCH] refactor: clean up outdated TODO comments Replace TODO comments with clearer explanations of code intent for better maintainability. --- fastapi/_compat.py | 2 +- fastapi/routing.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/fastapi/_compat.py b/fastapi/_compat.py index 227ad837d..9c1b37185 100644 --- a/fastapi/_compat.py +++ b/fastapi/_compat.py @@ -200,7 +200,7 @@ if PYDANTIC_V2: # This expects that GenerateJsonSchema was already used to generate the definitions json_schema = field_mapping[(field, override_mode or field.mode)] if "$ref" not in json_schema: - # TODO remove when deprecating Pydantic v1 + # Set title for field when not using reference # Ref: https://github.com/pydantic/pydantic/blob/d61792cc42c80b13b23e3ffa74bc37ec7c77f7d1/pydantic/schema.py#L207 json_schema["title"] = ( field.field_info.title or field.alias.title().replace("_", " ") diff --git a/fastapi/routing.py b/fastapi/routing.py index a49b91ef5..450ddace2 100644 --- a/fastapi/routing.py +++ b/fastapi/routing.py @@ -516,7 +516,6 @@ class APIRoute(routing.Route): # would pass the validation and be returned as is. # By being a new field, no inheritance will be passed as is. A new model # will always be created. - # TODO: remove when deprecating Pydantic v1 self.secure_cloned_response_field: Optional[ModelField] = ( create_cloned_field(self.response_field) )