# Reusing atomized JSON binary keys

**URL:** <https://forum.elixirforum.com/t/reusing-atomized-json-binary-keys/48969>\
**Category:** Questions\
**Tags:** json, strings, atoms\
**Created:** [July 15, 2022, 9:19pm UTC](https://forum.elixirforum.com/t/reusing-atomized-json-binary-keys/48969 "2022-07-15T21:19:35Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Maxximiliann](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/maxximiliann/32/21346_2.png) [@Maxximiliann](https://forum.elixirforum.com/u/Maxximiliann)\
**Post date:** [July 15, 2022, 10:35pm UTC](https://forum.elixirforum.com/t/reusing-atomized-json-binary-keys/48969/3 "2022-07-15T22:35:29Z")

</div>

> [@al2o3cr](#):
>
> The error message here should be helpful - on OTP 25, it is explicit about what string failed

Per your suggestion I made the following update:

```elixir

  def decode(raw_json) do
    try do
      Jason.decode(raw_json, keys: :atoms!)
    rescue
      error ->
        IO.inspect(error, limit: :infinity)
        IO.puts("Converting JSON keys to atoms . . . ")
        naive_string_to_atom(raw_json)
        main()
    end
  end

```

Outcome:

```elixir
Erlang/OTP 25 [erts-13.0.3] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [jit:ns]
Interactive Elixir (1.13.4) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> ProofOfConcept.main

%ArgumentError{
  message: "errors were found at the given arguments:\n\n * 1st argument: not an already existing atom\n"
}

Converting JSON keys to atoms . . . 
[:firstPrice_brln, :firstPrice_btc, :firstPrice_cnyn, :firstPrice_eth,
 :firstPrice_eurn, :firstPrice_gbpn, :firstPrice_jpyn, :firstPrice_ngnn,
 :firstPrice_rubn, :firstPrice_tryn, :firstPrice_uahn, :"firstPrice_usd-n",
 :firstPrice_waves, :lastPrice_brln, :lastPrice_btc, :lastPrice_cnyn,
 :lastPrice_eth, :lastPrice_eurn, :lastPrice_gbpn, :lastPrice_jpyn,
 :lastPrice_ngnn, :lastPrice_rubn, :lastPrice_tryn, :lastPrice_uahn,
 :"lastPrice_usd-n", :lastPrice_waves, :"24h_vol_brln", :"24h_vol_btc",
 :"24h_vol_cnyn", :"24h_vol_eth", :"24h_vol_eurn", :"24h_vol_gbpn",
 :"24h_vol_jpyn", :"24h_vol_ngnn", :"24h_vol_rubn", :"24h_vol_tryn",
 :"24h_vol_uahn", :"24h_vol_usd-n", :"24h_vol_waves", :circulating, :data,
 :excludedFromCirculating, :id, :name, :precision, :sender, :shortcode, :start,
 :totalSupply, :trades, :website]

```

It seems it’s trying to atomize new lines? Am I reading this right?

---

_[View the full topic](https://forum.elixirforum.com/t/reusing-atomized-json-binary-keys/48969)._
