23andMe / Yamale

A schema and validator for YAML.
MIT License
666 stars 88 forks source link

Feature Request: Custom Validator with dependent fields. #245

Open stefanm8 opened 5 months ago

stefanm8 commented 5 months ago

Objective

Pass entire object to Custom Validator method _is_valid e.g _is_valid(self, value, root)

Example

You may encounter the use case as such

/document.yaml

owner: "turtle"
members: ["turtle", "cat"]

You may want to validate that the turtle is not part of members since he is already the owner, thus is implicit a member.

Alternatives

PS: I can look into this if this feature is desirable.