-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into release_v1.31.0
- Loading branch information
Showing
10 changed files
with
190 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
tests/translator/input/error_invalid_method_definition.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
Globals: | ||
Api: | ||
Name: "some api" | ||
CacheClusterEnabled: True | ||
CacheClusterSize: "1.6" | ||
Auth: | ||
DefaultAuthorizer: MyCognitoAuth | ||
Authorizers: | ||
MyCognitoAuth: | ||
UserPoolArn: !GetAtt MyUserPool.Arn | ||
Variables: | ||
SomeVar: Value | ||
|
||
Resources: | ||
ImplicitApiFunction: | ||
Type: AWS::Serverless::Function | ||
Properties: | ||
CodeUri: s3://sam-demo-bucket/member_portal.zip | ||
Handler: index.gethtml | ||
Runtime: nodejs12.x | ||
Events: | ||
GetHtml: | ||
Type: Api | ||
Properties: | ||
Path: / | ||
Method: get | ||
|
||
ExplicitApi: | ||
Type: AWS::Serverless::Api | ||
Properties: | ||
StageName: SomeStage | ||
DefinitionBody: | ||
swagger: 2.0 | ||
info: | ||
version: '1.0' | ||
title: !Ref AWS::StackName | ||
paths: | ||
"/": | ||
parameters: | ||
- name: domain | ||
in: path | ||
description: Application domain | ||
type: string | ||
required: true | ||
tags: | ||
- InvalidMethodDefinition | ||
get: | ||
x-amazon-apigateway-integration: | ||
httpMethod: POST | ||
type: aws_proxy | ||
uri: !Sub arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${ImplicitApiFunction.Arn}/invocations | ||
responses: {} | ||
|
||
MyUserPool: | ||
Type: AWS::Cognito::UserPool | ||
Properties: | ||
UserPoolName: UserPoolName | ||
Policies: | ||
PasswordPolicy: | ||
MinimumLength: 8 | ||
UsernameAttributes: | ||
Schema: | ||
- AttributeDataType: String | ||
Name: email | ||
Required: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
Mappings: | ||
|
||
Parameters: | ||
Stage: | ||
Type: String | ||
Default: 'beta' | ||
Deployment: | ||
Type: String | ||
Default: 'AllAtOnce' | ||
Custom: | ||
Type: String | ||
Default: 'CustomDeployment' | ||
|
||
Resources: | ||
MinimalFunction: | ||
Type: 'AWS::Serverless::Function' | ||
Properties: | ||
CodeUri: s3://sam-demo-bucket/hello.zip | ||
Handler: hello.handler | ||
Runtime: python2.7 | ||
AutoPublishAlias: live | ||
DeploymentPreference: | ||
Type: TestDeploymentConfiguration |
70 changes: 70 additions & 0 deletions
70
tests/translator/input/error_swagger_security_not_dict.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
transformId: AWS::Serverless-2016-10-31 | ||
AWSTemplateFormatVersion: '2010-09-09' | ||
Resources: | ||
AuthFunction: | ||
Type: AWS::Serverless::Function | ||
AccessingPartyAPI: | ||
Type: AWS::Serverless::Api | ||
Properties: | ||
EndpointConfiguration: REGIONAL | ||
StageName: demo | ||
Auth: | ||
DefaultAuthorizer: CustomAuthorizer | ||
Authorizers: | ||
CustomAuthorizer: | ||
FunctionPayloadType: TOKEN | ||
FunctionArn: | ||
Fn::GetAtt: | ||
- AuthFunction | ||
- Arn | ||
AddDefaultAuthorizerToCorsPreflight: false | ||
DefinitionBody: | ||
paths: | ||
"/path": | ||
put: | ||
responses: | ||
'201': | ||
content: | ||
application/json: | ||
schema: | ||
"$ref": "abcd" | ||
x-amazon-apigateway-integration: | ||
contentHandling: CONVERT_TO_TEXT | ||
responses: | ||
default: | ||
statusCode: '200' | ||
uri: | ||
Fn::Sub: foobar | ||
httpMethod: POST | ||
passthroughBehavior: when_no_match | ||
type: aws_proxy | ||
requestBody: | ||
content: | ||
application/json: | ||
schema: | ||
required: | ||
- readoutId | ||
- status | ||
type: object | ||
security: | ||
CustomAuthorizer: [] | ||
|
||
openapi: 3.0.3 | ||
components: | ||
securitySchemes: | ||
CustomAuthorizer: | ||
in: header | ||
type: apiKey | ||
name: Authorization | ||
|
||
AccessingPartyAPIFunction: | ||
Type: AWS::Serverless::Function | ||
Properties: | ||
Events: | ||
PutReservation: | ||
Type: Api | ||
Properties: | ||
Path: "/path" | ||
RestApiId: | ||
Ref: AccessingPartyAPI | ||
Method: put |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"errorMessage":"Invalid Serverless Application Specification document. Number of errors found: 1. Structure of the SAM template is invalid. ['InvalidMethodDefinition'] for path / is not a valid dictionary."} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"errorMessage": "Invalid Serverless Application Specification document. Number of errors found: 1. Structure of the SAM template is invalid. 'Mappings' or 'Parameters' is either null or not a valid dictionary."} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"errorMessage": "Invalid Serverless Application Specification document. Number of errors found: 1. Structure of the SAM template is invalid. CustomAuthorizer in Security for path /path is not a valid dictionary." | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters