Welcome! Please see the About page for a little more info on how this works.
Hello
I'm new to Clojure and didn't find answer so please sorry if this is not issue at all.
lets say we have data:
{:space1/value 123 :space2/value 456}
and use clojure.data.json as serialiser:
clojure.data.json
(clojure.data.json/write-str {:space1/value 123 :space2/value 456}) => "{\"value\":123,\"value\":456}"
As you see result is not what one can expect. Obvious solution would be to provide own key-fn and forget about it. But I spend a lot of time catching bug caused by default implementation and like to save time of other
key-fn
The documentation is clear on why it happens:
:key-fn function Single-argument function called on map keys; return value will replace the property names in the output. Must return a string. Default calls clojure.core/name on symbols and keywords and clojure.core/str on everything else.
It cannot be changed post factum because it would break existing code.