소스 검색

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);
     }