Skip to content

Addition of atom conversion via r2j_type:unsafe_atom/0

Compare
Choose a tag to compare
@lordnull lordnull released this 01 Mar 05:39
· 33 commits to master since this release

As far as this project is concerned, adding a type conversion bundled with the library is enough to bump the 'feature' part of semvar.

The type atom() is not supported because a primary use case for rec2json is to convert untrusted data, such as an http post request. Converting untrusted data into atoms can exhaust the erlang vm's atom table, or worse exhaust the machine's memory. Rec2json is, by default, safe.

It is still possilbe to apply a type to a record field so that json strings will be converted to the equivalent atom using either a user defined type, or the new provied r2j_type:unsafe_atom() type.