refactor validate() and resolve()
add support for allOf