diff --git a/swagger_parser/swagger_parser.py b/swagger_parser/swagger_parser.py index fa7a349..314b7fe 100755 --- a/swagger_parser/swagger_parser.py +++ b/swagger_parser/swagger_parser.py @@ -933,7 +933,7 @@ def _validate_post_body(actual_request_body, body_specification): return True, "" # Are there required parameters? - there is only ONE body, so we check that one - parameters_required = body_specification['parameters']['body']['required'] + parameters_required = body_specification['parameters']['body'].get('required') # What if it says 'required' but there is no schema ? - we reject it schema_present = body_specification['parameters']['body'].get('schema')