custom/plugins/CkoShopware6/src/Subscriber/OpenApiPathsSubscriber.php line 18

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace Cko\Shopware6\Subscriber;
  3. use Shopware\Core\Framework\Api\ApiDefinition\Generator\OpenApi\Event\OpenApiPathsEvent;
  4. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  5. class OpenApiPathsSubscriber implements EventSubscriberInterface
  6. {
  7.     public static function getSubscribedEvents(): array
  8.     {
  9.         return [OpenApiPathsEvent::class => 'onOpenApiPaths'];
  10.     }
  11.     /**
  12.      * Add register path to swagger
  13.      */
  14.     public function onOpenApiPaths(OpenApiPathsEvent $event): void
  15.     {
  16.         $event->addPath(__DIR__ '/../Struct');
  17.     }
  18. }