I want to use NelmioApiDocBundle for generating documentation automatically. I fallowed standard Symfony doc to install and configure it: https://symfony.com/doc/current/bundles/NelmioApiDocBundle/index.html. Unfortunately when I go to /api/doc my doc is empty.
I use Symfony 3.4 and NelmioApiDocBundle in v. 3.2.0.
Here is my config:
nelmio_api_doc:
areas:
path_patterns: # an array of regexps
- ^/api(?!/doc$)
host_patterns:
- ^api\.
documentation:
host: 127.0.0.1
schemes: [http, https]
info:
title: Thanatos API
description: This is documentation of Thanatos
version: 1.0.0
security:
- Bearer: []
And annotations in my controller (in beginning I want to see any data in my documentation):
/**
* @Route(
* "/",
* name="thanatos_dashboard_index",
* )
*
* @SWG\Response(
* response=200,
* description="Returns the rewards of an user",
* @SWG\Schema(
* type="array",
* @SWG\Items(ref=@Model(type=Reward::class, groups={"full"}))
* )
* )
* @SWG\Parameter(
* name="order",
* in="query",
* type="string",
* description="The field used to order rewards"
* )
* @SWG\Tag(name="rewards")
* @NelmioSecurity(name="Bearer")
*/
public function indexAction()
{
return $this->render("@AppThanatos/Dashboard/index.html.twig");
}
In /api/doc I see "No operations defined in spec!". What am I doing wrong?
@UPDATE
I just start to use Sami: http://symfony.com/projects/sami