Skip to content

Sensible default handling for tuples #70

@menih

Description

@menih

Consider the following

1> Tuple = {{key, value}, { key2, {key3, [value1, 2,3]}}}.
{{key,value},{key2,{key3,[value1,2,3]}}}

Produces:

2> jsone:encode(Tuple).
** exception error: bad argument
in function jsone_encode:value/4
called as jsone_encode:value({{key,value},{key2,{key3,[value1,2,3]}}},
[],<<>>,
{encode_opt_v2,false,false,false,
[{scientific,20}],
{iso8601,0},
string,0,0,false,false,undefined})
in call from jsone:encode/2 (jsone.erl, line 382)

I think we should have a sensible default in these cases. Here is one suggestion:

{"key":"value", "key2, {"key3":["value1", 2,3]}}

How would one be able to pass on hints on how to handle certain conversion when default fails?

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