test for correct keys in nested arrays/objects