Skip to content

Commit e21b916

Browse files
authoredMay 10, 2024··
refactor(general): drop pydantic v1 (#4305)
1 parent c2d088e commit e21b916

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+755
-1141
lines changed
 

‎aws_lambda_powertools/event_handler/api_gateway.py

+3-9
Original file line numberDiff line numberDiff line change
@@ -1587,22 +1587,16 @@ def _get_openapi_security(
15871587
return security
15881588

15891589
@staticmethod
1590-
def _determine_openapi_version(openapi_version):
1591-
from aws_lambda_powertools.event_handler.openapi.pydantic_loader import PYDANTIC_V2
1590+
def _determine_openapi_version(openapi_version: str):
15921591

15931592
# Pydantic V2 has no support for OpenAPI schema 3.0
1594-
if PYDANTIC_V2 and not openapi_version.startswith("3.1"):
1593+
if not openapi_version.startswith("3.1"):
15951594
warnings.warn(
15961595
"You are using Pydantic v2, which is incompatible with OpenAPI schema 3.0. Forcing OpenAPI 3.1",
15971596
stacklevel=2,
15981597
)
15991598
openapi_version = "3.1.0"
1600-
elif not PYDANTIC_V2 and not openapi_version.startswith("3.0"):
1601-
warnings.warn(
1602-
"You are using Pydantic v1, which is incompatible with OpenAPI schema 3.1. Forcing OpenAPI 3.0",
1603-
stacklevel=2,
1604-
)
1605-
openapi_version = "3.0.3"
1599+
16061600
return openapi_version
16071601

16081602
def get_openapi_json_schema(

0 commit comments

Comments
 (0)
Please sign in to comment.