Using a union of multiple properties, of which none exist, will return an empty object, or a list with a single empty object when using Option.ALWAYS_RETURN_LIST.
I would expect that, depending on configuration, either
an empty list is returned, or
an exception is thrown.
Tested with 2.7.0 and 2.8.0.
class Test {
public static void main(String[] args) {
String json = "{\"foo\":null}";
Object o = JsonPath.read(json, "$['bar','baz']");
// prints '{}'
System.out.println(o);
// throws Exception
o = JsonPath.read(json, "$.bar");
System.out.println(o);
}
}
Using a union of multiple properties, of which none exist, will return an empty object, or a list with a single empty object when using
Option.ALWAYS_RETURN_LIST
.I would expect that, depending on configuration, either
Tested with 2.7.0 and 2.8.0.