Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Custom Validator with dependent fields. #245

Open
stefanm8 opened this issue Mar 21, 2024 · 1 comment
Open

Feature Request: Custom Validator with dependent fields. #245

stefanm8 opened this issue Mar 21, 2024 · 1 comment

Comments

@stefanm8
Copy link

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.

@tide-jamiegwatkin
Copy link

We're looking for something like this and it doesn't look supported which probably means we can't use Yamale.

Our use case is we have a database engine time and an instances type, some databases only support some instances but we can't verify the instance_type without knowing the database engine type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants