ApiPlatform - 自定义操作上的 GroupFilter

问题描述

我想要一个这样的网址:

http://localhost/apI/Orders/test?name[]=test&name[]=toto

如果我有这个

@ApiFilter(GroupFilter::class,arguments={"parameterName": "name","overrideDefaultGroups": true})

所有路由都可以应用此过滤器,但我只想在自定义操作上应用过滤器。 有可能吗?

在我的代码中,我尝试了这个:

* @ApiResource(
 *     collectionoperations={
 *          "get"={},*          "indexByMarketplace"={
 *              "method"="get",*              "path"="/orders/test",*              "controller"=TestController::class,*              "defaults"={"_api_receive"=false},*              "openapi_context"={"parameters"={
 *                  {"in"="query","name"="externalIds[]","schema"={"type"="array","items"={"type": "string"}}}
 *              }},*              "pagination_enabled"=false
 *          }
 *     },

如果我这样做,网址如下所示: http://localhost/apI/Orders/test?name[]=toto,test

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)