SAM throws error if DefaultAuthorizer is a dict #1245
Labels
contributors/good-first-issue
Good first issue for a contributor
contributors/welcome
Contributors are welcome to work on this
maintainer/need-response
type/bug
Description:
We saw a case where a customer tried to use
!Ref
in theDefaultAuthorizer
field of the Auth object on aAWS::Serverless::Api
, rather than just a string. In this case, SAM throws a 5xx error here because dict objects are not hashable. We should add a validation check to ensure the value of theDefaultAuthorizer
field is a string so we can throw a useful error message back to the customer.Steps to reproduce the issue:
Observed result:
sam-translate.py returns this:
CloudFormation returns this:
Expected result:
SAM returns helpful error message saying
DefaultAuthorizer
must be a string.The text was updated successfully, but these errors were encountered: