A small, dependency-free JSON encoder/decoder.
This exists because synctera ships with zero runtime dependencies (see
the "Design notes" section of the README) — it does not require callers to
bring Jason or any other JSON library. It decodes objects into maps with
string keys (never atoms, to avoid unbounded atom-table growth from
server-controlled data), and encodes maps, lists, and the usual scalar
types.
Not a general-purpose replacement for Jason — it covers exactly what the Synctera API's JSON needs (UTF-8 text, standard escapes, RFC 8259 numbers) and nothing more.
Summary
Types
Functions
Decodes a JSON binary. Objects become maps with binary (string) keys.
Like decode/1 but raises on error.
@spec encode(term()) :: {:ok, binary()} | {:error, Exception.t()}
Encodes an Elixir term to a JSON binary. Map keys may be atoms or binaries.
Like encode/1 but raises on error.