File tree Expand file tree Collapse file tree 4 files changed +10
-3
lines changed
main/java/io/intercom/api
test/java/io/intercom/api Expand file tree Collapse file tree 4 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -58,6 +58,7 @@ public static AdminCollection list()
5858 public Admin () {
5959 }
6060
61+ @ JsonIgnore
6162 public String getReplyType () {
6263 return getType () + "_reply" ;
6364 }
Original file line number Diff line number Diff line change 11package io .intercom .api ;
22
33
4+ import com .fasterxml .jackson .annotation .JsonIgnore ;
45import com .fasterxml .jackson .annotation .JsonIgnoreProperties ;
56import com .fasterxml .jackson .annotation .JsonInclude ;
67import com .fasterxml .jackson .annotation .JsonProperty ;
@@ -107,6 +108,7 @@ static UserUpdate buildFrom(User user) {
107108 }
108109
109110 @ JsonProperty ("type" )
111+ @ JsonInclude (JsonInclude .Include .ALWAYS )
110112 private final String type = "user" ;
111113
112114 @ JsonProperty ("id" )
@@ -232,6 +234,7 @@ public Boolean isNewSession() {
232234 }
233235
234236 @ JsonProperty ("type" )
237+ @ JsonInclude (JsonInclude .Include .ALWAYS )
235238 private final String type = "user" ;
236239
237240 @ JsonProperty ("id" )
@@ -316,6 +319,7 @@ boolean isUntag() {
316319 return untag == null ? false : untag ;
317320 }
318321
322+ @ JsonIgnore
319323 public String getReplyType () {
320324 return getType () + "_reply" ;
321325 }
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ public class UserMessage extends TypedData {
1616 private final String type = "user_message" ;
1717
1818 @ JsonProperty ("message_type" )
19- private final String messageType = "inapp" ;
19+ private String messageType ;
2020
2121 @ JsonProperty ("id" )
2222 private String id ;
Original file line number Diff line number Diff line change @@ -56,10 +56,11 @@ public void TestUserIncludesId() throws Exception {
5656 user .setId ("5432" );
5757 final String json = mapper .writeValueAsString (user );
5858 final Map map = mapper .readValue (json , Map .class );
59- assertTrue (map .size () == 3 );
59+ assertTrue (map .size () == 4 );
6060 assertTrue (map .containsKey ("email" ));
6161 assertTrue (map .containsKey ("user_id" ));
6262 assertTrue (map .containsKey ("id" ));
63+ assertTrue (map .containsKey ("type" ));
6364 }
6465
6566 @ Test
@@ -69,9 +70,10 @@ public void TestUserSerdesNullAndNotEmpty() throws Exception {
6970 user .setUserId ("1" );
7071 final String json = mapper .writeValueAsString (user );
7172 final Map map = mapper .readValue (json , Map .class );
72- assertTrue (map .size () == 2 );
73+ assertTrue (map .size () == 3 );
7374 assertTrue (map .containsKey ("email" ));
7475 assertTrue (map .containsKey ("user_id" ));
76+ assertTrue (map .containsKey ("type" ));
7577 }
7678
7779 @ Test
You can’t perform that action at this time.
0 commit comments