-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
(feat) CloudFormation AWS::ApiGateway::RestApi support #1238
(feat) CloudFormation AWS::ApiGateway::RestApi support #1238
Conversation
tests/integration/testdata/start_api/swagger-rest-api-template.yaml
Outdated
Show resolved
Hide resolved
Properties: | ||
CodeUri: "." | ||
Events: | ||
GetApi: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't believe this is valid: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#api
Does this deploy and work as you expect it to in the cloud?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a hard time understanding the design decisions you made here. Might be worth a whiteboard session tomorrow to help me understand reasoning of your decisions. Generally I think it can be simplified.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a couple small comments. Mainly around the tests to make sure the integ tests represent a valid template.
@@ -288,6 +288,118 @@ def test_binary_response(self): | |||
self.assertEquals(response.content, expected) | |||
|
|||
|
|||
class TestStartApiWithSwaggerRestApis(StartApiIntegBaseClass): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not needed but it would be great if there was an easy to parameterize the whole class. That way we don't have to maintain two of the same tests cases for CFN and SAM. It looks like pytest fixtures might be a solution here but is a much bigger investment than this PR.
type: aws_proxy | ||
uri: | ||
Fn::Sub: arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${EchoBase64EventBodyFunction.Arn}/invocations | ||
"/functionwithnoapievent": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like it was copied from the AWS::Serverless::Api
Resource tests. I don't think this is needed since a Function with an Event will generate an AWS::Serverless::Api
and this is testing the AWS::ApiGateway::RestApi
.
tests/integration/testdata/start_api/swagger-rest-api-template.yaml
Outdated
Show resolved
Hide resolved
tests/integration/testdata/start_api/swagger-rest-api-template.yaml
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WOOT! Thanks for keeping with it
Issue #, if available:
Related pr: #1234
Description of changes:
Add support for the CloudFormation AWS::ApiGateway::RestApi type for swagger.
Checklist:
make pr
passesBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.