add recursive functionality for validating nested attributes

add tests for recursive feature