json-logic-java
json-logic-java copied to clipboard
A pure Java implementation of JsonLogic without using the Nashorn JS engine
Hi, i have json logic with var nested object, how to compute input data with nested object JsonLogic: `String expression = "{\"and\":[{\">=\":[{\"var\":\"loan.requestInfo.requestLoanAmount\"},10000000]},{\">=\":[{\"var\":\"user.level\"},1]},{\"==\":[{\"var\":\"loan.queueName\"},\"PTF_Credit_Approval\"]}]}";` Input Data: ` Map data = new HashMap();...
Resolving #32 by using `BigDecimal` instead of `double`
Calculations involving high precision floating point operations are returning incorrect results. For example: ```java String json = "{\"*\": [0.1, 0.1]}"; Object result = jsonLogic.apply(json, null); ``` This will return `0.010000000000000002`...
`import io.github.jamsesso.jsonlogic.JsonLogic; import io.github.jamsesso.jsonlogic.JsonLogicException; public class RuleEngine { private final static JsonLogic jsonLogic = new JsonLogic(); public static void main(String[] args) throws JsonLogicException { String expression = "{\"==\": [{\"var\": \"x.value\"},...
I encountered this exception when trying to let JsonLogic return a two-keyed object: `{ "resultType": "statistics", "resultValue": 2 }` Is there any method to return Json object as result? Thanks.
## Description Seeing an issue with the java library (v1.0.7) when logic should have returned an array of arrays but returned just an array ### Input ``` {"parentObject":{"childObject":{"array":[{"amount":500,"type":"SOME_TYPE"}]}}} ``` ###...
The operations are stored in a `List` (expressions) and when the operation is overwritten, the old version remains in the `Collection`. ```java public final class JsonLogic { private final List...
Here's a test from a test suite I'm working on at work: ```Java @Test public void testJsonLogic_doubleEquals_operator() throws JsonProcessingException, JsonLogicException { // With graph-shaped data var apples = """ {...
When using JsonLogic, I noticed that there are differences between using the Java SDK and the Web playground. For example, in the web version, I can get a result of...