NelmioApiDocBundle
NelmioApiDocBundle copied to clipboard
Using disable_default_routes filters out routes using attributes
Given this config
nelmio_api_doc:
areas:
disable_default_routes: true
And this controller
<?php
namespace App\Action;
use OpenApi\Attributes as OA;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\Routing\Annotation\Route;
class TestAction
{
#[Route('/api/test', methods: ['POST'])]
#[OA\Post(
operationId: 'test',
summary: 'Test endpoint',
tags: ['Test'],
responses: [
new OA\Response(response: 201, description: 'test'),
new OA\Response(response: 400, description: 'Bad request')
],
)]
public function __invoke() : JsonResponse
{
return new JsonResponse(['success']);
}
}
No docs are generated.
The provided PR resolves this issue