mirror of
https://github.com/valitydev/jesse.git
synced 2024-11-06 09:35:23 +00:00
Add documentation for Schema and Data
This commit is contained in:
parent
677f039055
commit
4a20bd8bd0
@ -153,7 +153,7 @@ validate(Schema, Data) ->
|
||||
%% @doc Validates json `Data' against a schema with the same key as `Schema'
|
||||
%% in the internal storage, using `Options'. If the given json is valid,
|
||||
%% then it is returned to the caller, otherwise an error with an appropriate
|
||||
%% error reason is returned. If `parser_fun' option is provided, then
|
||||
%% error reason is returned. If the `parser_fun' option is provided, then
|
||||
%% `Data' is considered to be a binary string, so `parser_fun' is used
|
||||
%% to convert the binary string to a supported internal representation of json.
|
||||
%% If `parser_fun' is not provided, then `Data' is considered to already be a
|
||||
@ -184,12 +184,12 @@ validate_with_schema(Schema, Data) ->
|
||||
|
||||
%% @doc Validates json `Data' agains the given schema `Schema', using `Options'.
|
||||
%% If the given json is valid, then it is returned to the caller, otherwise
|
||||
%% an error with an appropriate error reason is returned. If `parser_fun' option
|
||||
%% is provided, then `Data' is considered to be a binary string, so
|
||||
%% `parser_fun' is used to convert the binary string to a supported internal
|
||||
%% representation of json.
|
||||
%% If `parser_fun' is not provided, then `Data' is considered to already be a
|
||||
%% an error with an appropriate error reason is returned. If the `parser_fun'
|
||||
%% option is provided, then both `Schema' and `Data' are considered to be a
|
||||
%% binary string, so `parser_fun' is used to convert both binary strings to a
|
||||
%% supported internal representation of json.
|
||||
%% If `parser_fun' is not provided, then both `Schema' and `Data' are considered
|
||||
%% to already be a supported internal representation of json.
|
||||
-spec validate_with_schema( Schema :: json_term() | binary()
|
||||
, Data :: json_term() | binary()
|
||||
, Options :: [{Key :: atom(), Data :: any()}]
|
||||
|
Loading…
Reference in New Issue
Block a user