williamthome / euneus

An incredibly flexible and performant JSON parser, generator and formatter in pure Erlang.
https://hex.pm/packages/euneus
Apache License 2.0
22 stars 2 forks source link

values => to_atom and keys => to_atom is not always applied #38

Closed michalmuskala closed 8 months ago

michalmuskala commented 8 months ago

Given the following call:

euneus:decode(<<"{\"key\\u0061\": \"value\\u0061\"}">>, #{values => to_atom, keys => to_atom}).

I'd expect to receive:

{ok,#{keya => valuea}}

Instead I receive:

{ok,#{<<"keya">> => <<"valuea">>}}

Without the spurious escapes it works correctly:

> euneus:decode(<<"{\"keya\": \"valuea\"}">>, #{values => to_atom, keys => to_atom}).
{ok,#{keya => valuea}}
williamthome commented 8 months ago

Nice catch, @michalmuskala! Fixed in v1.2.1. Thank you!