protected function validateInput($input, Configuration $config, array $messages = []): self
    {
        try {
            $config->getValidationRules()->assert($input);
        } catch (NestedValidationException $e) {
            $this->handleValidationException($e, $config, $messages);
        }

        return $this->setValue($config->getKey(), $input, $config->getGroup());
    }