From d1b40e1d760a862d6ed391442376fce50aff48f4 Mon Sep 17 00:00:00 2001 From: Aleksander Lorenc Date: Tue, 7 Apr 2020 00:16:47 +0200 Subject: [PATCH] Includes a fix for request params. --- aws_openapi_lint/rules/PathParamNotMappedRule.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/aws_openapi_lint/rules/PathParamNotMappedRule.py b/aws_openapi_lint/rules/PathParamNotMappedRule.py index 4f7f9f1..347c447 100644 --- a/aws_openapi_lint/rules/PathParamNotMappedRule.py +++ b/aws_openapi_lint/rules/PathParamNotMappedRule.py @@ -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,