Yamale icon indicating copy to clipboard operation
Yamale copied to clipboard

Feature Request: Custom Validator with dependent fields.

Open stefanm8 opened this issue 3 months ago • 0 comments

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

  • You can achieve this kind of functionality via a wrapper, but I find it harder to maintain.

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

stefanm8 avatar Mar 21 '24 00:03 stefanm8