From a176487881ce41dbe66cde00253b0f55460b32e4 Mon Sep 17 00:00:00 2001 From: Guilhem Niot Date: Wed, 3 Jan 2018 21:40:30 +0100 Subject: [PATCH 1/2] Add NelmioApiDocBundle 3.0 support --- .../3.0/config/packages/nelmio_api_doc.yaml | 9 +++++++++ .../3.0/config/routes/nelmio_api_doc.yaml | 10 ++++++++++ nelmio/api-doc-bundle/3.0/manifest.json | 8 ++++++++ 3 files changed, 27 insertions(+) create mode 100644 nelmio/api-doc-bundle/3.0/config/packages/nelmio_api_doc.yaml create mode 100644 nelmio/api-doc-bundle/3.0/config/routes/nelmio_api_doc.yaml create mode 100644 nelmio/api-doc-bundle/3.0/manifest.json diff --git a/nelmio/api-doc-bundle/3.0/config/packages/nelmio_api_doc.yaml b/nelmio/api-doc-bundle/3.0/config/packages/nelmio_api_doc.yaml new file mode 100644 index 00000000..59a3dc96 --- /dev/null +++ b/nelmio/api-doc-bundle/3.0/config/packages/nelmio_api_doc.yaml @@ -0,0 +1,9 @@ +nelmio_api_doc: + documentation: + info: + title: My App + description: This is an awesome app! + version: 1.0.0 + routes: # to filter documented routes + path_patterns: + - ^/api(?!/doc$) # Accepts routes under /api except /api/doc 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 new file mode 100644 index 00000000..6cad0e48 --- /dev/null +++ b/nelmio/api-doc-bundle/3.0/config/routes/nelmio_api_doc.yaml @@ -0,0 +1,10 @@ +# Requires the Asset component and the Twig bundle +app.swagger_ui: + path: /api/doc + methods: GET + defaults: { _controller: nelmio_api_doc.controller.swagger_ui } + +# app.swagger: +# path: /api/doc.json +# methods: GET +# defaults: { _controller: nelmio_api_doc.controller.swagger } diff --git a/nelmio/api-doc-bundle/3.0/manifest.json b/nelmio/api-doc-bundle/3.0/manifest.json new file mode 100644 index 00000000..5eda2d4a --- /dev/null +++ b/nelmio/api-doc-bundle/3.0/manifest.json @@ -0,0 +1,8 @@ +{ + "bundles": { + "Nelmio\\ApiDocBundle\\NelmioApiDocBundle": ["all"] + }, + "copy-from-recipe": { + "config/": "%CONFIG_DIR%/" + } +} From 1e92a89c66d85b581b977f3228520ed9e8ec7c08 Mon Sep 17 00:00:00 2001 From: Guilhem Niot Date: Thu, 4 Jan 2018 16:39:32 +0100 Subject: [PATCH 2/2] Add a comment --- .../api-doc-bundle/3.0/config/routes/nelmio_api_doc.yaml | 9 +++++---- 1 file changed, 5 insertions(+), 4 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 6cad0e48..ba6d1437 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 @@ -4,7 +4,8 @@ app.swagger_ui: methods: GET defaults: { _controller: nelmio_api_doc.controller.swagger_ui } -# app.swagger: -# path: /api/doc.json -# methods: GET -# defaults: { _controller: nelmio_api_doc.controller.swagger } +# To expose your documentation as JSON +#app.swagger: +# path: /api/doc.json +# methods: GET +# defaults: { _controller: nelmio_api_doc.controller.swagger }