Skip to content

[Question] How to pretty print? #41

Closed
@jordi-chacon

Description

@jordi-chacon

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions