# Module jsone # * [Description](#description) * [Data Types](#types) * [Function Index](#index) * [Function Details](#functions) JSON decoding/encoding module. ## Data Types ## ### decode_option() ###
decode_option() = {object_format, tuple | proplist | map}
object_format:
encode_option() = native_utf8 | {space, non_neg_integer()} | {indent, non_neg_integer()}
`native_utf8`:
json_array() = [json_value()]
### json_boolean() ###
json_boolean() = boolean()
### json_number() ###
json_number() = number()
### json_object() ###
json_object() = json_object_format_tuple() | json_object_format_proplist() | json_object_format_map()
### json_object_format_map() ###
json_object_format_map() = #{}
### json_object_format_proplist() ###
json_object_format_proplist() = [{}] | json_object_members()
### json_object_format_tuple() ###
json_object_format_tuple() = {json_object_members()}
### json_object_members() ###
json_object_members() = [{json_string(), json_value()}]
### json_string() ###
json_string() = binary() | atom()
NOTE: `decode/1` always returns `binary()` value
### json_value() ###
json_value() = json_number() | json_string() | json_array() | json_object() | json_boolean() | null
## Function Index ##
decode/1 | Equivalent to decode(Json, []). |
decode/2 | Decodes an erlang term from json text (a utf8 encoded binary). |
encode/1 | Equivalent to encode(JsonValue, []). |
encode/2 | Encodes an erlang term into json text (a utf8 encoded binary). |
try_decode/1 | Equivalent to try_decode(Json, []). |
try_decode/2 | Decodes an erlang term from json text (a utf8 encoded binary). |
try_encode/1 | Equivalent to try_encode(JsonValue, []). |
try_encode/2 | Encodes an erlang term into json text (a utf8 encoded binary). |
decode(Json::binary()) -> json_value()
decode(Json::binary(), Options::[decode_option()]) -> json_value()
encode(JsonValue::json_value()) -> binary()
encode(JsonValue::json_value(), Options::[encode_option()]) -> binary()
try_decode(Json::binary()) -> {ok, json_value(), Remainings::binary()} | {error, {Reason::term(), [erlang:stack_item()]}}
try_decode(Json::binary(), Options::[decode_option()]) -> {ok, json_value(), Remainings::binary()} | {error, {Reason::term(), [erlang:stack_item()]}}
try_encode(JsonValue::json_value()) -> {ok, binary()} | {error, {Reason::term(), [erlang:stack_item()]}}
try_encode(JsonValue::json_value(), Options::[encode_option()]) -> {ok, binary()} | {error, {Reason::term(), [erlang:stack_item()]}}