Using OPA REST API always returns "false" while command line and playground return "true" #59
-
Expected BehaviorThe results of API call should be the same command line or Playground Actual BehaviorAPI calls always returns false Steps to Reproduce the ProblemHere is my simple policy (playPolicy.rego):
Here is my input file (playInput.json)
Please help. Many thanks!!!
Additional Info |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 2 replies
-
For the v1 data API, input needs to be wrapped in |
Beta Was this translation helpful? Give feedback.
-
YES! IT DOES!! Thank you so much!!! |
Beta Was this translation helpful? Give feedback.
-
@srenatus , I am getting the exact same issue however in my case the input is generated by the http request and sent to OPA; I am not passing any input manually. How will be the format in such a case? Please advise. Below is policy and the input that is working in rego playground. Policy:
Input in rego playground:
Rego playground output:
|
Beta Was this translation helpful? Give feedback.
-
@srenatus , from postman I am calling my endpoint by passing the header
|
Beta Was this translation helpful? Give feedback.
For the v1 data API, input needs to be wrapped in
{"input": ... }
. Does that do the trick, perhaps?