Module jesse_json_path

Implementation of Key Value Coding style "queries" for commonly used Erlang data structures.

Copyright © 2011 Bob Ippolito

Authors: Bob Ippolito (bob@redivi.com).

Description

Implementation of Key Value Coding style "queries" for commonly used Erlang data structures.

Data Types

kvc_key()

kvc_key() = binary() | atom() | string()

kvc_obj()

kvc_obj() = kvc_obj_node() | [kvc_obj_node()] | list()

kvc_obj_node()

kvc_obj_node() = proplist() | {struct, proplist()} | [{}] | dict:dict() | gb_trees:tree() | map() | term()

proplist()

proplist() = [{kvc_key(), kvc_obj()}]

Function Index

parse/1Parse a JSON Pointer.
path/2Return the result of the query Path on P.
path/3
to_proplist/1Normalize P to nested proplists.
unwrap_value/1Unwrap data (remove mochijson2 and jiffy specific constructions, and also handle jsx empty objects).
value/3Return the immediate result of the query for key K in P.

Function Details

parse/1

parse(JSONPointer::string() | binary()) -> [binary()]

Parse a JSON Pointer

path/2

path(Path::kvc_key() | [kvc_key()], P::kvc_obj()) -> term() | []

Return the result of the query Path on P.

path/3

path(Path::kvc_key() | [kvc_key()], P::kvc_obj(), Default::term()) -> term()

to_proplist/1

to_proplist(P::kvc_obj()) -> kvc_obj()

Normalize P to nested proplists.

unwrap_value/1

unwrap_value(Map::kvc_obj()) -> kvc_obj()

Unwrap data (remove mochijson2 and jiffy specific constructions, and also handle jsx empty objects)

value/3

value(K::kvc_key(), P::kvc_obj(), Default::term()) -> term()

Return the immediate result of the query for key K in P.


Generated by EDoc