getParsedBody(); $output = [ 'input' => $body, 'data' => [] ]; try { $file = $request->getUploadedFiles()['file']; $output['data'] = $diarioService->process($file); } catch (\Error) {} return $this->withJson($response, $output); } }