diff --git a/tests/test_schema_ref_pydantic_v2.py b/tests/test_schema_ref_pydantic_v2.py index 443744e27..950c5c44b 100644 --- a/tests/test_schema_ref_pydantic_v2.py +++ b/tests/test_schema_ref_pydantic_v2.py @@ -1,4 +1,5 @@ import sys +from typing import Any from fastapi import FastAPI from fastapi.testclient import TestClient @@ -19,9 +20,9 @@ class ModelWithRef(BaseModel): model_config = ConfigDict(validate_by_alias=True, serialize_by_alias=True) -@app.get("/") -async def read_root() -> ModelWithRef: - return ModelWithRef(ref="some-ref") +@app.get("/", response_model=ModelWithRef) +async def read_root() -> Any: + return {"$ref": "some-ref"} client = TestClient(app)