-
Notifications
You must be signed in to change notification settings - Fork 47
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
get the jsonlogic evaluated back from the method that apply #65
Comments
@diegoholiveira func solveVarsBackToJsonLogic(rule, data interface{}) ([]byte, error) {
ruleMap := rule.(map[string]interface{})
result := make(map[string]interface{})
for operator, values := range ruleMap {
result[operator] = solveVars(values, data)
}
body, err := json.Marshal(result)
if err != nil {
return nil, err
}
return body, nil
} It seems working for all my cases. Is this a good way to do it? |
hi @FlorianRuen , It looks like a good approach, so yeah, clear it out and send me PR and I'll review it. |
@diegoholiveira You can find the pull request right here : #66 |
Hey @diegoholiveira,
I'm using this library to apply a jsonlogic built from my UI (using https://react-querybuilder.js.org), but for my use case, I need to help users to "debug" if the response is false
To achieve this, my idea is to print to the user, the logic applied, but I want the vars replaced directly. To be clear, instead of
I need
I haven't seen any function that can achieve this (only
solveVars
andgetVar
)There is any way to get this result ?
Kindly
The text was updated successfully, but these errors were encountered: