Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
kostiushkin authored Dec 11, 2017
1 parent ab90fe8 commit 43709b6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ Simple example:

More complex example:
```erl
1> Schema = #{
7> Schema = #{
<<"address">> => [required, {nested_object, #{
<<"country">> => [required,{one_of,[[<<"Ukraine">>,<<"USA">>]]}],
<<"zip">> => positive_integer,
Expand All @@ -86,7 +86,7 @@ More complex example:
}}]
}.

2> Input = #{
8> Input = #{
<<"address">> => #{
<<"country">> => <<"Ukraine">>,
<<"zip">> => <<"12345">>,
Expand All @@ -97,7 +97,7 @@ More complex example:
<<"extra_field">> => <<"will be removed">>
}.

3> liver:validate(Schema, Input).
9> liver:validate(Schema, Input).
{ok,#{<<"address">> => #{<<"building">> => 10,
<<"country">> => <<"Ukraine">>,
<<"street">> => <<"10">>,
Expand All @@ -106,7 +106,7 @@ More complex example:

Strict validation:
```erl
4> liver:validate(Schema, Input, [{strict, true}]).
10> liver:validate(Schema, Input, [{strict, true}]).
{error,#{<<"address">> => #{<<"extra_field">> => <<"UNKNOWN_FIELD">>},
<<"extra_field">> => <<"UNKNOWN_FIELD">>}}
```

0 comments on commit 43709b6

Please sign in to comment.