Open
Description
Description
Currently, the BackedEnumFilter
in API Platform only supports filtering by a single enum value. This differs from the behavior of SearchFilter[exact]
, which can handle multiple values.
When migrating from string constants to backed enums, it would be nice if BackedEnumFilter could be a plug in solution for SearchFilter[exact].
Example
Before:
When using BackedEnumFilter
, you can only filter by a single enum value:
GET /books?status=published
After:
Support both single values and multiple values
GET /books?status=published
GET /books?status[]=published&status[]=in_review
The implementation:
- Modifies
filterProperty
to accept array values and useIN
SQL operator - Updates
getDescription
to document both single value and array notation (propertyName[]
) - Maintains backward compatibility with existing usage
I will link a PR shortly.
Metadata
Metadata
Assignees
Labels
No labels