I started to install like this:
https://symfony.com/doc/4.x/bundles/NelmioApiDocBundle/index.html
Step 1.
`composer require nelmio/api-doc-bundle` - Thats OK
Step 2.
class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = [
new Nelmio\ApiDocBundle\NelmioApiDocBundle(),
];
}
}
But I have no AppKernel extends Kernel. I **just have Kernel** with
`$contents = require $this->getProjectDir().'/config/bundles.php';`
So I added into **/config/bundles.php**
Nelmio\ApiDocBundle\NelmioApiDocBundle::class => ['all' => true],
Step 3.
I added into config/routes.yaml
# config/routes.yaml
app.swagger_ui:
path: /api/doc
methods: GET
defaults: { _controller: nelmio_api_doc.controller.swagger_ui }
Step 4.
I created config/packages/nelmio_api_doc.yaml with
nelmio_api_doc:
areas:
path_patterns: # an array of regexps
- ^/api(?!/doc$)
host_patterns:
- ^api\.
After that I should see Swagger's page at mysite/api/doc
But i see only white page with link 'NelmioApiDocBundle' at github
What I did wrong?
You need to specify areas in your nelmio_api_doc