-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Document typical "for all" patterns #1307
Comments
@almostprogrammer See this example https://play.openpolicyagent.org/p/J0i0L5snjQ |
@almostprogrammer your solution is correct though you can omit the first expression ( The only other thing I'd change is to rename
The alternative that @ashutosh-narkar pointed out is to use negation (
Comprehensions and negation are the two typical ways of implementing "for all" inside Rego. There is a third way which involves using the
Note, this is a very common question and I don't think we have good coverage of it in the FAQ or cheat sheet. I'm going to edit the title an label the issue so that we can come back and fix the docs. |
This is a common question that comes up. Until we have a keyword that lets users express "FOR ALL" we should have docs we can point to. Fixes open-policy-agent#1307 Signed-off-by: Torin Sandall <torinsandall@gmail.com>
This is a common question that comes up. Until we have a keyword that lets users express "FOR ALL" we should have docs we can point to. Fixes #1307 Signed-off-by: Torin Sandall <torinsandall@gmail.com>
I cannot find in the docs how to validate every element of the array
So, now I'm using this trick as a temporary solution
The text was updated successfully, but these errors were encountered: