2016-07-29 10:22:40 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/*
|
|
|
|
* This file is part of the ApiDocBundle package.
|
|
|
|
*
|
|
|
|
* (c) EXSyst
|
|
|
|
*
|
|
|
|
* For the full copyright and license information, please view the LICENSE
|
|
|
|
* file that was distributed with this source code.
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace EXSyst\Bundle\ApiDocBundle\Describer;
|
|
|
|
|
|
|
|
use ApiPlatform\Core\Documentation\Documentation;
|
2016-11-18 22:16:53 +01:00
|
|
|
use ApiPlatform\Core\Swagger\Serializer\DocumentationNormalizer;
|
2016-07-29 10:22:40 +02:00
|
|
|
|
|
|
|
class ApiPlatformDescriber extends ExternalDocDescriber
|
|
|
|
{
|
|
|
|
public function __construct(Documentation $documentation, DocumentationNormalizer $normalizer, bool $overwrite = false)
|
|
|
|
{
|
|
|
|
parent::__construct(function () use ($documentation, $normalizer) {
|
2016-11-18 22:16:53 +01:00
|
|
|
return (array) $normalizer->normalize($documentation);
|
2016-07-29 10:22:40 +02:00
|
|
|
}, $overwrite);
|
|
|
|
}
|
|
|
|
}
|