Skip to content

Module hb_json.erl

Wrapper for encoding and decoding JSON.

Description

Supports maps and Jiffy's old ejson format. This module abstracts the underlying JSON library, allowing us to switch between libraries as needed in the future.

Function Index

decode/1Takes a JSON string and decodes it into an Erlang term.
decode/2
encode/1Takes a term in Erlang's native form and encodes it as a JSON string.

Function Details

decode/1

decode(Bin) -> any()

Takes a JSON string and decodes it into an Erlang term.

decode/2

decode(Bin, Opts) -> any()

encode/1

encode(Term) -> any()

Takes a term in Erlang's native form and encodes it as a JSON string.