nelmio api doc bundle not render input type

和自甴很熟 提交于 2019-12-13 07:37:06

问题


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?

Thanks


回答1:


It's a known bug. https://github.com/nelmio/NelmioApiDocBundle/issues/208 And it's not really a bug, rather it's outdated approach, used in Symfony up to 2.6, I believe.

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",


来源:https://stackoverflow.com/questions/39970233/nelmio-api-doc-bundle-not-render-input-type

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!