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: msgpack-jackson/README.md
+12Lines changed: 12 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -83,3 +83,15 @@ Java
83
83
// xs => [zero, 1, 2.0, null]
84
84
```
85
85
86
+
### Serialization format
87
+
88
+
By default, the serialization format is object, which means it includes the schema of the serialized entity (POJO).
89
+
To serialize an entity without the schema, only as array, you can add the annotation `@JsonFormat(shape=JsonFormat.Shape.ARRAY)` to the entity definition.
90
+
Also, it's possible to set the serialization format for the object mapper instance to be array by changing the annotation inspector of object mapper to `JsonArrayFormat`:
91
+
92
+
```
93
+
ObjectMapper objectMapper = new ObjectMapper(new MessagePackFactory());
0 commit comments