From 7520ef407f7f396aa597395c1a22d6d503483fc5 Mon Sep 17 00:00:00 2001 From: Guilhem Niot Date: Tue, 31 May 2022 14:17:59 +0200 Subject: [PATCH] Clarify default policy on routes --- Resources/doc/index.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Resources/doc/index.rst b/Resources/doc/index.rst index 2cc8c94..de41cae 100644 --- a/Resources/doc/index.rst +++ b/Resources/doc/index.rst @@ -35,6 +35,8 @@ Open a command console, enter your project directory and execute the following c $ composer require nelmio/api-doc-bundle +By default, only routes under ``/api`` are documented. Update the regexp at ``nelmio_api_doc.areas.path_patterns`` in ``config/packages/nelmio_api_doc.yaml`` to change this policy. + .. note:: If you're not using Flex, then add the bundle to your kernel:: @@ -82,9 +84,9 @@ Open a command console, enter your project directory and execute the following c # config/packages/nelmio_api_doc.yaml nelmio_api_doc: areas: - path_patterns: # an array of regexps + path_patterns: # an array of regexps (document only routes under /api, expect /api/doc) - ^/api(?!/doc$) - host_patterns: + host_patterns: # document only routes with a host of the form api.* - ^api\. How does this bundle work?