View Source ndto_parser_json_schema behaviour (ndto v0.3.1)
ndto
interface for parsing JSON Schemas.
Summary
Types
A parser is a module that implements the
ndto_parser_json_schema
behaviour.Functions
Parses a JSONSchema specification into a list of
ndto:schema()
values.Types
Callbacks
-callback parse(Spec, CTX) -> Result when Spec :: spec(), CTX :: ctx(), Result :: {Schema, ExtraSchemas, NewCTX}, Schema :: ndto:schema(), ExtraSchemas :: [{ndto:name(), ndto:schema()}], NewCTX :: ctx().
Functions
-spec parse(SpecPath, Opts) -> Result when SpecPath :: file:filename_all(), Opts :: opts(), Result :: {ok, Schemas} | {error, Reason}, Schemas :: [{ndto:name(), ndto:schema()}], Reason :: term().
ndto:schema()
values.
-spec parse_spec(SpecPath) -> Result when SpecPath :: binary(), Result :: {ok, Spec} | {error, Reason}, Spec :: ndto_parser:spec(), Reason :: term().
-spec resolve_ref(Ref, CTX) -> Result when Ref :: binary(), CTX :: ctx(), Result :: {NewResolved, NewSchema, NewCTX}, NewResolved :: binary(), NewSchema :: ndto:schema(), NewCTX :: ctx().