erlangbureau / liver Goto Github PK
View Code? Open in Web Editor NEWLightweight Erlang validator based on LIVR specification
License: MIT License
Lightweight Erlang validator based on LIVR specification
License: MIT License
{deps, [
{liver, ".*",
{git, "https://github.com/erlangbureau/liver.git", {branch, 0.9.0}}
}
]}.
it should be
{deps, [
{liver, ".*",
{git, "https://github.com/erlangbureau/liver.git", {branch, "0.9.0"}}
}
]}.
Missing quotes around the branch version number.
Is liver supporting unicode characters ?
I have made a simple test which shows there might be an issue in the validators when unicode characters are used.
Example:
11> Schema1 = [{<<"first_name">>,[{length_between,[4,6]}]}].
[{<<"first_name">>,[{length_between,[4,6]}]}]
12> Input5 = [{<<"first_name">>,<<"Grego">>}].
[{<<"first_name">>,<<"Grego">>}]
13> liver:validate(Schema1, Input5).
{ok,[{<<"first_name">>,<<"Grego">>}]}
14> Input6 = [{<<"first_name">>,<<"Grégo">>}].
[{<<"first_name">>,<<"Grégo">>}]
15> liver:validate(Schema1, Input6).
{error,[{<<"first_name">>,<<"FORMAT_ERROR">>}]}
The only difference between Input5 and Input6 is the é
character used in the first_name of Input6 compared to the first_name of Input5.
Or maybe I'm doing something wrong (I'm rather new to erlang). In this case, sorry for bothering you.
Hi,
I'm trying to validate a boolean input like this:
liver:validate([{<<"test">>, [string, is_boolean]}], [{<<"test">>, <<"false">>}]).
liver:validate([{<<"test">>, [string, is_boolean]}], [{<<"test">>, 1}])
liver:validate([{<<"test">>, [string, is_boolean]}], [{<<"test">>, <<"0">>}]).
liver:validate([{<<"test">>, [string, is_boolean]}], [{<<"test">>, <<"false">>}], [{strict, true}]).
liver:validate([{<<"test">>, [string, is_boolean]}], [{<<"test">>, <<"off">>}], [{strict, true}]).
but the result is invariably:
{error,[{<<"test">>,not_boolean}]}
Am I doing something wrong?
Hello, would you like to add Cyrillic support to email and url pattern?
Hi at all,
I'm trying to use liver
in my rebar3
project.
I made a commit to make the project compatible with rebar3.
If you are interested, we can work together to integrate in your repo. 😄
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.