mirror of https://github.com/tiangolo/fastapi.git
🎨 [pre-commit.ci] Auto format from pre-commit.com hooks
This commit is contained in:
parent
ce8de15a29
commit
279e17689b
|
|
@ -220,7 +220,7 @@ def get_typed_signature(call: Callable[..., Any]) -> inspect.Signature:
|
||||||
query_extra_info[param] = dict(fields[param].__repr_args__())
|
query_extra_info[param] = dict(fields[param].__repr_args__())
|
||||||
else:
|
else:
|
||||||
query_extra_info[param] = dict(fields[param].field_info.__repr_args__())
|
query_extra_info[param] = dict(fields[param].field_info.__repr_args__())
|
||||||
|
|
||||||
if "alias" in query_extra_info[param]:
|
if "alias" in query_extra_info[param]:
|
||||||
if PYDANTIC_V2:
|
if PYDANTIC_V2:
|
||||||
query_extra_info[query_extra_info[param]["alias"]] = dict(
|
query_extra_info[query_extra_info[param]["alias"]] = dict(
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@ from fastapi.testclient import TestClient
|
||||||
from pydantic import BaseModel
|
from pydantic import BaseModel
|
||||||
from pydantic.version import VERSION as PYDANTIC_VERSION
|
from pydantic.version import VERSION as PYDANTIC_VERSION
|
||||||
|
|
||||||
|
|
||||||
PYDANTIC_V2 = PYDANTIC_VERSION.startswith("2.")
|
PYDANTIC_V2 = PYDANTIC_VERSION.startswith("2.")
|
||||||
|
|
||||||
app = FastAPI()
|
app = FastAPI()
|
||||||
|
|
@ -358,9 +357,13 @@ def test_openapi_schema_with_query_dependency():
|
||||||
response = client.get("/openapi.json")
|
response = client.get("/openapi.json")
|
||||||
assert response.status_code == 200, response.text
|
assert response.status_code == 200, response.text
|
||||||
if PYDANTIC_V2:
|
if PYDANTIC_V2:
|
||||||
assert response.json() == openapi_schema_with_not_omitted_description_pydantic_v2
|
assert (
|
||||||
|
response.json() == openapi_schema_with_not_omitted_description_pydantic_v2
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
assert response.json() == openapi_schema_with_not_omitted_description_pydantic_v1
|
assert (
|
||||||
|
response.json() == openapi_schema_with_not_omitted_description_pydantic_v1
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def test_response():
|
def test_response():
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue