Skip to content
Open
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 aws-lambda-java-serialization/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<relocation.prefix>com.amazonaws.lambda.thirdparty</relocation.prefix>
<jackson.version>2.15.4</jackson.version>
<jackson.version>2.18.6</jackson.version>
<gson.version>2.10.1</gson.version>
<json.version>20231013</json.version>
<owasp.version>7.3.2</owasp.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import com.amazonaws.services.lambda.runtime.serialization.PojoSerializer;
import com.amazonaws.services.lambda.runtime.serialization.util.ReflectUtil;
import com.amazonaws.services.lambda.runtime.serialization.util.SerializeUtil;
import com.fasterxml.jackson.databind.PropertyNamingStrategies;
import com.fasterxml.jackson.databind.PropertyNamingStrategy;
import com.amazonaws.services.lambda.runtime.serialization.events.modules.DateModule;
import com.amazonaws.services.lambda.runtime.serialization.events.modules.DateTimeModule;
Expand Down Expand Up @@ -91,7 +92,7 @@ public class LambdaEventSerializers {
new SimpleEntry<>("com.amazonaws.services.s3.event.S3EventNotification", new S3EventSerializer<>()),
new SimpleEntry<>("com.amazonaws.services.lambda.runtime.events.models.s3.S3EventNotification", new S3EventSerializer<>()),
new SimpleEntry<>("com.amazonaws.services.lambda.runtime.events.S3Event", new S3EventSerializer<>()))
.collect(Collectors.toMap(SimpleEntry::getKey, SimpleEntry::getValue));
.collect(Collectors.toMap(e -> e.getKey(), e -> e.getValue()));

/**
* Maps supported event classes to mixin classes with Jackson annotations.
Expand Down Expand Up @@ -153,7 +154,7 @@ public class LambdaEventSerializers {
SQSEventMixin.class),
new SimpleEntry<>("com.amazonaws.services.lambda.runtime.events.SQSEvent$SQSMessage",
SQSEventMixin.SQSMessageMixin.class))
.collect(Collectors.toMap(SimpleEntry::getKey, SimpleEntry::getValue));
.collect(Collectors.toMap(e -> e.getKey(), e -> e.getValue()));

/**
* If mixins are required for inner classes of an event, then those nested classes must be specified here.
Expand Down Expand Up @@ -208,19 +209,19 @@ public class LambdaEventSerializers {
new SimpleEntry<>("com.amazonaws.services.lambda.runtime.events.SQSEvent",
Arrays.asList(
new NestedClass("com.amazonaws.services.lambda.runtime.events.SQSEvent$SQSMessage"))))
.collect(Collectors.toMap(SimpleEntry::getKey, SimpleEntry::getValue));
.collect(Collectors.toMap(e -> e.getKey(), e -> e.getValue()));

/**
* If event requires a naming strategy. For example, when someone names the getter method getSNS and the setter
* method setSns, for some magical reasons, using both mixins and a naming strategy works
*/
private static final Map<String, PropertyNamingStrategy> NAMING_STRATEGY_MAP = Stream.of(
new SimpleEntry<>("com.amazonaws.services.lambda.runtime.events.SNSEvent",
new PropertyNamingStrategy.PascalCaseStrategy()),
new PropertyNamingStrategies.UpperCamelCaseStrategy()),
new SimpleEntry<>("com.amazonaws.services.lambda.runtime.events.ConnectEvent$Queue",
new PropertyNamingStrategy.PascalCaseStrategy())
new PropertyNamingStrategies.UpperCamelCaseStrategy())
)
.collect(Collectors.toMap(SimpleEntry::getKey, SimpleEntry::getValue));
.collect(Collectors.toMap(e -> e.getKey(), e -> e.getValue()));

/**
* Returns whether the class name is a Lambda supported event model.
Expand Down