Jackon custom deserializer never called

This is the attribute on which I have used the @JsonDeserialize @Transient @JsonDeserialize(using = SharedUserDeserializer.class) private Set<UserVehicleMappingVO> sharedVehicle; public Set<UserVehicleMappingVO> getSharedVehicle() { ...
more »

2017-08-10 16:08 (2) Answers

Restrict JSON attributes for @RequestBody

This may be a simple task, but I couldn't find a way to do it. Basically, I need to disallow some parameters at the time of using @RequestBody annotation in my controller. Here is my model: @Data public class MyModel { private int id; private S...
more »

2017-08-09 10:08 (1) Answers

Jackson: Serialize null object as empty

I have huge json document and appropriate jaskson models that are mapped to that json. In some cases it is not possible to build the required json document with all object because some data does not exist. for instance I have following models: clas...
more »

2017-08-08 12:08 (1) Answers

How to intercept Jackson JsonNodes deserialization

In my programm I'm doing: private static final ObjectMapper MAPPER = new GridJettyObjectMapper(); .... JsonNode node = MAPPER.readTree(content); My JSON contains a lot of SAME strings and I would like intercept readTree() method and put into TextN...
more »

2017-08-07 20:08 (1) Answers

Jackson stream parser position

I am building a tool to parse huge JSON around 1GB. In that logic, I am creating JsonParser object keep reading till it reaches expected JsonToken. Now I create another JsonParser(called child), which should be starting from previous JsonParser token...
more »

2017-08-06 22:08 (1) Answers

Android Build Error: DuplicateFileException

In my newly created Android project, I make use of the Jackson JSON/XML parser library. The problem is, when trying to build. I get this exception: Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'. > com.android.b...
more »

2017-08-05 19:08 (1) Answers

Can't generate json with named root element

I have a some code with next layers: @JsonRootName("users") @Entity @Table(name = "users") public class User { @Id @GeneratedValue(strategy= GenerationType.AUTO) @Column(name = "id") private Integer id; @Column(name = "first_name") ...
more »

2017-08-05 18:08 (2) Answers