diff --git a/Annotation/ApiDoc.php b/Annotation/ApiDoc.php index dd7242a..a132a1b 100644 --- a/Annotation/ApiDoc.php +++ b/Annotation/ApiDoc.php @@ -579,6 +579,14 @@ class ApiDoc return $this; } + /** + * @return string + */ + public function getMethod() + { + return $this->method; + } + /** * @return array */ diff --git a/Extractor/ApiDocExtractor.php b/Extractor/ApiDocExtractor.php index 9241516..ac1b503 100644 --- a/Extractor/ApiDocExtractor.php +++ b/Extractor/ApiDocExtractor.php @@ -282,7 +282,7 @@ class ApiDocExtractor $parameters = $this->clearClasses($parameters); $parameters = $this->generateHumanReadableTypes($parameters); - if ('PUT' === $method) { + if ('PUT' === $annotation->getMethod()) { // All parameters are optional with PUT (update) array_walk($parameters, function ($val, $key) use (&$data) { $parameters[$key]['required'] = false;