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) )