Hi,
Depth-first searching doesn't work (afaik) in Groovy with JSON documents unfortunately.
Here's what you can do:
List<String> list = from(json).getList("root.names*.getKey()", String.class);
Which will return [randomName3, randomName2, randomName1]. I don't know why the order is reversed but you can easily fix this (if order is important):
List<String> list = from(json).getList("root.names*.getKey().reverse()", String.class);
"*." means that for each element in the "root.names" list invoke method "getKey()".