From 3f3f2c85c392f31c409be75d8bce31d07c05d49d Mon Sep 17 00:00:00 2001 From: Baptiste Lafontaine Date: Mon, 9 Apr 2018 17:34:34 +0200 Subject: [PATCH] Make the nelmio/api-doc-bundle recipe works out of the box After applying this recipe, the route "/api/doc" was loaded by default, but it requires two component (`asset` and `twig`) that are usually not require for API only project. The json route works of the box so it can be provided without additional action. I faced it and it felt strange, and it seems that others have too : https://github.com/nelmio/NelmioApiDocBundle/issues/1220 --- .../3.0/config/routes/nelmio_api_doc.yaml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/nelmio/api-doc-bundle/3.0/config/routes/nelmio_api_doc.yaml b/nelmio/api-doc-bundle/3.0/config/routes/nelmio_api_doc.yaml index ba6d1437..618091cf 100644 --- a/nelmio/api-doc-bundle/3.0/config/routes/nelmio_api_doc.yaml +++ b/nelmio/api-doc-bundle/3.0/config/routes/nelmio_api_doc.yaml @@ -1,11 +1,12 @@ -# Requires the Asset component and the Twig bundle -app.swagger_ui: - path: /api/doc +# Expose your documentation as JSON swagger compliant +app.swagger: + path: /api/doc.json methods: GET - defaults: { _controller: nelmio_api_doc.controller.swagger_ui } + defaults: { _controller: nelmio_api_doc.controller.swagger } -# To expose your documentation as JSON -#app.swagger: -# path: /api/doc.json +## Requires the Asset component and the Twig bundle +## $ composer require composer require twig asset +#app.swagger_ui: +# path: /api/doc # methods: GET -# defaults: { _controller: nelmio_api_doc.controller.swagger } +# defaults: { _controller: nelmio_api_doc.controller.swagger_ui }