-
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
Docs on default functions should mention risk of undefined arguments #6265
Comments
Can you please provide an example of this case? |
Sure: package p
default x(_) := "default"
x_is := x(input.undefined) $ opa eval -f pretty -d p.rego data.p.x_is
undefined The root cause being the same as described in #1877, but now in one more place where people likely/rightly would share the same expectation. Fixing anything would be great, but also breaking. So, clearly documenting the behavior here seems like the best course of action now. |
anderseknert
added a commit
to anderseknert/opa
that referenced
this issue
Jun 10, 2024
Fixes open-policy-agent#6265 Signed-off-by: Anders Eknert <anders@styra.com>
anderseknert
added a commit
that referenced
this issue
Jun 11, 2024
Fixes #6265 Signed-off-by: Anders Eknert <anders@styra.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The docs on the default keyword describes the new default function feature like:
That's not really the case though, as default functions provides no guarantess as for evaluating in case an undefined attribute is provided in any of the arguments passed. This is likely not what most would expect from having used default values for rules, so provided this can't be fixed it needs to be clearly documented that default functions provide no guarantees similar to default rules.
The text was updated successfully, but these errors were encountered: