-
Notifications
You must be signed in to change notification settings - Fork 54
Description
Hey @diegoholiveira
I'm using JsonLogic in Go backend, with sometimes complex logics (lot of sums, conditional ...)
And in order to help my end users to debug in case of false
result, I'm asking if there is a way to output the variable that cause the false
output
For example, output just need to be a string with variable name
{
"and":[
{ "==":[{ "var":"VariableA" }, true] },
{ ">=":[{ "var":"VariableC" }, 17179869184] },
]
}
If VariableA = false
and VariableC = 17179869184
The jsonlogic.Apply() output can be result, variable, err := jsonlogic.Apply()
With variable = "VariableA"
(or maybe an array in case of multiple var, or maybe only the first that cause false
result)
Do you think, this kind of behavior can be achieve, or because of the operation of jsonlogic which works with json, this will not be possible?
If yes, if you have some tips, maybe I can achieve this, and make another PR !