def validate_result(req, result, func)
      invalid = validate("", func.returns, func.returns["is_array"], result)
      if invalid == nil
        return nil
      else
        return err_resp(req, -32001, invalid)
      end
    end
def validate_result(req, result, func)
      invalid = validate("", func.returns, func.returns["is_array"], result)
      if invalid == nil
        return nil
      else
        return err_resp(req, -32001, invalid)
      end
    end
Validates that the result from a handler method invocation match the return type
 for this function

 Returns a JSON-RPC response hash if invalid, or nil if valid.

 * `req` - JSON-RPC request hash
 * `result` - Result object from the handler method call
 * `func` - Barrister::Function instance