From f19797d18ebb6f9934b089f03540c5ba7c942c6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Thu, 13 Nov 2025 11:32:47 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=AA=20Tweak=20test=20to=20make=20it=20?= =?UTF-8?q?a=20valid=20(failing)=20test?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/test_schema_ref_pydantic_v2.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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)