private function parseParameters(RequestInterface $request): array
    {
        $parameters = [];
        $versionHeaders = $request->getHeader(self::API_VERSION_HEADER);
        $groupHeaders = $request->getHeader(self::API_GROUPS_HEADER);

        $versionHeader = reset($versionHeaders);
        $groupHeader = reset($groupHeaders);

        if (preg_match(self::API_VERSION_REGEXP, $versionHeader, $matches)) {
            $parameters['serialization_version'] = $matches['version'];
        }

        if (preg_match(self::API_GROUPS_REGEXP, $groupHeader, $matches)) {
            $parameters['serialization_groups'] = array_map(
                'trim',
                explode(',', $matches['groups'])
            );
        }

        return array_merge(
            $request->get('_borobudur', []),
            $parameters
        );
    }