Closed pg30 closed 1 year ago
You can use Gson directly to do that. You can pass in a string (your json-logic expression) and then use the Gson API to list all of the keys on the object. Search the object recursively to find objects that have exactly one key with the value "var"
.
As for the second part of the question, no - variables are static.
I need to parse the rule to find all the variables used in the rule so that I can build context with only required data. Is there a pre-defined method for that?? Also what are the possible ways for defining a variable name? Will it only be a number or a string or can it be a sub-rule in itself which can be evaluated to a variable name??