[erlang-questions] No JSON/MAPS interoperability in 17.0?
Sat Mar 8 14:42:49 CET 2014
It is true that different applications may need different mappings of the JSON data model into the data model of the specific application, but the following is not a valid reason:
On 08 Mar 2014, at 13:14, Jesper Louis Andersen <jesper.louis.andersen@REDACTED> wrote:
> And to make things worse, there are small fluctuations in the "standard" which make it hard to create proper support. Adding a `json` module to the standard library is asking for jumping into this minefield.
The “standard” has been stable since RFC 4627, which was published in July 2006.
Apart from the question whether one should accept top-level numbers/primitives/strings (and it is easy for an application to follow the Postel principle here: be liberal in what you accept and conservative in what you send), there has been no “fluctuation” in JSON.
With the acceptance of UTF-8 strings (“binaries”) into the Erlang world, there is a straightforward mapping of JSON data into the Erlang model.
Mapping back may require a bit more application knowledge (e.g., how do you encode non-JSON concepts such as atoms?), but a basic mapping can easily be part of the standard library, certainly easier than for ASN.1 or XML.
More information about the erlang-questions