borer icon indicating copy to clipboard operation
borer copied to clipboard

Scalar types (Int, Long, Float, Double, Boolean) as map keys

Open OndrejSpanel opened this issue 5 years ago • 3 comments

Scalar types cannot be used as map keys when serializing to JSON, which I find inconvenient (I think Circe allows this). Quoting them as strings should be trivial. If you are not opposed to the idea, I can try preparing a PR.

OndrejSpanel avatar Nov 11 '20 10:11 OndrejSpanel

hmm... yes, I think there is no real risk in allowing for non-string, simple types as map keys, which get converted to their default toString results at the lowest-possible level. The only change required would be in the JsonRenderer (plus a few extra test cases).

Sure, I'd be happy to merge your PR here, thank you!

sirthias avatar Nov 11 '20 10:11 sirthias