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

[Question] How to pretty print? #41

Closed
jordi-chacon opened this issue Aug 23, 2015 · 2 comments
Closed

[Question] How to pretty print? #41

jordi-chacon opened this issue Aug 23, 2015 · 2 comments

Comments

@jordi-chacon
Copy link

Hi,

how can I use Poison.encode to pretty print a map?

I have been looking at the source code and I believe this should work, but it doesn't:

iex(1)> Poison.encode(%{"a"=>1, "b" => 2}, [pretty: true])    
{:ok, "{\"b\":2,\"a\":1}"}

Thank you!

@devinus
Copy link
Owner

devinus commented Aug 28, 2015

Poison.encode!(data, pretty: true)

@devinus devinus closed this as completed Aug 28, 2015
@KristerV
Copy link

This confusion is still an issue. So PR #193.

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