def check_definition(definition, current_expected, current_key = nil)
      definition.each do |error_key, match_def|
        if match_def.is_a? Hash
          key = [current_key, error_key].compact.join('.')
          check_each(key, match_def, current_expected)
        else
          check_values(current_key, error_key, match_def, current_expected)
        end
      end
    end
def check_definition(definition, current_expected, current_key = nil)
      definition.each do |error_key, match_def|
        if match_def.is_a? Hash
          key = [current_key, error_key].compact.join('.')
          check_each(key, match_def, current_expected)
        else
          check_values(current_key, error_key, match_def, current_expected)
        end
      end
    end
Walks through the match definition, collecting errors for each field
 @api private
 @param definition [Hash] defines how to lookup value in json and on object
 @param current_expected [Object] the serialized object being checked
 @current_key [String,nil] optional parent key passed while checking nested definitions
 @return [nil] returns nothing, adds to error list as side effect