Add the validation code for nested data structures.