diff --git a/tests/translator/input/error_default_authorizer_should_be_string_in_api.yaml b/tests/translator/input/error_default_authorizer_should_be_string_in_api.yaml new file mode 100644 index 0000000000..fca2ebb17c --- /dev/null +++ b/tests/translator/input/error_default_authorizer_should_be_string_in_api.yaml @@ -0,0 +1,30 @@ +AWSTemplateFormatVersion: "2010-09-09" +Transform: "AWS::Serverless-2016-10-31" + +Resources: + MyApi: + Type: "AWS::Serverless::Api" + Properties: + StageName: Prod + Auth: + DefaultAuthorizer: !Ref MyCognitoAuth + Authorizers: + MyCognitoAuth: + UserPoolArn: arn:aws:1 + Identity: + Header: MyAuthorizationHeader + ValidationExpression: myauthvalidationexpression + + MyFunction: + Type: AWS::Serverless::Function + Properties: + CodeUri: s3://sam-demo-bucket/thumbnails.zip + Handler: index.handler + Runtime: nodejs8.10 + Events: + Api: + Type: Api + Properties: + RestApiId: !Ref MyApi + Path: / + Method: get \ No newline at end of file diff --git a/tests/translator/output/error_default_authorizer_should_be_string_in_api.json b/tests/translator/output/error_default_authorizer_should_be_string_in_api.json new file mode 100644 index 0000000000..b3394c79be --- /dev/null +++ b/tests/translator/output/error_default_authorizer_should_be_string_in_api.json @@ -0,0 +1,3 @@ +{ + "errorMessage": "Invalid Serverless Application Specification document. Number of errors found: 1. Resource with id [MyApi] is invalid. DefaultAuthorizer is not a string." +} \ No newline at end of file