Skip to content

chore(v3): merging develop into v3 - 10/05/2024 #4313

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 4 additions & 9 deletions aws_lambda_powertools/event_handler/api_gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -703,6 +703,8 @@ def _openapi_operation_parameters(
from aws_lambda_powertools.event_handler.openapi.params import Param

parameters = []
parameter: Dict[str, Any] = {}

for param in all_route_params:
field_info = param.field_info
field_info = cast(Param, field_info)
Expand Down Expand Up @@ -1642,22 +1644,15 @@ def _get_openapi_security(
return security

@staticmethod
def _determine_openapi_version(openapi_version):
from aws_lambda_powertools.event_handler.openapi.pydantic_loader import PYDANTIC_V2
def _determine_openapi_version(openapi_version: str):

# Pydantic V2 has no support for OpenAPI schema 3.0
if PYDANTIC_V2 and not openapi_version.startswith("3.1"): # pragma: no cover
if not openapi_version.startswith("3.1"):
warnings.warn(
"You are using Pydantic v2, which is incompatible with OpenAPI schema 3.0. Forcing OpenAPI 3.1",
stacklevel=2,
)
openapi_version = "3.1.0"
elif not PYDANTIC_V2 and not openapi_version.startswith("3.0"): # pragma: no cover
warnings.warn(
"You are using Pydantic v1, which is incompatible with OpenAPI schema 3.1. Forcing OpenAPI 3.0",
stacklevel=2,
)
openapi_version = "3.0.3"
return openapi_version

def get_openapi_json_schema(
Expand Down
Loading