diff --git a/RamlDoc.php b/RamlDoc.php index 3ee91d7..5945bfa 100644 --- a/RamlDoc.php +++ b/RamlDoc.php @@ -103,7 +103,7 @@ public function isDefined($method, $path) { $raml = $this->getPathDefinition($path); - return isset($raml[$method]); + return array_key_exists($method, $raml); } /** @@ -134,9 +134,12 @@ public function getPathDefinition($path) foreach (explode('/', substr($path, 1)) as $part) { $resource = '/' . $part; + $fullResource = '/' . strstr($path, $part); if (isset($raml[$resource])) { $raml = $raml[$resource]; + } else if (isset($raml[$fullResource])) { + $raml = $raml[$fullResource]; } else { foreach (array_keys($raml) as $key) { if (static::isParameter($key)) {