-
-
Notifications
You must be signed in to change notification settings - Fork 949
Open
Description
API Platform version(s) affected: 4.2.2
Description
If I try to use the new ApiPlatform\Doctrine\Orm\Filter\PartialSearchFilter or ApiPlatform\Doctrine\Orm\Filter\ExactFilter in combination of a :property placeholder as the example in the docs , the filters throw an exception, as the property name is null.
If I add one of the filter directly to a parameter, the filter works fine.
How to reproduce
<?php
// api/src/Resource/Book.php
#[ApiResource(operations: [
new GetCollection(
parameters: [
// This WILL restrict to only title and author properties
'search[:property]' => new QueryParameter(
properties: ['title', 'author'], // Only these properties get parameters created
filter: new PartialSearchFilter()
)
]
)
])]
class Book {
// ...
}Exception:
ApiPlatform\\Doctrine\\Orm\\Util\\QueryNameGenerator::generateParameterName(): Argument #1 ($name) must be of type string, null given, called in /var/www/html/backend/vendor/api-platform/doctrine-orm/Filter/PartialSearchFilter.php on line 37Possible Solution
T.B.D.
Vinarnt and Coffee2CodeNL
Metadata
Metadata
Assignees
Labels
No labels