You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
package play
import future.keywords
a contains b if { b :=1 }
x.y contains z if { z :=2 }
-->
{
"a": [
1
],
"x": {
"y": [
2
]
}
}
In a 0.x release of OPA, the future.strict import will be intrudoced, and will impose the same constraints on the module, which will hopefully aid in transitioning to OPA 1.0.
The text was updated successfully, but these errors were encountered:
This will however not solve the issue with no-body rules. E.g:
package play
a.b
x.y.x
which will produce:
{
"a": [
"b"
],
"x": {
"y": {
"x": true
}
}
}
Since the above rules don't have bodies, it's nonsensical to require the if keyword.
Is it possible to solve this without introducing a breaking change in OPA 1.0?
johanfylling
changed the title
Enforce use of if and contains in rule declarations
Enforce use of if and contains in rule declarations in OPA 1.0Oct 10, 2023
Currently it's, seemingly, arbitrary if a ref-head rule will produce a single-value or multi-value leaf:
will produce
All rules declared with
if
contribute to an object unlesscontains
is also used, though:-->
and:
-->
In a
0.x
release of OPA, thefuture.strict
import will be intrudoced, and will impose the same constraints on the module, which will hopefully aid in transitioning to OPA1.0
.The text was updated successfully, but these errors were encountered: