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
Copy file name to clipboardExpand all lines: docs/utilities/serialization.md
+238-1Lines changed: 238 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,244 @@ title: Serialization Utilities
3
3
description: Utility
4
4
---
5
5
6
-
This module contains a set of utilities you may use in your Lambda functions, mainly associated with other modules like [validation](validation.md) and [idempotency](idempotency.md), to manipulate JSON.
6
+
This module contains a set of utilities you may use in your Lambda functions, to manipulate JSON.
7
+
8
+
## Easy deserialization
9
+
10
+
### Key features
11
+
12
+
* Easily deserialize the main content of an event (for example, the body of an API Gateway event)
13
+
* 15+ built-in events (see the [list below](#built-in-events))
14
+
15
+
### Getting started
16
+
17
+
18
+
=== "Maven"
19
+
20
+
```xml hl_lines="5"
21
+
<dependencies>
22
+
...
23
+
<dependency>
24
+
<groupId>software.amazon.lambda</groupId>
25
+
<artifactId>powertools-serialization</artifactId>
26
+
<version>{{ powertools.version }}</version>
27
+
</dependency>
28
+
...
29
+
</dependencies>
30
+
```
31
+
32
+
### EventDeserializer
33
+
34
+
The `EventDeserializer` can be used to extract the main part of an event (body, message, records) and deserialize it from JSON to your desired type.
35
+
36
+
It can handle single elements like the body of an API Gateway event:
In the background, `EventDeserializer` is using Jackson. The `ObjectMapper` is configured in `JsonConfig`. You can customize the configuration of the mapper if needed:
222
+
`JsonConfig.get().getObjectMapper()`. Using this feature, you don't need to add Jackson to your project and create another instance of `ObjectMapper`.
0 commit comments