-
Notifications
You must be signed in to change notification settings - Fork 83
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
@QueryValue does not work with API GW Rest API #1443
Comments
It only works if you use Payload 1.0 formatI created an app with I have a repository which shows it works with Amazon API gateway and Http Api. See how https://github.com/grails-core-issues-forks/micronaut-aws-issue-1443 import software.amazon.awscdk.services.apigatewayv2.alpha.HttpApi;
import software.amazon.awscdk.services.apigatewayv2.integrations.alpha.HttpLambdaIntegration;
import static software.amazon.awscdk.services.apigatewayv2.alpha.PayloadFormatVersion.VERSION_1_0;
.....
HttpLambdaIntegration integration =
HttpLambdaIntegration.Builder.create("HttpLambdaIntegration", function)
.payloadFormatVersion(VERSION_1_0)
.build();
HttpApi api = HttpApi.Builder.create(this, "micronaut-function-api")
.defaultIntegration(integration)
.build(); To run the script you will need: Install AWS CDK CLIInstall
|
Hello @sdelamo I have confirmed we are using payload version 1.0 with AWS API Gateway REST API. API GW Rest API only support that payload version currently, so that should not be the issue. Perhaps I get this issue because our lambda is deployed as an native-image which uses a custom runtime handler we have created that replaces the MicronautLambdaRuntime handler? When building and deploying to cloud we use Our handler looks like this.
|
Expected Behavior
When sending a request to a controller endpoint with @QueryValue for example ?foo=bar the expected outcome is that the value is provided to the variable.
@QueryValue String foo
Actual Behaviour
When deploying this to an AWS Lambda function integrated with a REST API GW using the following format version.
https://docs.aws.amazon.com/apigateway/latest/developerguide/set-up-lambda-proxy-integrations.html#api-gateway-simple-proxy-for-lambda-input-format
The query string parameters does not seem to be parsed and provided properly to the @QueryValue.
The response will always be
Steps To Reproduce
1: Create new Micronaut 3.6.1 project with
2: Create a controller with a Get endpoint that requires a @QueryValue
3: Build and deploy to AWS Lambda with an API GW Proxy integration
Environment Information
Micronaut 3.6.1
GraalVM 22.2.0
AWS API GW - REST API
Example Application
No response
Version
3.6.1
The text was updated successfully, but these errors were encountered: