I\'m fairly new to JSONPath so this could be my fault but when I try this expression in an online evaluator (https://jsonpath.com/) it works but does not in Karate.
The JsonPath engine is known to have issues with such complex expressions. Please use karate.filter()
instead which I am sure you will agree is much more readable: https://github.com/intuit/karate#json-transforms
* def resources = $..resource
* def fun = function(x){ return x.resourceType == 'AllergyIntolerance' && x.category[0] == 'food' }
* def temp = karate.filter(resources, fun)