diff --git a/src/bundle/ApiPlatform/OpenApiFactory.php b/src/bundle/ApiPlatform/OpenApiFactory.php index 85ce93550..1f4d17715 100644 --- a/src/bundle/ApiPlatform/OpenApiFactory.php +++ b/src/bundle/ApiPlatform/OpenApiFactory.php @@ -9,10 +9,13 @@ namespace Ibexa\Bundle\Rest\ApiPlatform; use ApiPlatform\OpenApi\Factory\OpenApiFactoryInterface; +use ApiPlatform\OpenApi\Model\Info; use ApiPlatform\OpenApi\Model\Operation; use ApiPlatform\OpenApi\Model\Response; +use ApiPlatform\OpenApi\Model\Tag; use ApiPlatform\OpenApi\OpenApi; use ArrayObject; +use Ibexa\Contracts\Core\Ibexa; use Symfony\Component\HttpKernel\KernelInterface; final readonly class OpenApiFactory implements OpenApiFactoryInterface @@ -30,8 +33,15 @@ public function __construct( public function __invoke(array $context = []): OpenApi { $openApi = ($this->decorated)($context); + $openApi = $openApi->withInfo((new Info('Ibexa DXP REST API', Ibexa::VERSION))); $openApi = $this->addSchemas($openApi); + $tags = $openApi->getTags(); + usort($tags, function (Tag $a, Tag $b): int { + return strcmp($a->getName(), $b->getName()); + }); + $openApi = $openApi->withTags($tags); + $this->insertExampleFilesContent($openApi); return $openApi;