Skip to content

Commit

Permalink
#5 Fix security parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcs committed Jun 12, 2015
1 parent 8e44044 commit 9c62e1a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions connexion/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def __init__(self, swagger_yaml_path: pathlib.Path, base_url: str=None, argument
# API calls.
self.produces = self.specification.get('produces', list()) # type: List[str]

self.security = self.specification.get('security', None)
self.security = self.specification.get('security', [None]).pop()
self.security_definitions = self.specification.get('securityDefinitions', dict())

# Create blueprint and enpoints
Expand Down Expand Up @@ -118,7 +118,7 @@ def _get_security_decorator(self, operation: dict) -> types.FunctionType:
The name used for each property **MUST** correspond to a security scheme declared in the Security Definitions.
"""
security = operation['security'] if 'security' in operation else self.security
security = operation['security'].pop() if 'security' in operation else self.security
if security:
if len(security) > 1:
logger.warning("... More than security requirement defined. **IGNORING SECURITY REQUIREMENTS**")
Expand Down
2 changes: 1 addition & 1 deletion connexion/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version = '0.4'
version = '0.4.1'

0 comments on commit 9c62e1a

Please sign in to comment.