Closed
Description
It would be nice for jiffy to support Elixir, namely the way null/nil is handled. Currently it's not ideal:
iex(1)> :jiffy.encode %{results: nil}
"{\"results\":\"nil\"}"
iex(2)> :jiffy.decode "{\"results\":null}", [:return_maps]
%{"results" => :null}
When encoding, a nil
atom should be turned into a JSON null, not a "nil" string as in the current implementation. Likewise, decoding a JSON null should result in a nil
atom, not null
. I'm not sure about the best way to handle this, but perhaps some option like use_nil_for_null
could be added so jiffy can be painlessly used from Elixir :)
Metadata
Metadata
Assignees
Labels
No labels