jackson-databind icon indicating copy to clipboard operation
jackson-databind copied to clipboard

Pre-process Value or Easily Delegate to Default Deserializer

Open EarthCitizen opened this issue 2 years ago • 5 comments

I have a simple situation. The JSON I want to deserialize is in a base 64 encoded value. I need to decode the value, then let the default deserialization mechanisms take it the rest of the way. I see many people on Stackoverflow having the same need, but the solutions seem overly complicated for such a simple problem.

If there could be a value pre-processor that is separate from the deserialization process, and runs before deserialization is carried out, that would be amazing. And conversely, a post-processor would be it's counterpart to turn values back into base 64 after serialization.

In my case, I don't actually need any deserialization customization at all. Just converting from base 64. Needing to write a custom deserializer in this case seems to be overkill. But, I am not aware of any other way to do it.

If a pre-processor is not possible, then perhaps a way to easily call the default deserializer from the custom one. There does not seem to be a way to currently to this without the overly complex solutions presented in various Stackoverflow answers.

EarthCitizen avatar Oct 10 '21 01:10 EarthCitizen