Json5.decode
You're seeing just the function
decode
, go back to Json5 module for more information.
parse json5 input as elixir type.
To keep the precision of the given numbers the integers and floats are cast to Decimal
options:
- object_key_function: (binary) -> any
- use given function to format the object key
- object_key_existing_atom: boolean
- format the object key with
String.to_existing_atom/1
- format the object key with
- object_key_atom: boolean
- format the object key with
String.to_atom/1
- if none of the above options are set return the key as a binary (String.t())
- format the object key with
- object_new_function: ({any, any}) -> any
- function to create a map from the list of parsed tuples, by default uses
Map.new/1
- function to create a map from the list of parsed tuples, by default uses
iex> Json5.decode("{array: [1, 2, 3], map: {'null': null, test: 1, }, }")
{:ok, %{
"map" => %{
"test" => Decimal.new(1),
"null" => nil
},
"array" => [
Decimal.new(1),
Decimal.new(2),
Decimal.new(3)
]
}}