Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

An error of encoding array of tuples to json #157

Closed
ildarsharafutdinov opened this Issue · 1 comment

3 participants

@ildarsharafutdinov

The following code seems to produce wrong output

my_controller_fun([]) ->
    {json, [
        {"test", [ 
            {"x", "1"},
            {"y", "2"},
            {"z", "3"}
        ]}
    ]}.

I expect the following JSON output

{"test":[{"x":"1"},{"y":"2"},{"z":"3"}]}

Whereas I get

{"test":{"x":"1","y":"2","z":"3"}}

Is there a workaround?

@hummermania
my_controller_fun('GET',[]) ->
    {json, [
        {"test", [[
            {"x", "1"},
            {"y", "2"},
            {"z", "3"}
        ]]}
    ]}.

This is work properly.

@evanmiller evanmiller closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.