Skip to content
Eric Pailleau edited this page Jul 21, 2017 · 23 revisions

Welcome to the jason wiki!

Preamble

jason was created initially to handle easily Erlang records from and to JSON.

Some important things are to be known before using jason. Please read carefully below chapters.

Keys and values handling

Keys

Keys, if no mode is set, or if {mode, struct} is used, are utf8 binaries. For all other modes, keys will be converted to atoms.

However, if key length is more than 255 characters, or containing utf8 characters and local Erlang release < 20.0, key will be kept or converted to binary. This will not be possible for {mode, record} for which key must be atoms, and will raise an error in such case. This case should be rare fortunately.

Values

Values, if no mode is set, or if {mode, struct} is used are utf8 binaries. For all other modes, values will be converted to string if printable, otherwise kept in utf8 binary.

Clone this wiki locally