Skip to content

Conversation

smatsumt
Copy link
Contributor

@smatsumt smatsumt commented Apr 1, 2019

When integrating API Gateway with Lambda, "httpMethod" in swagger.yaml should be "POST" when defining API method is not POST.
It is kind to let the reader know it, because some people misunderstood it.
see https://forums.aws.amazon.com/thread.jspa?messageID=745275

Issue #, if available:

NA

Description of changes:

Add comment on "swagger.yaml" in "examples/2016-10-31/api_swagger_cors"

Description of how you validated changes:

Open edited "swagger.yaml" with https://editor.swagger.io/ and it have no error about edited lines.

Checklist:

  • [na] Write/update tests
  • [na] make pr passes
  • Update documentation

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

When integrating API Gateway with Lambda, "httpMethod" should be "POST" when defining API method is not POST.
It is kind to let the reader know it, because some people misunderstood it.
see https://forums.aws.amazon.com/thread.jspa?messageID=745275
@codecov-io
Copy link

Codecov Report

Merging #875 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #875   +/-   ##
=======================================
  Coverage   94.54%   94.54%           
=======================================
  Files          67       67           
  Lines        2824     2824           
  Branches      508      508           
=======================================
  Hits         2670     2670           
  Misses         81       81           
  Partials       73       73

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 805cc85...1a30a01. Read the comment docs.

@smatsumt
Copy link
Contributor Author

smatsumt commented Apr 1, 2019

It is kind to let the reader know it, because some people misunderstood it.

Needless to say, "some people" includes me 😃


passthroughBehavior: when_no_match
httpMethod: POST
httpMethod: POST # Keep "POST" when the API definition method is not POST. This "httpMethod" is used to call Lambda.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for clarifying this. I've definitely been bitten by this as well. 😅

Consider adding a link to the API Gateway documentation in case someone wants to learn more: https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-swagger-extensions-integration.html

@jlhood jlhood merged commit 62d69cb into aws:master Apr 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants