This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-12-25
Channels
This is more jsonista related, but does anyone know how to write a custom map serializer for Jackson?
Does the tagged json help? https://github.com/metosin/jsonista/blob/master/src/clj/jsonista/tagged.clj
I'm not sure going this way would be most performant:
(doseq [e es] (.writeRawValue gen (.writeValueAsString mapper e)))
The map serializer does lookup for the correct value typeThings I've tried: • Extending StdSerializer • Extending MapSerializer (has a ton of constructor arguments I couldn't get right) • Use SerializationModifier for MapSerializer, didn't get that right, either
This all starts with this code path which serialization of maps ends up on https://github.com/FasterXML/jackson-databind/blob/2.15/src/main/java/com/fasterxml/jackson/databind/ser/std/MapSerializer.java#L774 I want to use kvreduce instead