test to detect if a key within an array is optional or required