Implement packet validation for array and objects. Add a test case.