We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ccc07e5 commit 7b57a59Copy full SHA for 7b57a59
migration-from-gson.md
@@ -4,3 +4,26 @@ title: How to extend
4
---
5
6
# Migration from gson
7
+
8
+Jsoniter support gson annotation, migrating from gson to jsoniter should be easy.
9
10
+```
11
+public static class TestObject {
12
+ @Expose(deserialize = false)
13
+ public String field1;
14
+}
15
16
+Gson gson = new GsonBuilder()
17
+ .excludeFieldsWithoutExposeAnnotation()
18
+ .create();
19
+TestObject obj = gson.fromJson("{\"field1\":\"hello\"}", TestObject.class);
20
21
22
+will be
23
24
25
+GsonCompatibilityMode config = new GsonCompatibilityMode.Builder()
26
27
+ .build();
28
+TestObject obj = JsonIterator.deserialize(config, "{\"field1\":\"hello\"}", TestObject.class);
29
0 commit comments