Skip to content

Commit

Permalink
Includes a fix for request params.
Browse files Browse the repository at this point in the history
  • Loading branch information
Aleksander Lorenc committed Apr 6, 2020
1 parent b3aeee1 commit d1b40e1
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions aws_openapi_lint/rules/PathParamNotMappedRule.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,10 @@ def validate(self, spec):

request_params = integration['requestParameters']
request_params_values = request_params.values()

request_params_last = [value.split('.')[-1:] for value in request_params_values]
request_params_last = reduce(lambda x, y: x+y, request_params_last)
request_params_values = reduce(lambda x, y: x+y, request_params_values)

for path_param in all_path_params:
if path_param not in request_params_last:
if "method.request.path.%s" % path_param not in request_params_values:
message = 'Path parameter "{}" was not mapped in `requestParameters`.'.format(path_param)
violations.append(RuleViolation('path_parameter_not_mapped',
message=message,
Expand Down

0 comments on commit d1b40e1

Please sign in to comment.