Nelmioapidocbundle: operationId should be string

Created on 3 Nov 2020  路  6Comments  路  Source: nelmio/NelmioApiDocBundle

1685

All 6 comments

Thanks for the report, it seems support for the null value was removed in zircote/swagger-php (see https://github.com/zircote/swagger-php/commit/70316e3411a203b73dab270f180b0f25e25f22fe#diff-95de59e4b4f717f2f8872b2209151efd4cfe46c688762478b229d88a10aaea22L166-L168)... I'll try to come up with another solution

Any updates?

Same problem here. :(
Would be cool if there were any generic solution without having to update all annotations manually. So using the name attribute of the Route annotation would be probably the most convenient fix.

Any updates?

As a quick workaround I'm currently deleting all occurrences of the operationId by using search and replace. Most Swagger/OpenApi tools seem to accept it then. But I'd love to have a better solution for this issue.

My workaround:

<?php

use FOS\RestBundle\Controller\Annotations as Rest;
use OpenApi\Annotations as OA;

/**
 * @Rest\Get("/items", name="getItems")
 * @OA\Get(operationId="getItems")
 */
public function getItems() { ... }

It would be the best to generate operationId based on route name attribute, but this works fine as well for me.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

knyk picture knyk  路  6Comments

numediaweb picture numediaweb  路  4Comments

ganchito55 picture ganchito55  路  4Comments

alxfv picture alxfv  路  5Comments

DavidGarciaCat picture DavidGarciaCat  路  4Comments