-
-
Notifications
You must be signed in to change notification settings - Fork 941
Open
Description
API Platform version(s) affected: 4.2.2
Description
As the document warns, ApiFilter is currently deprecated and using QueryParameter is recommended.
However, there are several bugs when applying filters using QueryParameter.
- With
QueryParameter, it is not possible to set multiple filters for the same property ExistsFilterandOrderFilteroutput incorrect parameter names to Hydra'ssearchproperty (Symfony only):propertykey cannot be used inSearchFilter(Symfony only)
:property key cannot be used in SearchFilter (Symfony only)
Although SearchFilter is deprecated, it has the following bugs:
#[QueryParameter(key: ':property', filter: 'serviceId.for.search_filter', properties: ['title', 'note'])]Although this code correctly outputs the parameters in OpenAPI as shown below, filtering does not actually occur when making requests with ?title={query} or ?note={query} appended.
The above code works correctly in Laravel, so it appears to be a bug in the Symfony version.
Incidentally, the following code also works correctly in Symfony.
#[QueryParameter(key: 'title', filter: 'serviceId.for.search_filter')]
#[QueryParameter(key: 'note', filter: 'serviceId.for.search_filter')]dlubitz
Metadata
Metadata
Assignees
Labels
No labels
