Posts

Showing posts with the label jackson-databind

Forcing Jackson to deserialize specific property to specific primitive type

Image
Clash Royale CLAN TAG #URR8PPP Forcing Jackson to deserialize specific property to specific primitive type I'm using jackson 2.9.6 I have a object that I want to serialize and Deserialize. Here is a class Post jackson 2.9.6 Post Post.java public class Post { private Long id; private String name; private int count; private List<Comment> commentList; // Getter and setter } public class Comment{ private Long id; private String text; private int count; // Getter and setter } JSON Data { "id" : 123, "name" : "azeem", "count" : 1 "commentList" : [ { "id" : 312, "text" : "simple comment", "count" : 3 }, { "id" : 31221231231231, "text" : "simple comment 2", "count" : 1 } ] }, "id"...