api-platform / api-platform/core

Allow devs to give an alias to a filter property

Aberta
#8,037 5 comentários 16 reações 0 responsáveis Ver no GitHub
Linguagem predominante
PHP
Estrelas
2.6k
Forks
980
Merge médio
2d 2h
PRs com merge (30d)
51

Descrição

**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
```

Guia de contribuição

Abrir o guia de contribuição

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.