Json schema validation module.
This module is the core of jesse, it implements the validation functionality according to the standard.error() = {error, [error_reason()]}
error_reason() = {schema_invalid, Schema::jesse:json_term(), Error::error_type()} | {data_invalid, Schema::jesse:json_term(), Error::error_type(), Data::jesse:json_term(), Path::[binary()]} | {data_error, {parse_error, term()}} | {schema_error, {parse_error, term()}}
error_type() = atom() | {atom(), jesse:json_term()} | {atom(), binary()}
default_error_handler/3 | Implements the default error handler. |
handle_data_invalid/3 | Generates a new data error and returns the updated state. |
handle_schema_invalid/2 | Generates a new schema error and returns the updated state. |
reason_to_jsx/1 | Convert an error reason to jsx structs. |
to_json/1 | Convert an error to a JSON string using jsx. |
to_json/2 | Convert an error to a JSON string using jsx. |
default_error_handler(Error::error_reason(), ErrorList::[error_reason()], AllowedErrors::jesse:allowed_errors()) -> [error_reason()] | no_return()
Implements the default error handler.
If the length of ErrorList
exceeds AllowedErrors
then the function
throws an exeption, otherwise adds a new element to the list and returs it.
handle_data_invalid(Info::error_type(), Value::jesse:json_term(), State::jesse_state:state()) -> jesse_state:state()
Generates a new data error and returns the updated state.
handle_schema_invalid(Info::schema_invalid | error_type(), State::jesse_state:state()) -> jesse_state:state()
Generates a new schema error and returns the updated state.
reason_to_jsx(Reason::error_reason()) -> jesse:json_term()
Convert an error reason to jsx structs
to_json(Error::error()) -> binary()
Convert an error to a JSON string using jsx
to_json(Error::error(), JsxOptions::[atom()]) -> binary()
Convert an error to a JSON string using jsx
Generated by EDoc