public function buildInput(ApiDoc $annotation, $data = null)
    {
        $annotationReflection = new \ReflectionClass('Nelmio\ApiDocBundle\Annotation\ApiDoc');
        $inputReflection = $annotationReflection->getProperty('input');
        $inputReflection->setAccessible(true);

        if (!(isset($data['input']) || $data['input'] === null) || empty($data['input'])) {
            if ($annotation->toArray()['method'] === 'POST' || $annotation->toArray()['method'] === 'PUT') {
                $actionName = $annotation->getRoute()->getDefault('_controller');
                $controllerClass = substr($actionName, 0, strpos($actionName, '::'));
                $reflectionClass = new \ReflectionClass(substr($controllerClass, strpos($controllerClass, ':')));
                $class = str_replace('Controller', '', $reflectionClass->getShortName());
                $inputType = 'Kreta\\Component\\' . $class . '\\Form\\Type\\' . $class . 'Type';
                if (class_exists($inputType)) {
                    $inputReflection->setValue($annotation, $inputType);
                }
            }
        } else {
            $inputReflection->setValue($annotation, $data['input']);
        }

        return $annotation;
    }