View Source parthenon_decode (parthenon v0.9.0)
Link to this section Summary
Types
API
Link to this section Types
-type array() :: [value()].
-type decode_options() :: #decode_options{}.
-type key_format() :: existing_atom | atom | binary.
-type key_type() :: binary() | atom().
-type next() :: {object, Key :: binary(), object(), schema(), decode_options()} | {list, array(), schema(), decode_options()}.
-type object_format() :: maps | proplists | tuple.
-type option() :: {object_format, object_format()} | {key_format, key_format()} | {schema_options, [{null_as, atom() | binary()}]}.
-type schema() :: parthenon_schema:schema().
-type schema_options() :: #schema_options{}.
-type whitespace_next() :: {object_key, object(), schema(), decode_options()} | {object_value, Key :: binary(), object(), schema(), decode_options()} | {list, array(), schema(), decode_options()}.
Link to this section Functions
-spec try_decode(SchemaName :: atom(), Binary :: binary()) -> {ok, value()} | {error, term()}.