sam local start-api is able to serve invalid routes
- Dominant language
- Python
- Stars
- 6.7k
- Forks
- 1.2k
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 52
Description
### Description:
The following template, with the `/e{id}` route:
```
GetFunction:
Type: AWS::Serverless::Function
Properties:
Handler: handlers/get.handler
Description: some handler
Events:
Api:
Type: Api
Properties:
Path: /e{id}
Method: GET
```
works, but I think it shouldn't (also according [to the documentation](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-routes.html#http-api-develop-routes.evaluation))
### Steps to reproduce:
- Define a Lambda and attach it to that route
- run `sam local start-api --warm-containers EAGER --skip-pull-image`
- open a browser and point to http://localhost:300/esomething
- the lambda will receive "something" as the "id" parameter
### Observed result:

### Expected result:
I think CDK rejects that format and so API Gateway and so should SAM cli.
```
Parts are validated against this regular expression: ^(\{[\w.-]+\+?\}|[a-zA-Z0-9._-]+)$ (Service: AmazonApiGatewayV2);
```
### Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
1. OS: macOS
2. `sam --version`: `SAM CLI, version 1.20.0`
3. AWS region: eu-central-1
Contributor guide
Assessment
This issue has not been assessed yet.