浏览代码

Response example for routes with parameters

Rytis 8 年之前
父节点
当前提交
0baa6779ae
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      src/Mpociot/ApiDoc/Generators/AbstractGenerator.php

+ 3 - 0
src/Mpociot/ApiDoc/Generators/AbstractGenerator.php

@@ -76,6 +76,9 @@ abstract class AbstractGenerator
             return [trim($split[0]) => trim($split[1])];
         })->collapse()->toArray();
 
+        //Changes url with parameters like /users/{user} to /users/1
+        $uri =  preg_replace("/{(.*)}/", 1, $uri);
+        
         return $this->callRoute(array_shift($methods), $uri, [], [], [], $headers);
     }