protected function getAvailableTypes(string $resource)
    {
        $cached = $this->cache['available_types'][$resource] ?? null;
        if ($cached !== null) {
            return $cached;
        }

        $types = $this->resources[$resource]['handlers']['GET'] ?? [];
        $types = (is_array($types))
            ? array_filter(array_replace($this->default_content_type, $types))
            : [];

        $this->cache['available_types'][$resource] = $types;
        return $types;
    }