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}