-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] HttpMaid with route config for GET /
combined with template.yml function config Path: /
SHOULD work with sam local start-api
#86
Comments
hmm even using
sam local
|
hmm even using a subpath in the httpmaid config (like Main.java
curl
sam local
|
/
combined with template.yml function config Path: /
SHOULD work with sam local start-api
The workaround is currently:
There is a 99% chance first time users will fail, even if i put a large warning in the tutorial, because they want to go straight to the goodies, and The goal should remain that, in addition to the path parameter being optional, simple one-to-one mappings should work, such as for example: Main.javaprivate static HttpMaid httpMaidConfig() {
final HttpMaid httpMaid = HttpMaid.anHttpMaid()
.get("/", (request, response) -> response.setBody("Hello from /"))
.get("/hello", (request, response) -> response.setBody("Hello from /hello"))
.build();
return httpMaid;
} template.ymlEvents:
HelloFromFixedPathRoot:
Type: Api
Properties:
Path: /
Method: get
HelloFromFixedPathHello:
Type: Api
Properties:
Path: /hello
Method: get |
The case of mapping |
Describe the bug
If i'm a first time user doing something that feels like it should work, it should work.
In this example, the java code configures the
/
route, and the template.yml mounts thelambda onto
/
. Upon invocation, it fails because ofAwsLambdaEndpoint
's expectationthat there absolutely be a path parameter named "path":
AwsLambdaEndpoint.java:59
/{path+}
does not help (see first comment)/hello
does not help (see second comment)HttpMaid should play nice with
sam local start-api
, or at the very least, we need to have one working workaround. This will otherwise trip first time users, who initially want to try their function locally without creating an AWS Lambda first.To Reproduce
Main.java
template.yml
sam local
Expected behavior
No error, HTTP 200 response with Hello World
Environment description
Additional context
Workaround this problem by adding
/{path+}
.The text was updated successfully, but these errors were encountered: