public function asResource(HttpUri $uri, array $globalMimeTypes = []): Resource
    {
        $routeUri = $uri->withPath($this->normalizePath());
        return new Resource(
                $this->resourceName(),
                $this->allowedRequestMethods,
                $this->requiresHttps() ? $routeUri->toHttps() : $routeUri,
                $this->supportedMimeTypes($globalMimeTypes)->asArray(),
                $this->routingAnnotations(),
                $this->authConstraint()
        );
    }