/**
  * @param ResourceFactory $factory
  * @param ResourceMethod $method
  *
  * @return Div|string
  */
 protected function reflectOnRequest(ResourceFactory $factory, ResourceMethod $method)
 {
     try {
         $reflector = new ResourceReflector($this->container);
         $request = $reflector->getRequest($reflector->getMethodArgumentTypes($factory, $method));
         if ($request instanceof ApiCheckableRequest) {
             $spec = $request->getCheckable();
             if ($spec instanceof Validator) {
                 $spec = $spec->getSpec();
             }
             if (!$spec instanceof Spec) {
                 return 'Only Specs are supported at the moment.';
             }
             return new Div([], [new Div([], [new Bold([], 'Required: '), implode(', ', $spec->getRequired())]), new Div([], [new Table(['class' => 'table'], [new TableHeader([], [new TableRow([], [new TableHeaderCell([], 'Field'), new TableHeaderCell([], 'Constraints'), new TableHeaderCell([], 'Default')])]), new TableBody([], Std::map(function ($value, $key) use($spec) {
                 return $this->renderConstraint($spec, $key);
             }, $spec->getConstraints()))])])]);
         } else {
             return 'Handler cannot be reflected upon.';
         }
     } catch (Exception $e) {
         return 'Unable to resolve handler';
     }
 }