-
Notifications
You must be signed in to change notification settings - Fork 239
Unrecognized field "version" in class com.amazonaws.services.lambda.runtime.events.APIGatewayProxyRequestEvent #207
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
Comments
Hi Alappin, Are you using version 2 of the API Gateway proxy integration? If you are that uses a different event which does have Mark |
Hi @msailes For my AGW HTTP API, in my code, I am using the (APIGatewayProxyRequestEvent) with the format:
When I test this locally, I send requests with the below form to the lambda container image and this works
However, when I deploy the lambda and have my Version 1 integration set in AGW, I get requests of the form:
AGW adds the "version" tag regardless of whether its configured for V1 or V2 integration causing the lambda to fail because the "APIGatewayProxyRequestEvent" cannot serialize a "version" property. So I think, either AGW should be fixed to exclude "version" if configured for V1 or the lambda events package should add the "version" property so that it does not break when deployed. I hope my problem is clear. |
Also checking the documentation on https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html#http-api-develop-integrations-lambda.proxy-format It shows that Apigateway will send the "version" property for both V1 and V2 integration types. This is a problem when lambda events library (APIGatewayProxyRequestEvent) does not have the property. |
Does using v2 fix your problem while a fix is made for v1? |
The code I am working with is just a demo for using lambda with containers so I am fine waiting for the fix and then applying it. |
Hi @Alappin, Sorry for the confusing notifications you must be getting. I'm working on this atm and testing the various different scenarios. I'm hoping to sort this out soon. Mark |
Released in 3.10.0 |
A deployed lambda written in java fails in API Gateway due to a missing version field. Error message is shown below:
Unrecognized field "version" (class com.amazonaws.services.lambda.runtime.events.APIGatewayProxyRequestEvent), not marked as ignorable (12 known properties: "requestContext", "body", "queryStringParameters", "path", "headers", "httpMethod", "multiValueQueryStringParameters", "resource", "pathParameters", "isBase64Encoded", "stageVariables", "multiValueHeaders"])
It seems the latest java lambda events is missing the "version" field hence the event cannot be serialized without throwing an exception.
The text was updated successfully, but these errors were encountered: