ApiPlatform\Core\Swagger\Serializer\DocumentationNormalizer::computeDoc PHP Method

computeDoc() private method

Computes the Swagger documentation.
private computeDoc ( Documentation $documentation, ArrayObject $definitions, ArrayObject $paths ) : array
$documentation ApiPlatform\Core\Documentation\Documentation
$definitions ArrayObject
$paths ArrayObject
return array
    private function computeDoc(Documentation $documentation, \ArrayObject $definitions, \ArrayObject $paths) : array
    {
        $doc = ['swagger' => self::SWAGGER_VERSION, 'basePath' => $this->urlGenerator->generate('api_entrypoint'), 'info' => ['title' => $documentation->getTitle(), 'version' => $documentation->getVersion()], 'paths' => $paths];
        if ('' !== ($description = $documentation->getDescription())) {
            $doc['info']['description'] = $description;
        }
        if (count($definitions) > 0) {
            $doc['definitions'] = $definitions;
        }
        return $doc;
    }