Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix] MethodSettings in serverless API gateway #243

Merged
merged 2 commits into from
Nov 30, 2019
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
2 changes: 1 addition & 1 deletion cloudformation/serverless/aws-serverless-api.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ type Api struct {
// MethodSettings AWS CloudFormation Property
// Required: false
// See: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#awsserverlessapi
MethodSettings interface{} `json:"MethodSettings,omitempty"`
MethodSettings []interface{} `json:"MethodSettings,omitempty"`

// Name AWS CloudFormation Property
// Required: false
Expand Down
3 changes: 2 additions & 1 deletion generate/sam-2016-10-31.json
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,8 @@
"MethodSettings": {
"Documentation": "https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#awsserverlessapi",
"Required": false,
"PrimitiveType": "Json",
"PrimitiveItemType": "Json",
"Type": "List",
"UpdateType": "Immutable"
},
"EndpointConfiguration": {
Expand Down
5 changes: 4 additions & 1 deletion schema/sam.go
Original file line number Diff line number Diff line change
Expand Up @@ -49828,7 +49828,10 @@ var SamSchema = `{
"type": "string"
},
"MethodSettings": {
"type": "object"
"items": {
"type": "object"
},
"type": "array"
},
"Name": {
"type": "string"
Expand Down
5 changes: 4 additions & 1 deletion schema/sam.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -49825,7 +49825,10 @@
"type": "string"
},
"MethodSettings": {
"type": "object"
"items": {
"type": "object"
},
"type": "array"
},
"Name": {
"type": "string"
Expand Down
14 changes: 7 additions & 7 deletions test/yaml/aws-serverless-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,21 @@ Resources:
CacheClusterEnabled: true
CacheClusterSize: test-cache-cluster-size
Variables:
NAME: VALUE
NAME: VALUE

ServerlessApiWithDefinitionUriAsS3Location:
Type: AWS::Serverless::Api
Properties:
Name: test-name
StageName: test-stage-name
DefinitionUri:
DefinitionUri:
Bucket: test-bucket
Key: test-key
Version: 1
CacheClusterEnabled: true
CacheClusterSize: test-cache-cluster-size
Variables:
NAME: VALUE
NAME: VALUE

ServerlessApiWithDefinitionBodyAsJSON:
Type: AWS::Serverless::Api
Expand All @@ -40,27 +40,27 @@ Resources:
CacheClusterEnabled: true
CacheClusterSize: test-cache-cluster-size
Variables:
NAME: VALUE
NAME: VALUE

ServerlessApiWithDefinitionBodyAsYAML:
Type: AWS::Serverless::Api
Properties:
Name: test-name
StageName: test-stage-name
DefinitionBody:
DefinitionBody:
DefinitionKey: test-definition-value
CacheClusterEnabled: true
CacheClusterSize: test-cache-cluster-size
Variables:
NAME: VALUE
NAME: VALUE

ServerlessApiWithMethodSettingsAsYAML:
Type: AWS::Serverless::Api
Properties:
Name: test-name
StageName: test-stage-name
MethodSettings:
LoggingLevel: ERROR
- LoggingLevel: ERROR
MetricsEnabled: true
CacheClusterEnabled: true
CacheClusterSize: test-cache-cluster-size
Expand Down