I would like to compare two rest api responses in Java. Currently I am using zjsonpatch library and with that I am able to get the difference but the difference contains the value of one of the jsons. I would like to have both the json nodes.
Please find below my code:
ObjectMapper jacksonObjectMapper = new ObjectMapper();
JsonNode beforeNode = jacksonObjectMapper.readTree(jsonActual);
JsonNode afterNode = jacksonObjectMapper.readTree(jsonCurrent);
JsonPatch patch = JsonDiff.asJsonPatch(beforeNode, afterNode);
String diffs = patch.toString();
Below is the output I am getting
op: replace; path: "/businessServiceabilityResponse/0/serviceabilityDetail/0/serviceabilitySource"; value: "ELOC"]
Is there a way I can get both the nodes which are not matching?