-
Notifications
You must be signed in to change notification settings - Fork 560
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
Unable to bind requestParameter to @ModelAttribute form in serverless ~ Spring boot2 #340
Comments
Hey @1tkd, can you share some sample code to help us replicate? |
Thanks for helping. Controller
Form
Template
|
Any workaround for this issue? Got the same problem when posting |
Sorry for the late response. You need to define a mapping for This forum post https://forums.aws.amazon.com/thread.jspa?messageID=663593&tstart=0#663593 describe a similar configuration. See also https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-mapping-template-reference.html#input-variable-reference in the documentation. |
Thanks for the response.
As a supplementary note, the data in application/x-www-form-urlencoded is available from HttpServletRequest. |
@1tkd please ignore my previous commit, this is only valid if you are not using proxy integration. Sorry, I should have initially read your description more carefully. I deployed your sample after adding the following properties to application.yml:
Comparing the output of the Lambda execution in CloudWatch with local execution on Tomcat indicates that empty parameters are missing. Will add a testcase and proposed fix for that. |
Scenario
I send a POST request to aws lambda via api gateway.
Expected behavior
In the RequestMapping method,
the request parameter was mapped to form.
Actual behavior
In the RequestMapping method,
i got null from form object.
Steps to reproduce
maven build
test project
create lambda function
runtime:java11
handler:contract.StreamLambdaHandler
create api gateway
api type:rest
/{PROXY+}/ANY
integration type:lambda function
deloy api gateway
access via web browser
(http://~/(stage)/start)
input some string to v1 input field
press submit
check v2 input filed
Full log output
The text was updated successfully, but these errors were encountered: