Skip to content

Commit

Permalink
Required keys are when they are not present, or present with "True"
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelgf committed Jul 8, 2021
1 parent e201991 commit e59dd69
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions connexion/decorators/response.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,8 @@ def validate_response(self, data, status_code, headers, url):
raise NonConformingResponseBody(message=str(e))

if response_definition and response_definition.get("headers"):
# converting to set is needed to support python 2.7
required_header_keys = {k for (k, v) in response_definition.get("headers").items()
if v.get('required', False)}
if v.get("required", True)}
header_keys = set(headers.keys())
missing_keys = required_header_keys - header_keys
if missing_keys:
Expand Down

0 comments on commit e59dd69

Please sign in to comment.