An extension for nelmio/api-doc-bundle that improves the sorting of endpoints by tags and provides minor stylistic corrections to the original Nelmio view.
Required bundles:
composer require symfony/asset
composer require symfony/twig-bundle
composer require nelmio/api-doc-bundle
composer require pbaszak/extended-api-doc-bundleRouting Registration:
- /api/doc
- /api/doc.json
- /api/doc.yaml
# config/routes.yaml
...
extended_api_doc:
resource: '@ExtendedApiDocBundle/Resources/routes/*'Setup metainfo:
# config/packages/nelmio_api_doc.yaml
parameters:
app_title: '%env(APP_TITLE)%'
app_description: '%env(APP_DESCRIPTION)%'
app_version: '%env(APP_VERSION)%'
app_commit_sha_short: '%env(APP_COMMIT_SHA_SHORT)%'
nelmio_api_doc:
documentation:
info:
title: '%app_title%'
description: '%app_description%'
version: '%app_version% (%app_commit_sha_short%)'
areas: # to filter documented areas
path_patterns:
- ^/api(?!/doc(.json|.yaml)?$)Just open /api/doc path on Your server and enjoy!
Start local environment using this command:
bash start.shIf You don't have node_modules directory run:
npm installMajor, Minor, Patch version update:
npm run version:major
# or
npm run version:minor
# or
npm run version:patchPush tags:
npm run version:release
# or
npm run releaseCheck package.json for understand what commands do.
Main command:
docker exec php composer code:analysebut, if You need to add errors to ignored:
docker exec php composer code:analyse:bdocker exec php composer code:fixCreate new file in Your project: .vscode/launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "Listen for xDebug",
"type": "php",
"request": "launch",
"port": 5902,
"hostname": "0.0.0.0",
"pathMappings": {
"/app/": "${workspaceRoot}"
}
}
]
}Uncomment environments in .env.local:
XDEBUG_MODE=develop,debug
XDEBUG_CONFIG=" client_port=5902 idekey=VSCODE client_host=host.docker.internal discover_client_host=0 start_with_request=yes"Type Ctrl + Shift + D and run Listen for xDebug.
