-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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(gatewayresponses): add support for API Gateway Responses #841
feat(gatewayresponses): add support for API Gateway Responses #841
Conversation
Documentation is added. I tried to match house style, but lemme know if it's n-not? I intend to have an example committed today, but Day Job may interfere. |
OK, I think we in it. I am the furthest thing from a professional Python developer, so please do let me know where I've fallen down. |
Codecov Report
@@ Coverage Diff @@
## develop #841 +/- ##
===========================================
- Coverage 94.58% 94.54% -0.05%
===========================================
Files 67 67
Lines 2865 2933 +68
Branches 519 538 +19
===========================================
+ Hits 2710 2773 +63
- Misses 83 85 +2
- Partials 72 75 +3
Continue to review full report at Codecov.
|
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 is really awesome. Thank you so much for doing this!
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.
Looking good! I haven't yet reviewed the test input/output.
Awesome. Thanks so much. I'm past EoD here in my time zone, but I'll jump on these in the morning. |
This is a WIP. Remaining: 1. Documentation 2. Examples 3. Edge Cases Which Will Be Pointed Out to Me, I'm Sure
- Adds New Minimalism Test
- Adds Globals Documentation - Passes through Values for Gateway Response Types
...Patterned off of Hello World because why not
Apologies for the force pushes -- trying to get the merge conflict resolved. This is now caught up with current feedback. |
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 just have a couple of requests:
- The comment about not allowing String for StatusCode. I think API Gateway will accept a String, and if that's the case we shouldn't disallow its use in SAM (i.e we should allow both number and string)
- Could you add a test which has multiple GatewayResponses? All tests appear to just have a single UNAUTHORIZED GatewayResponse. You can update one of your existing tests to just include a second one.
- Adds Additional Test Cases - ...for Number-Like String StatusCode - ...for Multiple Gateway Responses
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.
Ship!
Really glad to see this merged! Thanks @chrisoverzero for picking this up! @brettstack @keetonian do you guys have any idea when this will be released? I'm in dire need of this to avoid having to define the entire API myself at the moment. |
@carlnordenfelt We're working on it now. We just cut a release branch: https://github.com/awslabs/serverless-application-model/tree/release/v1.11.0 We should be able to release this soon, barring any unforeseen issues with the new features. |
This is a WIP. Remaining:DocumentationExampleIssue #, if available:
#815
Description of changes:
Added new property
GatewayResponses
toAWS::Serverless::API
. This translates tox-amazon-apigateway-gateway-responses
in the generated Swagger with some convenience transformations applied for SAMier syntax.Description of how you validated changes:
In addition to the present test suite, ran a company project through the translator. It deployed and worked correctly. (Then I reluctantly took it back down.)
Checklist:
make pr
passesBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.