2

我开始了一个新的 Symfony 2.8 项目,我想用 swagger 来记录它。我安装了NelmioApiDocBundle并且工作正常。这是我唯一的路线:

/**
 *
 * @ApiDoc(
 *     section="Notification",
 *      resource=true,
 *   description="This method receive a notification and send it to the people concerned",
 *   parameters={
 *      {"name"="message", "dataType"="string", "required"=true, "description"="The message to be send"}
 *  })
 *
 * @Route("/notify")
 * @Method("POST")
 * @param Request $request
 *
 * @return JsonResponse
 */
public function postNotifyAction(Request $request)
{ ...

我的路由.yml:

notification:
    resource: "@NotificationBundle/Controller/"
    type:     annotation
    prefix:   /
NelmioApiDocBundle:
    resource: "@NelmioApiDocBundle/Resources/config/routing.yml"
    prefix:   /api/doc
nelmio_api_swagger:
    resource: "@NelmioApiDocBundle/Resources/config/swagger_routing.yml"
    prefix: /api/swagger

当我访问路线/api/doc时,它工作正常:

内尔米奥医生

但是大摇大摆的一个:(/api/swagger应该根据:This doc工作)对于我的路线是空的:

在此处输入图像描述

命令 app/consoleapi:swagger:dump工作正常: 在此处输入图像描述

我错过了什么吗?

4

0 回答 0