api-platform / api-platform/core
Allow devs to give an alias to a filter property
Offen
- Vorherrschende Sprache
- PHP
- Sterne
- 2.6k
- Forks
- 980
- Ø Merge
- 2 T. 4 Std.
- Gemergte PRs (30 T.)
- 49
Beschreibung
**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
```
Beitragsleitfaden
Bewertung
Dieses Issue wurde noch nicht bewertet.