charred icon indicating copy to clipboard operation
charred copied to clipboard

exception on writing maps where a key is a map

Open flyingmachine opened this issue 1 year ago • 1 comments

This:

(charred.api/write-json-str {{:a :b} {:c :d}})

Results in this:

Execution error (CharredException) at charred.JSONWriter/writeMap (JSONWriter.java:189).
JSON encoding error - Map keys must be strings

My expectation is that {:a :b} would be stringified. It's not immediately obvious to me how to work around this

flyingmachine avatar Oct 14 '24 17:10 flyingmachine

Well that won't round trip -- but neither do keyword map keys -- I agree that it should apply str as opposed to exception.

cnuernber avatar Oct 15 '24 16:10 cnuernber