I can't find a way to sort the API paths defined in my PHP annotations with zircote/swagger-php, i found nothing in OpenAPI specification nor in swagger-php documentation to achieve this. This related GitHub thread didn't help much.
open-api.json
file is generated from the following command: bin/openapi -o doc/open-api.json --format json src
.
ReDoc displays the paths in the order they are defined in the "paths" variables in open-api.json
, but the order of the paths in the generated file are quite random (+ they don't always match the order of the php annotations in files).
Click for image : paths are sorted randomly
I tried to use the ReDoc sortOperationsAlphabetically
option (seems not supported by zircote/swagger-php) and set an operationId
to my paths.
I also tried to add use the SortComponents processor but failed to load it.
composer.json : PHP 7.4.33 Symfony 3.4 zircote/swagger-php 3.3.3
package.json (webpack) "redoc": "^2.0.0-rc.8-1"
Thanks for help :)