Skip to content

Commit 7b2f887

Browse files
authored
docs(openapi): api gateway drops bracketed params (#2351)
1 parent 588a90a commit 7b2f887

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

‎core/openapi.md‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -900,6 +900,22 @@ To enable API Gateway compatibility on your OpenAPI docs, add `api_gateway=true`
900900
`http://www.example.com/docs.jsonopenapi?api_gateway=true`. The flag `--api-gateway` is also
901901
available through the command-line.
902902

903+
The compatibility layer removes every query parameter whose name does not match
904+
`^[a-zA-Z0-9._$-]+$` from the generated specification. Bracketed filter parameters such as
905+
`order[title]` or `exists[author]` are dropped, not renamed. To keep a filter usable behind API
906+
Gateway, declare it with a [`QueryParameter`](filters.md#declaring-parameters) and a bracket-free
907+
key:
908+
909+
```php
910+
use ApiPlatform\Doctrine\Orm\Filter\SortFilter;
911+
use ApiPlatform\Metadata\GetCollection;
912+
use ApiPlatform\Metadata\QueryParameter;
913+
914+
#[GetCollection(parameters: [
915+
'order_title' => new QueryParameter(filter: new SortFilter(), property: 'title'),
916+
])]
917+
```
918+
903919
## OAuth
904920

905921
### OAuth using Symfony

0 commit comments

Comments
 (0)