@@ -28,6 +28,7 @@ class SwaggerEditor(object):
2828 _CACHE_KEY_PARAMETERS = "cacheKeyParameters"
2929 # https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html
3030 _ALL_HTTP_METHODS = ["OPTIONS" , "GET" , "HEAD" , "POST" , "PUT" , "DELETE" , "PATCH" ]
31+ _EXCLUDED_PATHS_FIELDS = ["summary" , "description" , "parameters" ]
3132 _POLICY_TYPE_IAM = "Iam"
3233 _POLICY_TYPE_IP = "Ip"
3334 _POLICY_TYPE_VPC = "Vpc"
@@ -527,8 +528,8 @@ def set_path_default_authorizer(
527528 for method_name , method in self .get_path (path ).items ():
528529 normalized_method_name = self ._normalize_method_name (method_name )
529530
530- # Excluding parameters section
531- if normalized_method_name == "parameters" :
531+ # Excluding non-method sections
532+ if normalized_method_name in SwaggerEditor . _EXCLUDED_PATHS_FIELDS :
532533 continue
533534 if add_default_auth_to_preflight or normalized_method_name != "options" :
534535 normalized_method_name = self ._normalize_method_name (method_name )
@@ -623,8 +624,8 @@ def set_path_default_apikey_required(self, path):
623624 """
624625
625626 for method_name , method in self .get_path (path ).items ():
626- # Excluding parameters section
627- if method_name == "parameters" :
627+ # Excluding non-method sections
628+ if method_name in SwaggerEditor . _EXCLUDED_PATHS_FIELDS :
628629 continue
629630
630631 # It is possible that the method could have two definitions in a Fn::If block.
0 commit comments