From 846cef1d9dbcfa0d0f5fe94b04f3d99046bc0c16 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci-lite[bot]" <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com> Date: Sun, 8 Feb 2026 13:50:08 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Auto=20format?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fastapi/dependencies/utils.py | 4 +++- tests/test_multiple_params_models.py | 3 +-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/fastapi/dependencies/utils.py b/fastapi/dependencies/utils.py index 50c6a5747..2eff34a15 100644 --- a/fastapi/dependencies/utils.py +++ b/fastapi/dependencies/utils.py @@ -780,7 +780,9 @@ def request_params_to_args( # Handle fields extracted from a Pydantic Model for a header, each field # doesn't have a FieldInfo of type Header with the default convert_underscores=True convert_underscores = getattr( - parent_field.field_info, "convert_underscores", default_convert_underscores + parent_field.field_info, + "convert_underscores", + default_convert_underscores, ) if convert_underscores: alias = get_validation_alias(field) diff --git a/tests/test_multiple_params_models.py b/tests/test_multiple_params_models.py index f8d7c8b8d..021a6b944 100644 --- a/tests/test_multiple_params_models.py +++ b/tests/test_multiple_params_models.py @@ -1,10 +1,9 @@ -from typing import Any, Callable +from typing import Annotated, Any, Callable import pytest from fastapi import APIRouter, Cookie, FastAPI, Header, Query, status from fastapi.testclient import TestClient from pydantic import BaseModel -from typing_extensions import Annotated app = FastAPI() client = TestClient(app)