You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
API_GATEWAY_CONTEXT_PROPERTY is not propagated for API Gateway V1 in aws-serverless-java-container-springboot4 #1589
Current setup: API Gateway V1 (REST API) → Native compiled Spring Boot backend on AWS Lambda
Current version:aws-serverless-java-container-springboot3 of version 2.1.5
Migration target: I'm looking at Spring Boot 4 migration and for this reason I'm checking if I have any problems with using aws-serverless-java-container-springboot4 of version 3.0.0-SNAPSHOT
Issue
When migrating from the springboot3 to springboot4 container, I've discovered that the API Gateway V1 request context attributes are no longer being populated on the HttpServletRequest object.
Current Behavior (springboot3)
In the springboot3 container, generateRequest1 populates several request attributes including RequestReader.API_GATEWAY_CONTEXT_PROPERTY
The springboot4 container's generateRequest1 method has been simplified and now only creates an AwsProxyHttpServletRequest without setting these attributes.
This breaks existing code that relies on accessing the API Gateway context through RequestReader.API_GATEWAY_CONTEXT_PROPERTY. In my case, I extract the authorization token from the request context.
Questions
Is this change intentional or is it a bug?
If intentional, what is the recommended approach for accessing the API Gateway context in springboot4?
If this is a bug, I'm happy to submit a pull request that restores the attribute population behavior from the springboot3 version.
Workaround
It is still possible to get the context from the underlying request, but it is a bit cumbersome and requires unwrapping the request in some places (for example in the spring security FilterChain). And it won't work with spring's @RequestAttribute annotation.
Here is an example in Kotlin
if (request isHttpServletRequestWrapper&& request.request isAwsProxyHttpServletRequest) {
val underlyingRequest = request.request asAwsProxyHttpServletRequestval requestContext = underlyingRequest.awsProxyRequest.requestContext
return requestContext.authorizer?.principalId ?:"anonymous"
}
Activity
tobixlea commentedon Feb 12, 2026
Hello, thank you for bringing this issue to our attention. We are now looking into this and will update as soon as we are able to.
tobixlea commentedon Feb 24, 2026
We have a fix in for this issue. Please update if the issue persists
kosmakdm commentedon Mar 2, 2026
Thank you, I can confirm that the issue is fixed.