CSenshi / Validator

Easy-to-use, Highly Configurable Python Data Validator. Inspired by Laravel Validator
https://pypi.org/project/validator/
MIT License
46 stars 23 forks source link

Add rules interconnection #48

Closed bnMikheili closed 4 years ago

bnMikheili commented 4 years ago

Create new class RPV (RulePipeValidator), which is responsible for connecting rules with each other.

Example:

request = {"age": 23}
rule = {"age": "size:23"}
result = Validator(request, rule).validate() # False

request = {"age": 23}
rule = {"age": "integer|size:23"}
result = Validator(request, rule).validate() # True

Please see tests for rpv for more examples tests/test_rpv.py