Skip to content

Missing version field #210

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

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/aws-lambda-java-serialization.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
run: mvn -B install --file aws-lambda-java-events/pom.xml
# Package target module
- name: Package serialization with Maven
run: mvn -B package --file aws-lambda-java-serialization/pom.xml
run: mvn -B install --file aws-lambda-java-serialization/pom.xml

# Test Runtime Interface Client
- name: Run 'pr' target
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ public class APIGatewayProxyRequestEvent implements Serializable, Cloneable {

private static final long serialVersionUID = 4189228800688527467L;

private String version;

private String resource;

private String path;
Expand Down Expand Up @@ -871,6 +873,29 @@ public RequestIdentity clone() {
*/
public APIGatewayProxyRequestEvent() {}

/**
* @return The payload format version
*/
public String getVersion() {
return version;
}

/**
* @param version The payload format version
*/
public void setVersion(String version) {
this.version = version;
}

/**
* @param version The payload format version
* @return
*/
public APIGatewayProxyRequestEvent withVersion(String version) {
this.setVersion(version);
return this;
}

/**
* @return The resource path defined in API Gateway
*/
Expand Down Expand Up @@ -1174,6 +1199,8 @@ public APIGatewayProxyRequestEvent withIsBase64Encoded(Boolean isBase64Encoded)
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getVersion() != null)
sb.append("version: ").append(getVersion()).append(",");
if (getResource() != null)
sb.append("resource: ").append(getResource()).append(",");
if (getPath() != null)
Expand Down Expand Up @@ -1212,6 +1239,10 @@ public boolean equals(Object obj) {
if (obj instanceof APIGatewayProxyRequestEvent == false)
return false;
APIGatewayProxyRequestEvent other = (APIGatewayProxyRequestEvent) obj;
if (other.getVersion() == null ^ this.getVersion() == null)
return false;
if (other.getVersion() != null && other.getVersion().equals(this.getVersion()) == false)
return false;
if (other.getResource() == null ^ this.getResource() == null)
return false;
if (other.getResource() != null && other.getResource().equals(this.getResource()) == false)
Expand Down Expand Up @@ -1268,6 +1299,7 @@ public int hashCode() {
final int prime = 31;
int hashCode = 1;

hashCode = prime * hashCode + ((getVersion() == null) ? 0 : getVersion().hashCode());
hashCode = prime * hashCode + ((getResource() == null) ? 0 : getResource().hashCode());
hashCode = prime * hashCode + ((getPath() == null) ? 0 : getPath().hashCode());
hashCode = prime * hashCode + ((getHttpMethod() == null) ? 0 : getHttpMethod().hashCode());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"version": "1.0",
"path": "/test/hello",
"headers": {
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
Expand Down