*/ final class DefaultDescriber implements DescriberInterface { public function describe(Swagger $api) { // Info $info = $api->getInfo(); if (null === $info->getTitle()) { $info->setTitle(''); } if (null === $info->getVersion()) { $info->setVersion('0.0.0'); } // Paths $paths = $api->getPaths(); foreach ($paths as $uri => $path) { foreach ($path->getMethods() as $method) { $operation = $path->getOperation($method); // Default Response if (0 === iterator_count($operation->getResponses())) { $defaultResponse = $operation->getResponses()->get('default'); $defaultResponse->setDescription(''); } } } } }