Skip to content

Commit d510426

Browse files
committed
chore: improve performance again
1 parent b392692 commit d510426

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

aws_lambda_powertools/event_handler/api_gateway.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1466,13 +1466,13 @@ def get_openapi_schema(
14661466
"You are using Pydantic v2, which is incompatible with OpenAPI schema 3.0. Forcing OpenAPI 3.1",
14671467
stacklevel=2,
14681468
)
1469-
openapi_version = DEFAULT_OPENAPI_VERSION
1469+
openapi_version = "3.1.0"
14701470
elif not PYDANTIC_V2 and not openapi_version.startswith("3.0"):
14711471
warnings.warn(
14721472
"You are using Pydantic v1, which is incompatible with OpenAPI schema 3.1. Forcing OpenAPI 3.0",
14731473
stacklevel=2,
14741474
)
1475-
openapi_version = DEFAULT_OPENAPI_VERSION
1475+
openapi_version = "3.0.3"
14761476

14771477
# Start with the bare minimum required for a valid OpenAPI schema
14781478
info: Dict[str, Any] = {"title": title, "version": version}
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,2 @@
1-
from aws_lambda_powertools.event_handler.openapi.pydantic_loader import PYDANTIC_V2
2-
31
DEFAULT_API_VERSION = "1.0.0"
4-
5-
if PYDANTIC_V2:
6-
DEFAULT_OPENAPI_VERSION = "3.1.0"
7-
else:
8-
DEFAULT_OPENAPI_VERSION = "3.0.3"
2+
DEFAULT_OPENAPI_VERSION = "3.0.0"

0 commit comments

Comments
 (0)