Merge pull request #2003 from nelmio/GuilhemN-patch-2

Clarify default policy on routes
This commit is contained in:
Guilhem Niot 2022-06-03 19:14:32 +02:00 committed by GitHub
commit ee1fabe245
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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?