From 457783217878756253fcb29322247425fbaec9b3 Mon Sep 17 00:00:00 2001 From: CRC <46287826+pysocrates@users.noreply.github.com> Date: Wed, 11 Nov 2026 15:04:07 -0500 Subject: [PATCH] docs: document invalid IRI parameter option --- core/filters.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/core/filters.md b/core/filters.md index ce0bc5aa139..5b0deeaa81f 100644 --- a/core/filters.md +++ b/core/filters.md @@ -751,6 +751,23 @@ The `IriConverterParameterProvider` supports the following options in `extraProp - **`fetch_data`**: Boolean (default: `false`) - When `true`, forces the IRI converter to fetch the actual entity data instead of just creating a reference. +- **`throw_invalid_argument`**: Boolean (default: `false`) - When `true`, propagate invalid IRI + exceptions instead of logging them. With the default Symfony exception mapping, this returns HTTP + 400. This applies to both single IRIs and arrays. +- **`throw_not_found`**: Boolean (default: `false`) - When `true`, propagate exceptions for resources + that cannot be found. Use `fetch_data: true` when the converter must check that the resource exists. + +For example, to reject malformed IRIs in an `IriFilter` parameter: + +```php +use ApiPlatform\Doctrine\Orm\Filter\IriFilter; +use ApiPlatform\Metadata\QueryParameter; + +new QueryParameter( + filter: new IriFilter(), + extraProperties: ['throw_invalid_argument' => true], +) +``` ### `ReadLinkParameterProvider`