Allow specifying the query parameter name when using `ApiFilter`
Description
If is often desirable to filter on api resource properties, but you might not want to use the names of the properties directly to do so.
It would be nice to be able to decouple the name of the property from the query parameter used to query that property.
Example Something like this would be undesirable to the consumer of your API.
#[ApiResource(
operations: [
new GetCollection(),
],
)]
#[ApiFilter(DateFilter::class, properties: [
'reallyBadlyNamedDateForLegacyReasons',
])]
class Foo
{
public \DateTimeInterface $reallyBadlyNamedDateForLegacyReasons;
}
We would not want to expose the name reallyBadlyNamedDateForLegacyReasons directly to the consumer, and instead let them use a more friendly name
possibly a way to specificy on ApiFilters properties, the query parameter that the client can use to filter, something like (i've not thought about the naming):
#[ApiFilter(DateFilter::class, properties: [
'reallyBadlyNamedDateForLegacyReasons' => ['filter_param_name' => 'date']
])]
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.