Skip to content

Commit c27fe0b

Browse files
authored
Adding missing attributes to APIGatewayProxyRequestEvent (#361)
1 parent 422bd7b commit c27fe0b

File tree

2 files changed

+33
-15
lines changed

2 files changed

+33
-15
lines changed

aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/apigateway/APIGatewayProxyRequestEvent.java

+19-7
Original file line numberDiff line numberDiff line change
@@ -72,23 +72,35 @@ public static class ProxyRequestContext implements Serializable {
7272

7373
private String accountId;
7474

75-
private String stage;
75+
private String apiId;
7676

77-
private String resourceId;
77+
private Map<String, Object> authorizer;
7878

79-
private String requestId;
79+
private String domainName;
8080

81-
private RequestIdentity identity;
81+
private String domainPrefix;
8282

83-
private String resourcePath;
83+
private String extendedRequestId;
8484

8585
private String httpMethod;
8686

87-
private String apiId;
87+
private RequestIdentity identity;
8888

8989
private String path;
9090

91-
private Map<String, Object> authorizer;
91+
private String protocol;
92+
93+
private String requestId;
94+
95+
private String requestTime;
96+
97+
private Long requestTimeEpoch;
98+
99+
private String resourceId;
100+
101+
private String resourcePath;
102+
103+
private String stage;
92104
}
93105

94106
@Data

aws-lambda-java-events/src/test/resources/event_models/api_gateway_proxy_request_event.json

+14-8
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,12 @@
2323
"proxy": "hello"
2424
},
2525
"requestContext": {
26-
"path": "/{proxy+}",
2726
"accountId": "123456789012",
28-
"resourceId": "nl9h80",
29-
"stage": "test-invoke-stage",
30-
"requestId": "test-invoke-request",
27+
"apiId": "id",
28+
"domainName": "id.execute-api.us-east-1.amazonaws.com",
29+
"domainPrefix": "id",
30+
"extendedRequestId": "request-id",
31+
"httpMethod": "GET",
3132
"identity": {
3233
"cognitoIdentityPoolId": "",
3334
"accountId": "123456789012",
@@ -42,9 +43,14 @@
4243
"userAgent": "Apache-HttpClient/4.5.x (Java/1.8.0_131)",
4344
"user": "AIDAJTIRKKKER4HCKVJZG"
4445
},
45-
"resourcePath": "/{proxy+}",
46-
"httpMethod": "POST",
47-
"apiId": "r275xc9bmd"
46+
"path": "/my/path",
47+
"protocol": "HTTP/1.1",
48+
"requestId": "id=",
49+
"requestTime": "04/Mar/2020:19:15:17 +0000",
50+
"requestTimeEpoch": 1583349317135,
51+
"resourceId": "123456",
52+
"resourcePath": "/my/path",
53+
"stage": "$default"
4854
},
4955
"resource": "/{proxy+}",
5056
"httpMethod": "GET",
@@ -56,4 +62,4 @@
5662
"stageVariables": {
5763
"stageVarName": "stageVarValue"
5864
}
59-
}
65+
}

0 commit comments

Comments
 (0)