api-platform / api-platform/core

Allow devs to give an alias to a filter property

オープン
#8,037 コメント 5 件 リアクション 16 件 担当者 0 名 GitHub で見る
主要言語
PHP
スター
2.6k
フォーク
980
平均マージ
2日 2時間
マージ済み PR(30日)
51

説明

**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 はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。