Fork me on GitHub
#malli
<
2023-03-22
>
cap10morgan19:03:14

Still curious if anyone can help me out w/ attaching custom encoders / decoders to schema in the transformer? https://clojurians.slack.com/archives/CLDK6MFMK/p1679331018221749 I need to do it in the transformer and not in the schema def b/c it has to close over a value I'm passing to a fn that creates the transformer. But my ::custom-schema encoders / decoders are never called. Built-in things like :string work, but not my custom ones. How does encoder / decoder dispatch work w/ the map keys you pass to a transformer in the :encoders / :decoders values?

cap10morgan19:03:15

worked around this by writing a different function that merges my closure value directly into the registry instead. kinda clunky but I can't figure out how the decoder / encoder dispatch works to the :decoders / :encoders maps in the transformer itself for custom schemas.