I am trying to write a custom JSON deserializer in Spring. I want to use default serializer for most part of fields and use a custom deserializer for few properties. Is it possible?
I am trying this way because, most part of properties are values, so for these I can let Jackson use default deserializer; but few properties are references, so in the custom deserializer I have to query a database for reference name and get reference value from database.
I’ll show some code if needed.
I’ve searched a lot and the best way I’ve found so far is on this article:
Class to serialize
Deserializer class
Edit:
Alternatively you can look at this article which uses new versions of com.fasterxml.jackson.databind.JsonDeserializer.