pre-commit-ci-lite[bot]
4 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with
4 additions and
3 deletions
-
fastapi/dependencies/utils.py
-
tests/test_multiple_params_models.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) |
|
|
|
|
|
|
|
@ -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) |
|
|
|
|