예제 #1
0
 /**
  * {@inheritdoc}
  */
 public function handle(ApiDoc $annotation, array $annotations, Route $route, \ReflectionMethod $method)
 {
     foreach ($annotations as $description) {
         if (!$description instanceof ApiDescription) {
             continue;
         }
         $current = $annotation->toArray();
         $request = [];
         foreach ($description->getRequest() as $name => $field) {
             $request[$name] = $this->convertField($field);
         }
         $annotation->setParameters(array_merge($annotation->getParameters(), $request));
         if (!isset($current['response'])) {
             $response = [];
             foreach ($description->getResponse() as $name => $field) {
                 $response[$name] = $this->convertField($field);
             }
             $annotation->setResponse($response);
         }
     }
 }