我使用动态表单(定义为服务(!))来启用/禁用特定请求(POST/PUT/PATCH)的某些字段。我希望通过将选项传递给文档中所述的表单来自动显示在 ApiDoc 中。但它不起作用。我用这个:
* @ApiDoc(
* section = "...",
* description = "...",
* input = {
* "class" = "my_form_type_alias",
* "options" = {"method" = "PUT"},
* "name" = ""
* },
* statusCodes = {
* 200 = "Updated (seems to be OK)",
* 400 = "Bad request (see messages)",
* 401 = "Unauthorized, you must login first",
* 404 = "Not found",
* }
* )
但是通过 xdebug 我可以看到 $options['method'] 总是等于 'POST',就像我没有指定“options”={“method”=“PUT”} 时一样。