Utility for checking if a nested object is valid.