【发布时间】:2019-02-10 07:11:33
【问题描述】:
我想将 nelmio 用于 symfony-project,但它不起作用。
它总是说:规范中没有定义任何操作!
我也尝试了https://symfony.com/doc/current/bundles/NelmioApiDocBundle/index.html上的示例
怎么了?有什么想法吗?
routing.yml
app.swagger_ui:
path: /api/doc
methods: GET
defaults: { _controller: nelmio_api_doc.controller.swagger_ui }
config.yml
nelmio_api_doc:
areas:
path_patterns: # an array of regexps
- ^/api(?!/doc$)
host_patterns:
- ^api\.
控制器
/**
* @Route("/api/test", methods={"GET"})
* @SWG\Response(
* response=200,
* description="Returns the rewards of an user"
* )
* @SWG\Parameter(
* name="order",
* in="query",
* type="string",
* description="The field used to order rewards"
* )
*/
public function testAction()
{
}
composer.json
"symfony/symfony": "3.4.*",
"nelmio/api-doc-bundle": "3.2.1",
【问题讨论】:
-
我也遇到了同样的问题,你解决了吗?
标签: symfony symfony-3.4 nelmioapidocbundle