Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any way to not escape the quotes #165

Open
funston opened this issue May 16, 2020 · 2 comments
Open

Any way to not escape the quotes #165

funston opened this issue May 16, 2020 · 2 comments

Comments

@funston
Copy link

funston commented May 16, 2020

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\"}
@dakrone
Copy link
Owner

dakrone commented May 18, 2020

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

@davidsierradz
Copy link

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\"}"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants