public function validate(array $input)
    {
        $result = $this->parse($input);

        if ($result === null) {
            throw new InvalidJsonException(
                'Parser was unable to process the JSON due to there not being a data key.'
            );
        }

        if (count($this->seenTypes) > 0) {
            array_walk($this->presenceCheckers, function (callable $callback = null, $type) {
                if ($callback !== null) {
                    try {
                        $isRequired = $callback($this->seenTypes);
                    } catch (FailedValidationException $exception) {
                        $this->errors = array_merge($this->errors, [
                            $type => $exception->getMessages()
                        ]);

                        return;
                    }

                    if ($isRequired === false) {
                        return;
                    }
                } elseif ($this->seenTypes->has($type)) {
                    return;
                }

                $this->errors[$type] = 'Missing api resource from the request.';
            });
        }

        if (count($this->errors) > 0) {
            throw new FailedValidationException($this->errors);
        }

        return true;
    }