api-platform / api-platform/core
Allow devs to give an alias to a filter property
未關閉
- 主要語言
- PHP
- 星號
- 2.6k
- 分支
- 980
- 平均合併
- 2 天 4 小時
- 30 天內合併 PR
- 49
描述
**Description**
Allow devs to give an alias to a filter property, so that the user doesn't have to use a big query string parameter
**Example**
I have the following in an entity:
```
#[ApiFilter(SearchFilter::class, properties: ['baseProduct.brand.name' => 'partial'])]
```
So to filter by brand the user will have to do:
```
?baseProduct.brand.name=brandx
```
So maybe if I could do this:
```
#[ApiFilter(SearchFilter::class, properties: ['baseProduct.brand.name' => 'partial'], alias:['brand' => 'baseProduct.brand.name'] )]
```
The user could then do:
```
?brand=brandx
```
貢獻指南
評估
這個 Issue 還沒有評估資料。