From 524148ea8cc7830018f684d459587922d5e3acc8 Mon Sep 17 00:00:00 2001 From: "Laurent Mignon (ACSONE)" Date: Wed, 14 Feb 2024 08:28:08 +0100 Subject: [PATCH] fixup! fixup! Openapi document with dependecies override with Pydantic V2 --- tests/test_dependency_overrides_openapi.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/test_dependency_overrides_openapi.py b/tests/test_dependency_overrides_openapi.py index 5d2640cd3..4fee7366b 100644 --- a/tests/test_dependency_overrides_openapi.py +++ b/tests/test_dependency_overrides_openapi.py @@ -1,6 +1,7 @@ from typing import Optional from fastapi import APIRouter, Depends, FastAPI +from fastapi._compat import PYDANTIC_V2 from fastapi.testclient import TestClient app = FastAPI() @@ -102,6 +103,10 @@ override_simple_openapi_schema = { } }, } +if not PYDANTIC_V2: + override_simple_openapi_schema["paths"]["/main-depends/"]["get"]["parameters"][0][ + "schema" + ] = {"title": "Q", "type": "string"} def test_override_simple_openapi():