https://github.com/ramosbugs/aws-sam-rest-api-repro
Reproduces route dedupe bug in https://github.com/aws/aws-sam-cli/pull/2458
https://github.com/ramosbugs/aws-sam-rest-api-repro
Last synced: about 2 months ago
JSON representation
Reproduces route dedupe bug in https://github.com/aws/aws-sam-cli/pull/2458
- Host: GitHub
- URL: https://github.com/ramosbugs/aws-sam-rest-api-repro
- Owner: ramosbugs
- License: mit
- Created: 2021-04-30T01:42:54.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2021-04-30T01:44:43.000Z (about 5 years ago)
- Last Synced: 2026-01-02T06:13:40.996Z (6 months ago)
- Language: Python
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
### To reproduce:
The following assumes that the [`aws-sam-cli`](https://github.com/aws/aws-sam-cli)
[PR #2458](https://github.com/ramosbugs/aws-sam-cli/tree/develop-operation-name) branch has been
checked out into `../aws-sam-cli` and that a `virtualenv` has been initialized properly.
To start the API:
```
$ python ../aws-sam-cli/samcli local start-api
```
Actual output:
```
$ curl http://127.0.0.1:3000/foo
{"message": "routed to handler getFoo"}
$ curl -X POST http://127.0.0.1:3000/foo
{"message": "routed to handler getFoo"}
```
Note that both requests are supplied an `operationName` of `getFoo`. The latter request should be
`postFoo`.
Expected output:
```
$ curl http://127.0.0.1:3000/foo
{"message": "routed to handler getFoo"}
$ curl -X POST http://127.0.0.1:3000/foo
{"message": "routed to handler postFoo"}
```