Where is the Gateway API directly when multiple patterns are matched?

Unlike CloudFront, there is no Priority list in the API gateway.

If two or more path patterns match the given URL in the API, which one is selected?

Example:

/
GET
  /{a}
  GET
  /static
  GET

When I switch to gibberish.execute-api.region.amazonaws.com/stage/static, will the {{} template trigger? Is it documented anywhere?

+4
source share
1 answer

Gateway APIs will not allow ambiguous paths, such as

/ {Foo}
/ {Bar}

However, given the two paths that correspond, as in your example, the Gateway API will choose the one that has more static values.

Your example

/ {a}
/ Static

/, API Gateway /static.

:

/{Foo}//{}
///{}

/value/static/baz, API Gateway /value/static/{bar}

+1

Source: https://habr.com/ru/post/1691604/


All Articles