|
@@ -57,18 +57,24 @@ class Generator
|
|
|
'id' => md5($this->getUri($route).':'.implode($this->getMethods($route))),
|
|
|
'methods' => $this->getMethods($route),
|
|
|
'uri' => $this->getUri($route),
|
|
|
- 'boundUri' => Utils::getFullUrl($route, $rulesToApply['bindings'] ?? ($rulesToApply['response_calls']['bindings'] ?? [])),
|
|
|
];
|
|
|
$metadata = $this->fetchMetadata($controller, $method, $route, $rulesToApply, $parsedRoute);
|
|
|
$parsedRoute['metadata'] = $metadata;
|
|
|
- $bodyParameters = $this->fetchBodyParameters($controller, $method, $route, $rulesToApply, $parsedRoute);
|
|
|
- $parsedRoute['bodyParameters'] = $bodyParameters;
|
|
|
- $parsedRoute['cleanBodyParameters'] = $this->cleanParams($bodyParameters);
|
|
|
+
|
|
|
+ $urlParameters = $this->fetchUrlParameters($controller, $method, $route, $rulesToApply, $parsedRoute);
|
|
|
+ $parsedRoute['urlParameters'] = $urlParameters;
|
|
|
+ $parsedRoute['cleanUrlParameters'] = $this->cleanParams($urlParameters);
|
|
|
+ $parsedRoute['boundUri'] = Utils::getFullUrl($route, $parsedRoute['cleanUrlParameters']);
|
|
|
|
|
|
$queryParameters = $this->fetchQueryParameters($controller, $method, $route, $rulesToApply, $parsedRoute);
|
|
|
$parsedRoute['queryParameters'] = $queryParameters;
|
|
|
$parsedRoute['cleanQueryParameters'] = $this->cleanParams($queryParameters);
|
|
|
|
|
|
+ $bodyParameters = $this->fetchBodyParameters($controller, $method, $route, $rulesToApply, $parsedRoute);
|
|
|
+ $parsedRoute['bodyParameters'] = $bodyParameters;
|
|
|
+ $parsedRoute['cleanBodyParameters'] = $this->cleanParams($bodyParameters);
|
|
|
+
|
|
|
+
|
|
|
$responses = $this->fetchResponses($controller, $method, $route, $rulesToApply, $parsedRoute);
|
|
|
$parsedRoute['response'] = $responses;
|
|
|
$parsedRoute['showresponse'] = ! empty($responses);
|
|
@@ -92,10 +98,9 @@ class Generator
|
|
|
|
|
|
return $this->iterateThroughStrategies('metadata', $context, [$route, $controller, $method, $rulesToApply]);
|
|
|
}
|
|
|
-
|
|
|
- protected function fetchBodyParameters(ReflectionClass $controller, ReflectionMethod $method, Route $route, array $rulesToApply, array $context = [])
|
|
|
+ protected function fetchUrlParameters(ReflectionClass $controller, ReflectionMethod $method, Route $route, array $rulesToApply, array $context = [])
|
|
|
{
|
|
|
- return $this->iterateThroughStrategies('bodyParameters', $context, [$route, $controller, $method, $rulesToApply]);
|
|
|
+ return $this->iterateThroughStrategies('urlParameters', $context, [$route, $controller, $method, $rulesToApply]);
|
|
|
}
|
|
|
|
|
|
protected function fetchQueryParameters(ReflectionClass $controller, ReflectionMethod $method, Route $route, array $rulesToApply, array $context = [])
|
|
@@ -103,6 +108,12 @@ class Generator
|
|
|
return $this->iterateThroughStrategies('queryParameters', $context, [$route, $controller, $method, $rulesToApply]);
|
|
|
}
|
|
|
|
|
|
+ protected function fetchBodyParameters(ReflectionClass $controller, ReflectionMethod $method, Route $route, array $rulesToApply, array $context = [])
|
|
|
+ {
|
|
|
+ return $this->iterateThroughStrategies('bodyParameters', $context, [$route, $controller, $method, $rulesToApply]);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
protected function fetchResponses(ReflectionClass $controller, ReflectionMethod $method, Route $route, array $rulesToApply, array $context = [])
|
|
|
{
|
|
|
$responses = $this->iterateThroughStrategies('responses', $context, [$route, $controller, $method, $rulesToApply]);
|
|
@@ -124,12 +135,15 @@ class Generator
|
|
|
'metadata' => [
|
|
|
\Mpociot\ApiDoc\Strategies\Metadata\GetFromDocBlocks::class,
|
|
|
],
|
|
|
- 'bodyParameters' => [
|
|
|
- \Mpociot\ApiDoc\Strategies\BodyParameters\GetFromBodyParamTag::class,
|
|
|
+ 'urlParameters' => [
|
|
|
+ \Mpociot\ApiDoc\Strategies\UrlParameters\GetFromUrlParamTag::class,
|
|
|
],
|
|
|
'queryParameters' => [
|
|
|
\Mpociot\ApiDoc\Strategies\QueryParameters\GetFromQueryParamTag::class,
|
|
|
],
|
|
|
+ 'bodyParameters' => [
|
|
|
+ \Mpociot\ApiDoc\Strategies\BodyParameters\GetFromBodyParamTag::class,
|
|
|
+ ],
|
|
|
'responses' => [
|
|
|
\Mpociot\ApiDoc\Strategies\Responses\UseResponseTag::class,
|
|
|
\Mpociot\ApiDoc\Strategies\Responses\UseResponseFileTag::class,
|