File tree 1 file changed +9
-9
lines changed
aws_lambda_powertools/event_handler
1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -1572,17 +1572,17 @@ def _get_openapi_security(
1572
1572
security : Optional [List [Dict [str , List [str ]]]],
1573
1573
security_schemes : Optional [Dict [str , "SecurityScheme" ]],
1574
1574
) -> Optional [List [Dict [str , List [str ]]]]:
1575
- if security :
1576
- if not security_schemes :
1577
- raise ValueError ("security_schemes must be provided if security is provided" )
1575
+ if not security :
1576
+ return None
1578
1577
1579
- # Check if all keys in security are present in the security_schemes
1580
- if not all (key in security_schemes for sec in security for key in sec ):
1581
- raise ValueError ("Some security schemes not found in security_schemes" )
1578
+ if not security_schemes :
1579
+ raise ValueError ("security_schemes must be provided if security is provided" )
1582
1580
1583
- return security
1584
- else :
1585
- return None
1581
+ # Check if all keys in security are present in the security_schemes
1582
+ if any (key not in security_schemes for sec in security for key in sec ):
1583
+ raise ValueError ("Some security schemes not found in security_schemes" )
1584
+
1585
+ return security
1586
1586
1587
1587
@staticmethod
1588
1588
def _determine_openapi_version (openapi_version ):
You can’t perform that action at this time.
0 commit comments