devinus / poison

An incredibly fast, pure Elixir JSON library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Parsing of raw ints

petevanwesep opened this issue · comments

As I understand it, a raw integer is valid JSON according to https://tools.ietf.org/html/rfc7159#section-2.

That being the case, I am interested in why this would result in a parsing error:

iex(1)> Poison.Parser.parse!(0)
0
** (ArgumentError) argument error
    :erlang.iolist_to_binary(0)
    (poison) lib/poison/parser.ex:35: Poison.Parser.parse/2
    (poison) lib/poison/parser.ex:52: Poison.Parser.parse!/2

A: Parsed JSON should be contained in a string 🙌