protected function validateIncludeParams()
    {
        $validParams = array_keys($this->config['include']['params']);
        $usedParams = array_keys(iterator_to_array($this->paramBag));

        if ($invalidParams = array_diff($usedParams, $validParams)) {
            // This validates query string KEY passed by an API client.
            throw new UnexpectedIncludesParamException(
                sprintf(
                    'Used param(s): "%s". Valid param(s): "%s"',
                    implode(',', $usedParams),
                    implode(',', $validParams)
                )
            );
        }

        $errors = [];

        if ($limit = $this->paramBag->get('limit')) {
            if (count($limit) !== 2) {
                array_push(
                    $errors,
                    'Invalid "limit" value. Valid usage: limit(int|int) where the first int is number of items to retrieve and the second is offset to skip over.'
                );
            }

            foreach($limit as $item) {
                if (! is_numeric($item)) {
                    array_push(
                        $errors,
                        'Invalid "limit" value. Expecting: integer. Given: ' . gettype($item) . " \"{$item}\"."
                    );
                }
            }
        }

        if ($sort = $this->paramBag->get('sort')) {
            if (count($sort) !== 2) {
                array_push(
                    $errors,
                    'Invalid "sort" value. Valid usage: sort(string|string) where the first string is attribute name to order by and the second is the sort direction(asc or desc)'
                );
            }

            $allowedSortDirection = ['asc', 'desc'];

            if (isset($sort[1]) && ! in_array(strtolower($sort[1]), $allowedSortDirection)) {
                array_push(
                    $errors,
                    'Invalid "sort" value. Allowed: ' . implode(',', $allowedSortDirection) . ". Given: \"{$sort[1]}\""
                );
            }
        }

        if (! empty($errors)) {
            throw new UnexpectedIncludesParamException(implode(PHP_EOL, $errors));
        }

        return true;
    }