View Source ndto_parser behaviour (ndto v0.3.1)
ndto
interface and behaviour for schema parsers.
Summary
Functions
Equivalent to parse(Parser, SpecPath, #{}).
Parses a schema specification into a
ndto:schema()
using the given parser.Types
Callbacks
-callback parse(SpecPath, Opts) -> Result when SpecPath :: file:filename_all(), Opts :: map(), Result :: {ok, Schemas} | {error, Reason}, Schemas :: [{ndto:name(), ndto:schema()}], Reason :: term().
Functions
-spec parse(Parser, SpecPath) -> Result when Parser :: t(), SpecPath :: file:filename_all(), Result :: {ok, Schemas} | {error, Reason}, Schemas :: [{ndto:name(), ndto:schema()}], Reason :: term().
Equivalent to parse(Parser, SpecPath, #{}).
-spec parse(Parser, SpecPath, Opts) -> Result when Parser :: t(), SpecPath :: file:filename_all(), Opts :: map(), Result :: {ok, Schemas} | {error, Reason}, Schemas :: [{ndto:name(), ndto:schema()}], Reason :: term().
ndto:schema()
using the given parser.