public function getPath(array $pathParameters = null) {

		$path = $this->path;
		
		//insert path parameters
			
		if(!empty($this->placeholders)) {
			
			foreach ($this->placeholders as $placeholder) {

				// use path parameter if it was passed on

				$regExp = '~\{' . $placeholder['name'] . '(=.*?)?\}~';
				
				if($pathParameters && array_key_exists($placeholder['name'], $pathParameters)) {
					
					$path = preg_replace($regExp, $pathParameters[$placeholder['name']], $path);
					
				}

				// try to use previously set path parameter
				
				else if($this->pathParameters && array_key_exists($placeholder['name'], $this->pathParameters)) {
					$path = preg_replace($regExp, $this->pathParameters[$placeholder['name']], $path);
				}

				// no path parameter value passed on, but default defined
				
				else if(isset($placeholder['default'])){
					$path = preg_replace($regExp, $placeholder['default'], $path);
				}

				else {
					throw new \RuntimeException(sprintf("Path parameter '%s' not set.", $placeholder['name']));
				}

			}
		}

		// remove trailing slashes which might stem from one or more empty path parameters

		return rtrim($path, '/');

	}