cheshire
cheshire copied to clipboard
Any way to not escape the quotes
When the quotes are escapes, there are problems where some services are taking the string and double escaping it making decoding in difficult. For example, json.dumps in python won't add the "
Is there an option to support that here, ie
{"foo":"bar"}
instead of
{\"foo\":\"bar\"}
It doesn't appear that there is a way to do this, see the available feature flags here: https://fasterxml.github.io/jackson-core/javadoc/2.10/com/fasterxml/jackson/core/JsonParser.Feature.html
This works for me (print to stdout instead of returning):
#!/usr/bin/env bb
(do (println (json/generate-string {:foo "bar", :baz 5}))
(json/generate-string {:foo "bar", :baz 5}))
$ bb test.clj
> {"baz":5,"foo":"bar"}
> "{\"baz\":5,\"foo\":\"bar\"}"