JSON.Parser.Object (json v1.4.1) View Source

Implements a JSON Object Parser for Bitstring values

Link to this section Summary

Functions

parses a valid JSON object value, returns its elixir representation

Link to this section Functions

parses a valid JSON object value, returns its elixir representation

Examples

iex> JSON.Parser.Object.parse ""
{:error, :unexpected_end_of_buffer}

iex> JSON.Parser.Object.parse "face0ff"
{:error, {:unexpected_token, "face0ff"}}

iex> JSON.Parser.Object.parse "[] "
{:error, {:unexpected_token, "[] "}}

iex> JSON.Parser.Object.parse "[]"
{:error, {:unexpected_token, "[]"}}

iex> JSON.Parser.Object.parse "[\"foo\", 1, 2, 1.5] lala"
{:error, {:unexpected_token, "[\"foo\", 1, 2, 1.5] lala"}}

iex> JSON.Parser.Object.parse "{\"result\": \"this will be a elixir result\"} lalal"
{:ok, Enum.into([{"result", "this will be a elixir result"}], Map.new), " lalal"}