问题描述
我正在使用Nelmio API Doc Bundle公开我的api文档.我将其与基本配置一起使用.还使用Symfony 3.1.但是在控制器上,即使我在ApiDoc批注中定义了输入参数,文档也不会显示输入.
Im using Nelmio API Doc Bundle to expose my api documentation. I use it with base configuration. Also using Symfony 3.1. But on controller even when i define the input parameter inside ApiDoc annotation the documentation does not show the input.
* @ApiDoc(
* section="Customer",
* description="Request reset password",
* input="AppBundle\Form\ResendConfirmationEmailType",
* statusCodes={
* 200="Returned when successful",
* 500="Returned on not found Customer"
* },
* tags={
* "beta" = "#4A7023",
* "v2" = "#ff0000"
* }
* )
是否缺少任何配置?或任何已知的错误?
There is any configuration im missing? or any known bug?
谢谢
推荐答案
这是一个已知的错误. https://github.com/nelmio/NelmioApiDocBundle/issues/208 我相信这并不是一个错误,而是过时的方法,我认为在Symfony 2.6中使用过.
It's a known bug. https://github.com/nelmio/NelmioApiDocBundle/issues/208And it's not really a bug, rather it's outdated approach, used in Symfony up to 2.6, I believe.
解决方案很简单-将FormType声明为服务,使用它,为其实现一个getName
,然后在输入中使用别名.
The solution is simple - declare you FormType as a service, use, implement a getName
for it, and then use an alias in input.
* input="resend_confirmation_type",
这篇关于nelmio api doc捆绑包不呈现输入类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!