Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion samtranslator/open_api/open_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,11 @@ def set_path_default_authorizer(self, path, default_authorizer, authorizers, api
# check if there is any method_definition given by customer
if not method_definition:
raise InvalidDocumentException(
[InvalidTemplateException(f"Invalid method definition ({method}) for path: {path}")]
[
InvalidTemplateException(
f"Invalid method definition ({normalized_method_name}) for path: {path}"
)
]
)
# If no integration given, then we don't need to process this definition (could be AWS::NoValue)
if not self.method_definition_has_integration(method_definition):
Expand Down
2 changes: 1 addition & 1 deletion tests/translator/output/error_http_api_null_method.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"errorMessage": "Invalid Serverless Application Specification document. Number of errors found: 1. Structure of the SAM template is invalid. Invalid method definition (None) for path: /test"
"errorMessage": "Invalid Serverless Application Specification document. Number of errors found: 1. Structure of the SAM template is invalid. Invalid method definition (post) for path: /test"
}