public function validateUri(UriInterface $uri)
    {
        $path = trim($uri->getPath(), '/');

        $this->validateDepth($path);

        foreach (explode('/', $path) as $key) {
            $this->validateKeySize($key);
            $this->validateChars($key);
        }
    }